]> granicus.if.org Git - python/commitdiff
#3077: fix h2py substitution of character literals.
authorGeorg Brandl <georg@python.org>
Thu, 21 Oct 2010 13:29:10 +0000 (13:29 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 21 Oct 2010 13:29:10 +0000 (13:29 +0000)
Tools/scripts/h2py.py

index f3c80bda9c300f34186ed76dde13c95d8ea9ebce..45aa439075cafb9b5c1bd801470e676c6865f108 100755 (executable)
@@ -87,7 +87,7 @@ def pytify(body):
     for p in ignores:
         body = p.sub(' ', body)
     # replace char literals by ord(...)
-    body = p_char.sub('ord(\\0)', body)
+    body = p_char.sub("ord('\\1')", body)
     # Compute negative hexadecimal constants
     start = 0
     UMAX = 2*(sys.maxsize+1)