]> granicus.if.org Git - python/commitdiff
Switch to using %r in the format string.
authorBrett Cannon <bcannon@gmail.com>
Fri, 25 Aug 2006 04:06:31 +0000 (04:06 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 25 Aug 2006 04:06:31 +0000 (04:06 +0000)
Parser/asdl.py
Parser/asdl_c.py

index e8f9b1cb9280d7e9bbb402f741b895afeb5d05f2..d6f5ec543f45101ae72e0982fb77f4f60b156fa5 100644 (file)
@@ -98,7 +98,7 @@ class ASDLScanner(spark.GenericScanner, object):
 
     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):
index 46f46d86ee28ccdcd40655af9d723582a0863758..d7d2a3f74f06c8e43abee39f3077b64b497e800d 100755 (executable)
@@ -47,7 +47,7 @@ def reflow_lines(s, depth):
         # 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