Merge pull request #421 from wom-bat/python3_12

Fix syntax for Python 3.12
This commit is contained in:
Somdev Sangwan
2025-03-16 19:08:29 +05:30
committed by GitHub

View File

@@ -24,7 +24,7 @@ def dom(response):
for part in parts: for part in parts:
for controlledVariable in allControlledVariables: for controlledVariable in allControlledVariables:
if controlledVariable in part: if controlledVariable in part:
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$')) controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\\$'))
pattern = re.finditer(sources, newLine) pattern = re.finditer(sources, newLine)
for grp in pattern: for grp in pattern:
if grp: if grp:
@@ -33,7 +33,7 @@ def dom(response):
if len(parts) > 1: if len(parts) > 1:
for part in parts: for part in parts:
if source in part: if source in part:
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$')) controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\\$'))
line = line.replace(source, yellow + source + end) line = line.replace(source, yellow + source + end)
for controlledVariable in controlledVariables: for controlledVariable in controlledVariables:
allControlledVariables.add(controlledVariable) allControlledVariables.add(controlledVariable)