feat: make Python scripts compatible with both Python 2 and 3
Update print statements to function syntax, add from __future__ import print_function in test.py, change shebangs to /usr/bin/env python, replace str.translate with re.sub for anchor sanitization in generate_docs.py, and decode subprocess output to utf-8 in test.py for cross-version string handling.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import glob
|
||||
import os.path
|
||||
import re
|
||||
@@ -33,7 +34,7 @@ def copy_builtin(filename):
|
||||
with open("src/wren_" + name + ".c", "w") as f:
|
||||
f.write(c_source)
|
||||
|
||||
print name
|
||||
print(name)
|
||||
|
||||
|
||||
for f in glob.iglob("builtin/*.wren"):
|
||||
|
||||
Reference in New Issue
Block a user