Link Here
|
1 |
#!/usr/bin/env python |
1 |
#!/usr/bin/env python |
2 |
import os, sys, string |
2 |
import os, sys, string, io |
3 |
try: |
3 |
try: |
4 |
from cStringIO import StringIO |
4 |
from cStringIO import StringIO |
5 |
except ImportError: |
5 |
except ImportError: |
Link Here
|
16 |
state = ANY |
16 |
state = ANY |
17 |
static = 0 |
17 |
static = 0 |
18 |
|
18 |
|
19 |
file = open(sys.argv[1]) |
19 |
file = io.open(sys.argv[1], "r", errors="ignore") |
20 |
name = sys.argv[1][:-2] |
20 |
name = sys.argv[1][:-2] |
21 |
|
21 |
|
22 |
out = StringIO() |
22 |
out = StringIO() |
Link Here
|
94 |
# This prevents a lot of recompilation during development |
94 |
# This prevents a lot of recompilation during development |
95 |
out.seek(0) |
95 |
out.seek(0) |
96 |
try: |
96 |
try: |
97 |
with open(name + ".h", "r") as orig: |
97 |
with io.open(name + ".h", "r", errors="ignore") as orig: |
98 |
origcontents = orig.readlines() |
98 |
origcontents = orig.readlines() |
99 |
except: |
99 |
except: |
100 |
origcontents = "" |
100 |
origcontents = "" |