Commits

Gary Oberbrunner committed cdc0f05

Fix bootstrap.py problem with Python 2.7

io.StringIO only takes/uses unicode, so convert string to unicode.

Comments (0)

Files changed (1)

bin/scons-proc.py

 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')
         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