Skip to content

Commit

Permalink
Make regexps raw strings to avoid syntax error in python 3.12 (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
iandobbie committed Jun 8, 2024
1 parent 5326c4b commit 7780158
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cockpit/devices/microscopeDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ def __init__(self, *args, **kwargs):
# Cameras
cdefs = self.config.get('cameras', None)
if cdefs:
self.cameras = re.split('[,;]\s*', cdefs)
self.cameras = re.split(r'[,;]\s*', cdefs)
else:
self.cameras = None

# Lights
ldefs = self.config.get('lights', None)
if ldefs:
self.lights = re.split('[,;]\s*', ldefs)
self.lights = re.split(r'[,;]\s*', ldefs)
else:
self.lights = None

Expand All @@ -383,7 +383,7 @@ def __init__(self, *args, **kwargs):
raise Exception(
"Missing 'filters' value for device '%s'" % self.name
)
fdefs = [re.split(':\s*|,\s*', f) for f in re.split('\n', fdefs) if f]
fdefs = [re.split(r':\s*|,\s*', f) for f in re.split(r'\n', fdefs) if f]
self.filters = [cockpit.handlers.filterHandler.Filter(*f) for f in fdefs]


Expand Down

0 comments on commit 7780158

Please sign in to comment.