diff options
author | Mats Wichmann <mats@linux.com> | 2019-05-10 15:09:37 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-05-13 15:23:34 (GMT) |
commit | 2845da6416d522cc6a15308b7787de65c22f200b (patch) | |
tree | 28ee4ad55d1d44d834c6214e802c48e75f94d9b1 /src/engine | |
parent | 8d800a37f1d0bdeae4fba560c0d66ab75129a570 (diff) | |
download | SCons-2845da6416d522cc6a15308b7787de65c22f200b.zip SCons-2845da6416d522cc6a15308b7787de65c22f200b.tar.gz SCons-2845da6416d522cc6a15308b7787de65c22f200b.tar.bz2 |
Fix some regexes for Python 3.8 complaints
Regexes that contained unescaped backslashes and were not listed
in raw string form caused one more test failure when Python 3.8
was experimentally turned on in the Travis CI build.
Also one utility script had the same, not affecting tests - found through
inspection.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Scanner/D.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/LaTeX.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/SWIG.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/engine/SCons/Scanner/D.py b/src/engine/SCons/Scanner/D.py index 95496d5..b3fb29e 100644 --- a/src/engine/SCons/Scanner/D.py +++ b/src/engine/SCons/Scanner/D.py @@ -46,7 +46,7 @@ class D(SCons.Scanner.Classic): name = "DScanner", suffixes = '$DSUFFIXES', path_variable = 'DPATH', - regex = '(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)' + regex = r'(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)' ) def find_include(self, include, source_dir, path): diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py index 1cf2567..fd0391b 100644 --- a/src/engine/SCons/Scanner/LaTeX.py +++ b/src/engine/SCons/Scanner/LaTeX.py @@ -348,7 +348,7 @@ class LaTeX(SCons.Scanner.Base): # Cache the includes list in node so we only scan it once: # path_dict = dict(list(path)) # add option for whitespace (\s) before the '[' - noopt_cre = re.compile('\s*\[.*$') + noopt_cre = re.compile(r'\s*\[.*$') if node.includes is not None: includes = node.includes else: diff --git a/src/engine/SCons/Scanner/SWIG.py b/src/engine/SCons/Scanner/SWIG.py index 2650e4b..a333134 100644 --- a/src/engine/SCons/Scanner/SWIG.py +++ b/src/engine/SCons/Scanner/SWIG.py @@ -34,7 +34,7 @@ import SCons.Scanner SWIGSuffixes = [ '.i' ] def SWIGScanner(): - expr = '^[ \t]*%[ \t]*(?:include|import|extern)[ \t]*(<|"?)([^>\s"]+)(?:>|"?)' + expr = r'^[ \t]*%[ \t]*(?:include|import|extern)[ \t]*(<|"?)([^>\s"]+)(?:>|"?)' scanner = SCons.Scanner.ClassicCPP("SWIGScanner", ".i", "SWIGPATH", expr) return scanner |