Skip to content

Commit

Permalink
Fix invalid string escape sequences (GH-373)
Browse files Browse the repository at this point in the history
these will become SyntaxErrors in future versions of python
  • Loading branch information
asottile committed Jun 16, 2023
1 parent 089d436 commit fdb73ec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark/bench_etree.py
Expand Up @@ -7,7 +7,7 @@
serialized, children, nochange)

TEXT = "some ASCII text"
UTEXT = u"some klingon: \F8D2"
UTEXT = u"some klingon: \uF8D2"

############################################################
# Benchmarks
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchbase.py
Expand Up @@ -17,7 +17,7 @@ def exec_(code, glob):
TREE_FACTOR = 1 # increase tree size with '-l / '-L' cmd option

_TEXT = "some ASCII text" * TREE_FACTOR
_UTEXT = u"some klingon: \F8D2" * TREE_FACTOR
_UTEXT = u"some klingon: \uF8D2" * TREE_FACTOR
_ATTRIBUTES = {
'{attr}test1' : _TEXT,
'{attr}test2' : _TEXT,
Expand Down
4 changes: 2 additions & 2 deletions doc/mklatex.py
Expand Up @@ -24,7 +24,7 @@
htmlnsmap = {"h" : "http://www.w3.org/1999/xhtml"}

replace_invalid = re.compile(r'[-_/.\s\\]').sub
replace_content = re.compile("\{[^\}]*\}").sub
replace_content = re.compile(r"\{[^\}]*\}").sub

replace_epydoc_macros = re.compile(r'(,\s*amssymb|dvips\s*,\s*)').sub
replace_rst_macros = re.compile(r'(\\usepackage\{color}|\\usepackage\[[^]]*]\{hyperref})').sub
Expand Down Expand Up @@ -167,7 +167,7 @@ def tex_postprocess(src_path, dest_path, want_header=False, process_line=noop):
if skipping(l):
# To-Do minitoc instead of tableofcontents
continue
elif "\hypertarget{old-versions}" in l:
elif r"\hypertarget{old-versions}" in l:
break
elif "listcnt0" in l:
l = l.replace("listcnt0", counter_text)
Expand Down
2 changes: 1 addition & 1 deletion doc/update_performance_results.py
Expand Up @@ -2,7 +2,7 @@
import re

_parse_result_line = re.compile(
"\s*(?P<library>\w+):\s*(?P<name>\w+)\s+\((?P<config>[-\w]+\s[\w,]+)\s*\)\s+(?P<time>[0-9.]+\s+msec/pass)"
r"\s*(?P<library>\w+):\s*(?P<name>\w+)\s+\((?P<config>[-\w]+\s[\w,]+)\s*\)\s+(?P<time>[0-9.]+\s+msec/pass)"
).match

_make_key = operator.itemgetter('library', 'name', 'config')
Expand Down

0 comments on commit fdb73ec

Please sign in to comment.