See bug 620019: python-peak-rules fails in its selftest suite on Python 2.7, with: File "/usr/lib/python2.7/site-packages/peak/util/assembler.py", line 221, in TryExcept next_test.JUMP_IF_FALSE, Code.POP_TOP, # remove condition AttributeError: 'Label' object has no attribute 'JUMP_IF_FALSE' http://koji.fedoraproject.org/koji/getfile?taskID=2368743&name=build.log JUMP_IF_FALSE was removed in 2.7: http://svn.python.org/view?view=rev&revision=70071 Looks like BytecodeAssembler needs fixing up to reflect these bytecode changes. It appears that we do run the selftests in python-peak-util-assembler.spec: %check nosetests so it's a bit disturbing that this rebuilt successfully against 2.7: http://kojipkgs.fedoraproject.org/packages/python-peak-util-assembler/0.5.1/2.fc14/data/logs/noarch/build.log + nosetests . ---------------------------------------------------------------------- Ran 1 test in 0.036s OK
(In reply to comment #0) > It appears that we do run the selftests in python-peak-util-assembler.spec: > %check > nosetests > > so it's a bit disturbing that this rebuilt successfully against 2.7: > http://kojipkgs.fedoraproject.org/packages/python-peak-util-assembler/0.5.1/2.fc14/data/logs/noarch/build.log > > + nosetests > . > ---------------------------------------------------------------------- > Ran 1 test in 0.036s > OK BytecodeAssembler-0.5.1/test_assembler.py has: def additional_tests(): import doctest return doctest.DocFileSuite( 'README.txt', optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE, ) and README.txt has doctests for Try/Except, which do include JUMP_IF_FALSE. Are the doctests really getting run in our builds?
Running nosetests "passes", but it looks like the tests aren't run: . ---------------------------------------------------------------------- Ran 1 test in 0.034s OK Running: python setup.py test fails with numerous errors from inside README.txt; will attach
Created attachment 435753 [details] Log of selftest failures against python 2.7
Created attachment 435757 [details] Initial attempt at a patch; doesn't work yet. Unfortunately the doctests contain lots of embedded assumptions about Python bytecode. I'm attaching an attempt at a patch for the higher-level API, which is what I believe peak-rules is using. This doesn't work yet, I get exceptions in the stack-depth checking. Looks like this needs to be reworked to cope with the stack-effect of a bytecode varying based on whether or not a conditional branch is followed, which is the case for JUMP_IF_TRUE_OR_POP and JUMP_IF_FALSE_OR_POP (see http://svn.python.org/view/python/trunk/Doc/library/dis.rst?r1=70071&r2=70070&pathrev=70071 )
I email pje/peak mailing list about this and he's made a few workarounds and a new release: http://pypi.python.org/pypi/BytecodeAssembler/0.5.2 There's a few test failures but they're only supposed to be false positives. Explanation here: http://www.eby-sarna.com/pipermail/peak/2010-August/003375.html
Note that 0.5.2 has a license change: diff of PKG-INFO: -License: PSF or ZPL +License: http://www.apache.org/licenses/LICENSE-2.0
python-peak-util-assembler-0.6-2.20100803svn2646.fc14 has been submitted as an update for Fedora 14. http://admin.fedoraproject.org/updates/python-peak-util-assembler-0.6-2.20100803svn2646.fc14
python-peak-util-assembler-0.6-2.20100803svn2646.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.