[pypy-commit] pypy py3k: translation fix

pjenvey noreply at buildbot.pypy.org
Wed Apr 10 02:26:22 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r63185:8b49abe5e41a
Date: 2013-04-09 17:25 -0700
http://bitbucket.org/pypy/pypy/changeset/8b49abe5e41a/

Log:	translation fix

diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -29,10 +29,12 @@
 
 def get_printable_location(next_instr, is_being_profiled, bytecode):
     from pypy.tool.stdlib_opcode import opcode_method_names
+    from rpython.rlib.runicode import unicode_encode_utf_8
     name = opcode_method_names[ord(bytecode.co_code[next_instr])]
+    repru = bytecode.get_repr()
     # XXX: lame
-    repre = bytecode.get_repr().encode('utf-8', 'backslashreplace')
-    return '%s #%d %s' % (repre, next_instr, name)
+    reprs = unicode_encode_utf_8(repru, len(repru), "replace")
+    return '%s #%d %s' % (reprs, next_instr, name)
 
 def get_jitcell_at(next_instr, is_being_profiled, bytecode):
     return bytecode.jit_cells.get((next_instr, is_being_profiled), None)


More information about the pypy-commit mailing list