2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-23 09:45:13 +01:00

Removed the hard-coded python3 syntax to raise meaningful exceptions

This commit is contained in:
Thomas Nagy 2012-10-02 03:46:52 +02:00
parent 85d863bd52
commit c575dc1392

View File

@ -51,6 +51,11 @@ def sub_file(fname, lst):
finally:
f.close()
def to_bytes(x):
if sys.hexversion>0x300000f:
return x.encode()
return x
print("------> Executing code from the top-level wscript <-----")
def init(ctx):
if Options.options.setver: # maintainer only (ita)
@ -333,9 +338,9 @@ def create_waf(*k, **kw):
f = open('waf', 'wb')
try:
f.write(ccc.encode())
f.write(b'#==>\n#')
f.write(to_bytes('#==>\n#'))
f.write(cnt)
f.write(b'\n#<==\n')
f.write(to_bytes('\n#<==\n'))
finally:
f.close()