Skip to content

Commit

Permalink
Merge pull request #117 from slothy-optimizer/python312-warnings
Browse files Browse the repository at this point in the history
fix Python3.12 reg ex warnings
  • Loading branch information
mkannwischer authored Dec 11, 2024
2 parents c31b6b3 + 7452a68 commit 4c7b177
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slothy/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def prepare_value(a):
return a

def apply_arg(l, arg, val):
l = re.sub(f"\\\\{arg}\\\\\(\)", val, l)
l = re.sub(f"\\\\{arg}\\\\\\(\\)", val, l)
l = re.sub(f"\\\\{arg}(\\W|$)",val + "\\1", l)
l = l.replace("\\()\\()", "\\()")
return l
Expand Down Expand Up @@ -816,7 +816,7 @@ def unfold_in(self, source, change_callback=None, inherit_comments=False):
for arg in self.args:
arg_regexps.append(rf"\s*(?P<{arg}>[^,]+)\s*")

macro_regexp_txt += '(,|\s)'.join(arg_regexps)
macro_regexp_txt += '(,|\\s)'.join(arg_regexps)
macro_regexp = re.compile(macro_regexp_txt)

output = []
Expand Down

0 comments on commit 4c7b177

Please sign in to comment.