| From bcba27168d99a3919b730e6a533cf79ab3b24eee Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= <contact@tiger-222.fr> |
| Date: Sat, 5 Jan 2019 12:02:42 +0100 |
| Subject: [PATCH] Fix all DeprecationWarning: invalid escape sequence |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr> |
| --- |
| Upstream-Status: Backport [from waflib not jack: https://gitlab.com/ita1024/waf/-/commit/412a9b819e86a0061f990c7245f0f5db76d0eda3] |
| |
| waflib/Build.py | 2 +- |
| waflib/ConfigSet.py | 2 +- |
| waflib/Context.py | 2 +- |
| waflib/Task.py | 2 +- |
| waflib/TaskGen.py | 2 +- |
| waflib/Tools/c_config.py | 2 +- |
| waflib/Tools/c_preproc.py | 6 +++--- |
| waflib/Tools/msvc.py | 16 ++++++++-------- |
| waflib/Utils.py | 2 +- |
| waflib/ansiterm.py | 2 +- |
| 10 files changed, 19 insertions(+), 19 deletions(-) |
| |
| diff --git a/waflib/Build.py b/waflib/Build.py |
| index c9661df1..9e733c9e 100644 |
| --- a/waflib/Build.py |
| +++ b/waflib/Build.py |
| @@ -104,7 +104,7 @@ class BuildContext(Context.Context): |
| """Amount of jobs to run in parallel""" |
| |
| self.targets = Options.options.targets |
| - """List of targets to build (default: \*)""" |
| + """List of targets to build (default: \\*)""" |
| |
| self.keep = Options.options.keep |
| """Whether the build should continue past errors""" |
| diff --git a/waflib/ConfigSet.py b/waflib/ConfigSet.py |
| index 84736c9c..901fba6c 100644 |
| --- a/waflib/ConfigSet.py |
| +++ b/waflib/ConfigSet.py |
| @@ -11,7 +11,7 @@ The values put in :py:class:`ConfigSet` must be serializable (dicts, lists, stri |
| |
| import copy, re, os |
| from waflib import Logs, Utils |
| -re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) |
| +re_imp = re.compile(r'^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) |
| |
| class ConfigSet(object): |
| """ |
| diff --git a/waflib/Context.py b/waflib/Context.py |
| index 38ab03f1..5799a60a 100644 |
| --- a/waflib/Context.py |
| +++ b/waflib/Context.py |
| @@ -614,7 +614,7 @@ class Context(ctx): |
| Logs.pprint(color, msg) |
| |
| def load_special_tools(self, var, ban=[]): |
| - """ |
| + r""" |
| Loads third-party extensions modules for certain programming languages |
| by trying to list certain files in the extras/ directory. This method |
| is typically called once for a programming language group, see for |
| diff --git a/waflib/Task.py b/waflib/Task.py |
| index 6aebc607..0c5cb994 100644 |
| --- a/waflib/Task.py |
| +++ b/waflib/Task.py |
| @@ -1044,7 +1044,7 @@ def funex(c): |
| exec(c, dc) |
| return dc['f'] |
| |
| -re_cond = re.compile('(?P<var>\w+)|(?P<or>\|)|(?P<and>&)') |
| +re_cond = re.compile(r'(?P<var>\w+)|(?P<or>\|)|(?P<and>&)') |
| re_novar = re.compile(r'^(SRC|TGT)\W+.*?$') |
| reg_act = re.compile(r'(?P<backslash>\\)|(?P<dollar>\$\$)|(?P<subst>\$\{(?P<var>\w+)(?P<code>.*?)\})', re.M) |
| def compile_fun_shell(line): |
| diff --git a/waflib/TaskGen.py b/waflib/TaskGen.py |
| index a74e6431..3776bac1 100644 |
| --- a/waflib/TaskGen.py |
| +++ b/waflib/TaskGen.py |
| @@ -727,7 +727,7 @@ def sequence_order(self): |
| self.bld.prev = self |
| |
| |
| -re_m4 = re.compile('@(\w+)@', re.M) |
| +re_m4 = re.compile(r'@(\w+)@', re.M) |
| |
| class subst_pc(Task.Task): |
| """ |
| diff --git a/waflib/Tools/c_config.py b/waflib/Tools/c_config.py |
| index d2b3c0d8..60cc0ecd 100644 |
| --- a/waflib/Tools/c_config.py |
| +++ b/waflib/Tools/c_config.py |
| @@ -239,7 +239,7 @@ def validate_cfg(self, kw): |
| |
| @conf |
| def exec_cfg(self, kw): |
| - """ |
| + r""" |
| Executes ``pkg-config`` or other ``-config`` applications to collect configuration flags: |
| |
| * if atleast_pkgconfig_version is given, check that pkg-config has the version n and return |
| diff --git a/waflib/Tools/c_preproc.py b/waflib/Tools/c_preproc.py |
| index 7e04b4a7..68e5f5ae 100644 |
| --- a/waflib/Tools/c_preproc.py |
| +++ b/waflib/Tools/c_preproc.py |
| @@ -75,13 +75,13 @@ re_lines = re.compile( |
| re.IGNORECASE | re.MULTILINE) |
| """Match #include lines""" |
| |
| -re_mac = re.compile("^[a-zA-Z_]\w*") |
| +re_mac = re.compile(r"^[a-zA-Z_]\w*") |
| """Match macro definitions""" |
| |
| re_fun = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]') |
| """Match macro functions""" |
| |
| -re_pragma_once = re.compile('^\s*once\s*', re.IGNORECASE) |
| +re_pragma_once = re.compile(r'^\s*once\s*', re.IGNORECASE) |
| """Match #pragma once statements""" |
| |
| re_nl = re.compile('\\\\\r*\n', re.MULTILINE) |
| @@ -660,7 +660,7 @@ def extract_macro(txt): |
| # empty define, assign an empty token |
| return (v, [[], [('T','')]]) |
| |
| -re_include = re.compile('^\s*(<(?:.*)>|"(?:.*)")') |
| +re_include = re.compile(r'^\s*(<(?:.*)>|"(?:.*)")') |
| def extract_include(txt, defs): |
| """ |
| Process a line in the form:: |
| diff --git a/waflib/Tools/msvc.py b/waflib/Tools/msvc.py |
| index 17b347d4..ff58449d 100644 |
| --- a/waflib/Tools/msvc.py |
| +++ b/waflib/Tools/msvc.py |
| @@ -281,7 +281,7 @@ def gather_wince_supported_platforms(): |
| |
| def gather_msvc_detected_versions(): |
| #Detected MSVC versions! |
| - version_pattern = re.compile('^(\d\d?\.\d\d?)(Exp)?$') |
| + version_pattern = re.compile(r'^(\d\d?\.\d\d?)(Exp)?$') |
| detected_versions = [] |
| for vcver,vcvar in (('VCExpress','Exp'), ('VisualStudio','')): |
| prefix = 'SOFTWARE\\Wow6432node\\Microsoft\\' + vcver |
| @@ -367,7 +367,7 @@ def gather_wsdk_versions(conf, versions): |
| :param versions: list to modify |
| :type versions: list |
| """ |
| - version_pattern = re.compile('^v..?.?\...?.?') |
| + version_pattern = re.compile(r'^v..?.?\...?.?') |
| try: |
| all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Microsoft SDKs\\Windows') |
| except OSError: |
| @@ -525,7 +525,7 @@ def gather_icl_versions(conf, versions): |
| :param versions: list to modify |
| :type versions: list |
| """ |
| - version_pattern = re.compile('^...?.?\....?.?') |
| + version_pattern = re.compile(r'^...?.?\....?.?') |
| try: |
| all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++') |
| except OSError: |
| @@ -579,7 +579,7 @@ def gather_intel_composer_versions(conf, versions): |
| :param versions: list to modify |
| :type versions: list |
| """ |
| - version_pattern = re.compile('^...?.?\...?.?.?') |
| + version_pattern = re.compile(r'^...?.?\...?.?.?') |
| try: |
| all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Suites') |
| except OSError: |
| @@ -683,7 +683,7 @@ def find_lt_names_msvc(self, libname, is_static=False): |
| if not is_static and ltdict.get('library_names', ''): |
| dllnames=ltdict['library_names'].split() |
| dll=dllnames[0].lower() |
| - dll=re.sub('\.dll$', '', dll) |
| + dll=re.sub(r'\.dll$', '', dll) |
| return (lt_libdir, dll, False) |
| elif ltdict.get('old_library', ''): |
| olib=ltdict['old_library'] |
| @@ -700,7 +700,7 @@ def find_lt_names_msvc(self, libname, is_static=False): |
| @conf |
| def libname_msvc(self, libname, is_static=False): |
| lib = libname.lower() |
| - lib = re.sub('\.lib$','',lib) |
| + lib = re.sub(r'\.lib$','',lib) |
| |
| if lib in g_msvc_systemlibs: |
| return lib |
| @@ -747,11 +747,11 @@ def libname_msvc(self, libname, is_static=False): |
| for libn in libnames: |
| if os.path.exists(os.path.join(path, libn)): |
| Logs.debug('msvc: lib found: %s', os.path.join(path,libn)) |
| - return re.sub('\.lib$', '',libn) |
| + return re.sub(r'\.lib$', '',libn) |
| |
| #if no lib can be found, just return the libname as msvc expects it |
| self.fatal('The library %r could not be found' % libname) |
| - return re.sub('\.lib$', '', libname) |
| + return re.sub(r'\.lib$', '', libname) |
| |
| @conf |
| def check_lib_msvc(self, libname, is_static=False, uselib_store=None): |
| diff --git a/waflib/Utils.py b/waflib/Utils.py |
| index a0cc2a09..da1b73e7 100644 |
| --- a/waflib/Utils.py |
| +++ b/waflib/Utils.py |
| @@ -730,7 +730,7 @@ def unversioned_sys_platform(): |
| if s == 'cli' and os.name == 'nt': |
| # ironpython is only on windows as far as we know |
| return 'win32' |
| - return re.split('\d+$', s)[0] |
| + return re.split(r'\d+$', s)[0] |
| |
| def nada(*k, **kw): |
| """ |
| diff --git a/waflib/ansiterm.py b/waflib/ansiterm.py |
| index 0d20c637..027f0ad6 100644 |
| --- a/waflib/ansiterm.py |
| +++ b/waflib/ansiterm.py |
| @@ -264,7 +264,7 @@ else: |
| 'u': pop_cursor, |
| } |
| # Match either the escape sequence or text not containing escape sequence |
| - ansi_tokens = re.compile('(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') |
| + ansi_tokens = re.compile(r'(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') |
| def write(self, text): |
| try: |
| wlock.acquire() |