Browse Source

Fix a few deprecation warnings

merge-requests/2208/head
Thomas Nagy 4 years ago
parent
commit
68997828c8
No known key found for this signature in database GPG Key ID: 49B4C67C05277AAA
  1. 2
      build_system_kit/extpy/extpy.py
  2. 2
      waflib/ConfigSet.py
  3. 4
      waflib/Context.py
  4. 4
      waflib/Logs.py
  5. 6
      wscript

2
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)

2
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))

4
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)

4
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):
"""

6
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

Loading…
Cancel
Save