Commits

Tim Hatch  committed 78ff877

Fix glitch in self-generation of unistring.py

  • Participants
  • Parent commits ac890f7

Comments (0)

Files changed (1)

File pygments/unistring.py

             # Jython can't handle isolated surrogates
             f.write("""\
 try:
-    Cs = eval(r"%r")
+    Cs = eval(u_prefix + r"%s")
 except UnicodeDecodeError:
-    Cs = '' # Jython can't handle isolated surrogates\n\n""" % val)
+    Cs = '' # Jython can't handle isolated surrogates\n\n""" % repr(val).lstrip('u'))
         else:
             f.write('%s = %r\n\n' % (cat, val))
     f.write('cats = %r\n\n' % sorted(categories.keys()))