diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-02-04 14:24:27 -0500 |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-02-04 14:24:27 -0500 |
commit | 366fd968e33569477d580b4c2e403a021744ad15 (patch) | |
tree | f3bc96d75e6f879dbe3119585147b6f9a4d87962 | |
parent | c222b5c29e17ed6d4117bedd49006e8dbbad13e0 (diff) | |
download | scons-366fd968e33569477d580b4c2e403a021744ad15.tar.gz |
Fix bootstrap.py problem with Python 2.7
io.StringIO only takes/uses unicode, so convert string to unicode.
-rw-r--r-- | bin/scons-proc.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py index 6d158165..1f537c71 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -17,7 +17,7 @@ import string import sys import xml.sax try: - from io import StringIO + from io import StringIO # usable as of 2.6; takes unicode only except ImportError: # No 'io' module or no StringIO in io exec('from cStringIO import StringIO') @@ -105,7 +105,7 @@ for f in args: content = content.replace('-->\n', '-->') input = xml_preamble + content + xml_postamble try: - saxparser.parse(StringIO(input)) + saxparser.parse(StringIO(unicode(input))) except: sys.stderr.write("error in %s\n" % f) raise |