mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-21 17:35:55 +01:00
Fix a few deprecation warnings
This commit is contained in:
parent
1c75284614
commit
68997828c8
@ -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)
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
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…
Reference in New Issue
Block a user