diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-02-25 07:29:45 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2017-02-25 07:50:15 -0700 |
commit | e5110fa81540103800da34c2199a0e2823031f98 (patch) | |
tree | 4a2f6a7e44067148251d3348099dd76c3d4664ae /tools | |
parent | e9246860480b6c909e6e00c1cd4371b0e5fee1ce (diff) | |
download | numpy-e5110fa81540103800da34c2199a0e2823031f98.tar.gz |
MAINT: Fix deprecated escape sequences in tools/
Fix the escape sequences deprecated in Python 3.6 found in the
tools directory. Note that this does not include the files in
tools/swig/tests which are not even Python 3 compatible at this point.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/c_coverage/c_coverage_report.py | 6 | ||||
-rw-r--r-- | tools/find_deprecated_escaped_characters.py | 4 | ||||
-rw-r--r-- | tools/win32build/build.py | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/tools/c_coverage/c_coverage_report.py b/tools/c_coverage/c_coverage_report.py index d9eb49739..327f6dc05 100755 --- a/tools/c_coverage/c_coverage_report.py +++ b/tools/c_coverage/c_coverage_report.py @@ -94,7 +94,7 @@ class SourceFiles: def clean_path(self, path): path = path[len(self.prefix):] - return re.sub("[^A-Za-z0-9\.]", '_', path) + return re.sub(r"[^A-Za-z0-9\.]", '_', path) def write_text(self, root): for path, source in self.files.items(): @@ -121,8 +121,8 @@ class SourceFiles: def collect_stats(files, fd, pattern): # TODO: Handle compressed callgrind files line_regexs = [ - re.compile("(?P<lineno>[0-9]+)(\s[0-9]+)+"), - re.compile("((jump)|(jcnd))=([0-9]+)\s(?P<lineno>[0-9]+)") + re.compile(r"(?P<lineno>[0-9]+)(\s[0-9]+)+"), + re.compile(r"((jump)|(jcnd))=([0-9]+)\s(?P<lineno>[0-9]+)") ] current_file = None diff --git a/tools/find_deprecated_escaped_characters.py b/tools/find_deprecated_escaped_characters.py index 8015d3a42..1c3cc0d38 100644 --- a/tools/find_deprecated_escaped_characters.py +++ b/tools/find_deprecated_escaped_characters.py @@ -1,8 +1,8 @@ #! /usr/bin/env python -""" +r""" Look for escape sequences deprecated in Python 3.6. -Python 3.6 deprecates a number of non-escape sequences starting with `\` that +Python 3.6 deprecates a number of non-escape sequences starting with '\' that were accepted before. For instance, '\(' was previously accepted but must now be written as '\\(' or r'\('. diff --git a/tools/win32build/build.py b/tools/win32build/build.py index 7ae60fd96..1030aa541 100644 --- a/tools/win32build/build.py +++ b/tools/win32build/build.py @@ -16,9 +16,9 @@ import os import shutil from os.path import join as pjoin, split as psplit, dirname -PYEXECS = {"2.5" : "C:\python25\python.exe", - "2.4" : "C:\python24\python24.exe", - "2.6" : "C:\python26\python26.exe"} +PYEXECS = {"2.5" : r"C:\python25\python.exe", + "2.4" : r"C:\python24\python24.exe", + "2.6" : r"C:\python26\python26.exe"} _SSE3_CFG = r"""[atlas] library_dirs = C:\local\lib\yop\sse3""" |