Fix invalid escape syntax warnings
Additionally use rawstrings with all regex calls
This commit is contained in:
@@ -117,7 +117,7 @@ class PyfaJsonWriter(BaseWriter):
|
||||
# Prefer safe way - replace any characters besides
|
||||
# alphanumeric and few special characters with
|
||||
# underscore
|
||||
writer_safe_name = re.sub('[^\w\-.,() ]', '_', name, flags=re.UNICODE)
|
||||
writer_safe_name = re.sub(r'[^\w\-.,() ]', '_', name, flags=re.UNICODE)
|
||||
return writer_safe_name
|
||||
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ effectids_eos = set()
|
||||
|
||||
with open(effects_path) as f:
|
||||
for line in f:
|
||||
m = re.match("class Effect(\d+)\(", line)
|
||||
m = re.match(r"class Effect(\d+)\(", line)
|
||||
if m:
|
||||
effectid = int(m.group(1))
|
||||
effectids_eos.add(effectid)
|
||||
|
||||
@@ -57,7 +57,7 @@ def main(old, new, groups=True, effects=True, attributes=True, renames=True):
|
||||
|
||||
with open(effectspath) as f:
|
||||
for line in f:
|
||||
for m in re.finditer('class Effect(?P<eid>\d+)\(BaseEffect\):', line):
|
||||
for m in re.finditer(r'class Effect(?P<eid>\d+)\(BaseEffect\):', line):
|
||||
effectid = int(m.group('eid'))
|
||||
implemented.add(effectid)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user