commit aa25da8d3ce0123f50f1b7b52e1e78a8df78caae
Author: David Narvaez <david.narvaez(a)computer.org>
Date: Tue Jun 5 17:29:02 2012 -0400
use six to make generate-tables-of-passes-rst.py work with both Python 2 and 3
generate-tables-of-passes-rst.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/generate-tables-of-passes-rst.py b/generate-tables-of-passes-rst.py
index 154276e..8bbf926 100644
--- a/generate-tables-of-passes-rst.py
+++ b/generate-tables-of-passes-rst.py
@@ -18,6 +18,7 @@
# We use this script to regenerate docs/tables-of-passes.rst
import gcc
import sys
+import six
from gccutils import Table
@@ -36,7 +37,7 @@ p_to_s = pass_properties_to_str
def foo(t, ps, indent):
name = ps.name.replace('*', '\\*')
- t.add_row(('%s%s' % (u'> ' * indent, name),
+ t.add_row(('%s%s' % (six.u('> ') * indent, name),
p_to_s(ps.properties_required),
p_to_s(ps.properties_provided),
p_to_s(ps.properties_destroyed)))
@@ -89,8 +90,7 @@ for rootname, reflabel, ps in zip(('The lowering passes',
t = Table(['Pass Name', 'Required properties', 'Provided properties', 'Destroyed properties'],
sepchar='=')
foo(t, ps, 0)
- from StringIO import StringIO
- s = StringIO()
+ s = six.StringIO()
t.write(s)
for line in s.getvalue().splitlines():
print(' ' + line.rstrip())