From 68997828c850ce7fb30b73b4adfde35053e539d1 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 16 Jan 2019 06:51:14 +0100 Subject: [PATCH] Fix a few deprecation warnings --- build_system_kit/extpy/extpy.py | 2 +- waflib/ConfigSet.py | 2 +- waflib/Context.py | 4 ++-- waflib/Logs.py | 4 ++-- wscript | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build_system_kit/extpy/extpy.py b/build_system_kit/extpy/extpy.py index e6446850..73a85966 100644 --- a/build_system_kit/extpy/extpy.py +++ b/build_system_kit/extpy/extpy.py @@ -27,7 +27,7 @@ class Context(mod.Context): cache[node] = True self.pre_recurse(node) try: - function_code = node.read('rU') + function_code = node.read('r') exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict) finally: self.post_recurse(node) diff --git a/waflib/ConfigSet.py b/waflib/ConfigSet.py index 9db8e907..901fba6c 100644 --- a/waflib/ConfigSet.py +++ b/waflib/ConfigSet.py @@ -312,7 +312,7 @@ class ConfigSet(object): :type filename: string """ tbl = self.table - code = Utils.readf(filename, m='rU') + code = Utils.readf(filename, m='r') for m in re_imp.finditer(code): g = m.group tbl[g(2)] = eval(g(3)) diff --git a/waflib/Context.py b/waflib/Context.py index 38c64645..f6e9558f 100644 --- a/waflib/Context.py +++ b/waflib/Context.py @@ -266,7 +266,7 @@ class Context(ctx): cache[node] = True self.pre_recurse(node) try: - function_code = node.read('rU', encoding) + function_code = node.read('r', encoding) exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict) finally: self.post_recurse(node) @@ -662,7 +662,7 @@ def load_module(path, encoding=None): module = imp.new_module(WSCRIPT_FILE) try: - code = Utils.readf(path, m='rU', encoding=encoding) + code = Utils.readf(path, m='r', encoding=encoding) except EnvironmentError: raise Errors.WafError('Could not read the file %r' % path) diff --git a/waflib/Logs.py b/waflib/Logs.py index 2a475169..11dc34f3 100644 --- a/waflib/Logs.py +++ b/waflib/Logs.py @@ -276,9 +276,9 @@ def error(*k, **kw): def warn(*k, **kw): """ - Wraps logging.warn + Wraps logging.warning """ - log.warn(*k, **kw) + log.warning(*k, **kw) def info(*k, **kw): """ diff --git a/wscript b/wscript index 18bb365f..623be1ad 100644 --- a/wscript +++ b/wscript @@ -30,7 +30,7 @@ from waflib import Configure Configure.autoconfig = 1 def sub_file(fname, lst): - with open(fname, 'rU') as f: + with open(fname, 'r') as f: txt = f.read() for (key, val) in lst: @@ -160,7 +160,7 @@ def process_tokens(tokens): body = ''.join(accu) return body -deco_re = re.compile('(def|class)\\s+(\w+)\\(.*') +deco_re = re.compile('(def|class)\\s+(\\w+)\\(.*') def process_decorators(body): lst = body.splitlines() accu = [] @@ -315,7 +315,7 @@ def create_waf(self, *k, **kw): tar.close() z.close() - with open('waf-light', 'rU') as f: + with open('waf-light', 'r') as f: code1 = f.read() # now store the revision unique number in waf