mirror of https://gitlab.com/ita1024/waf.git
Removed the hard-coded python3 syntax to raise meaningful exceptions
This commit is contained in:
parent
85d863bd52
commit
c575dc1392
9
wscript
9
wscript
|
@ -51,6 +51,11 @@ def sub_file(fname, lst):
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
def to_bytes(x):
|
||||||
|
if sys.hexversion>0x300000f:
|
||||||
|
return x.encode()
|
||||||
|
return x
|
||||||
|
|
||||||
print("------> Executing code from the top-level wscript <-----")
|
print("------> Executing code from the top-level wscript <-----")
|
||||||
def init(ctx):
|
def init(ctx):
|
||||||
if Options.options.setver: # maintainer only (ita)
|
if Options.options.setver: # maintainer only (ita)
|
||||||
|
@ -333,9 +338,9 @@ def create_waf(*k, **kw):
|
||||||
f = open('waf', 'wb')
|
f = open('waf', 'wb')
|
||||||
try:
|
try:
|
||||||
f.write(ccc.encode())
|
f.write(ccc.encode())
|
||||||
f.write(b'#==>\n#')
|
f.write(to_bytes('#==>\n#'))
|
||||||
f.write(cnt)
|
f.write(cnt)
|
||||||
f.write(b'\n#<==\n')
|
f.write(to_bytes('\n#<==\n'))
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue