[pypy-commit] pypy py3k: co_code is a bytestring, so we don't need ord()

antocuni noreply at buildbot.pypy.org
Thu Feb 9 12:24:34 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52273:abe40b46a9f1
Date: 2012-02-09 12:22 +0100
http://bitbucket.org/pypy/pypy/changeset/abe40b46a9f1/

Log:	co_code is a bytestring, so we don't need ord()

diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -782,7 +782,7 @@
         co = compile("def f(): return None", "<test>", "exec").co_consts[0]
         assert "None" not in co.co_names
         co = co.co_code
-        op = ord(co[0]) + (ord(co[1]) << 8)
+        op = co[0] + (co[1] << 8)
         assert op == opcode.opmap["LOAD_CONST"]
 
     def test_tuple_constants(self):


More information about the pypy-commit mailing list