[pypy-commit] pypy py3k: kill the u prefix, and adapt che expected bytecode to the new py3k compiler
antocuni
noreply at buildbot.pypy.org
Tue Feb 28 22:55:37 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52999:6b7f258424f1
Date: 2012-02-28 20:35 +0100
http://bitbucket.org/pypy/pypy/changeset/6b7f258424f1/
Log: kill the u prefix, and adapt che expected bytecode to the new py3k
compiler
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -891,7 +891,7 @@
monkeypatch.setattr(optimize, "MAXUNICODE", 0xFFFF)
source = """def f():
- return u"\uE01F"[0]
+ return "\uE01F"[0]
"""
counts = self.count_instructions(source)
assert counts == {ops.LOAD_CONST: 1, ops.RETURN_VALUE: 1}
@@ -900,11 +900,11 @@
# getslice is not yet optimized.
# Still, check a case which yields the empty string.
source = """def f():
- return u"abc"[:0]
+ return "abc"[:0]
"""
counts = self.count_instructions(source)
- assert counts == {ops.LOAD_CONST: 2, ops.SLICE+2: 1,
- ops.RETURN_VALUE: 1}
+ assert counts == {ops.LOAD_CONST: 3, ops.BUILD_SLICE: 1,
+ ops.BINARY_SUBSCR: 1, ops.RETURN_VALUE: 1}
def test_remove_dead_code(self):
source = """def f(x):
More information about the pypy-commit
mailing list