[Python-3000-checkins] r51594 - python/branches/p3yk/Parser/asdl.py python/branches/p3yk/Parser/asdl_c.py

brett.cannon python-3000-checkins at python.org
Fri Aug 25 06:06:35 CEST 2006


Author: brett.cannon
Date: Fri Aug 25 06:06:31 2006
New Revision: 51594

Modified:
   python/branches/p3yk/Parser/asdl.py
   python/branches/p3yk/Parser/asdl_c.py
Log:
Switch to using %r in the format string.


Modified: python/branches/p3yk/Parser/asdl.py
==============================================================================
--- python/branches/p3yk/Parser/asdl.py	(original)
+++ python/branches/p3yk/Parser/asdl.py	Fri Aug 25 06:06:31 2006
@@ -98,7 +98,7 @@
 
     def t_default(self, s):
         r" . +"
-        raise ValueError, "unmatched input: %s" % repr(s)
+        raise ValueError, "unmatched input: %r" % s
 
 class ASDLParser(spark.GenericParser, object):
     def __init__(self):

Modified: python/branches/p3yk/Parser/asdl_c.py
==============================================================================
--- python/branches/p3yk/Parser/asdl_c.py	(original)
+++ python/branches/p3yk/Parser/asdl_c.py	Fri Aug 25 06:06:31 2006
@@ -47,7 +47,7 @@
         # XXX this should be fixed for real
         if i == -1 and 'GeneratorExp' in cur:
             i = size + 3
-        assert i != -1, "Impossible line %d to reflow: %s" % (size, repr(s))
+        assert i != -1, "Impossible line %d to reflow: %r" % (size, s)
         lines.append(padding + cur[:i])
         if len(lines) == 1:
             # find new size based on brace


More information about the Python-3000-checkins mailing list