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:
Kyle Marek-Spartz
2015-01-06 02:09:23 +00:00
parent a3e6d028c4
commit 864a70abdf
5 changed files with 40 additions and 33 deletions
+2 -1
View File
@@ -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"):