From 6afc2b79e23eb7d7194c62f7463e1c2a404fbcc8 Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Sat, 4 Feb 2012 14:24:27 -0500 Subject: Fix bootstrap.py problem with Python 2.7 io.StringIO only takes/uses unicode, so convert string to unicode. --- bin/scons-proc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/scons-proc.py b/bin/scons-proc.py index 6d15816..1f537c7 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 -- cgit v0.12