Fix a few deprecation warnings

This commit is contained in:
Thomas Nagy 2019-01-16 06:51:14 +01:00
parent 1c75284614
commit 68997828c8
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
5 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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