Closely related to bug 142099, although this one shows up when jythonc is used to compile jython code rather than in compiling jython itself. Use of jythonc when code that includes asserts will produce errors of the form: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier (try -source 1.3 or lower to use 'assert' as an identifier) ^ A short code that reproduces this problem is: # more test.py import thread, threading print 'hello, world' thread.exit() # jythonc --all test.py processing test ... Compiling with args: ['/opt/sun-jdk-1.5.0.08/bin/javac', '-classpath', '/usr/share/jython/lib/jython.jar:/usr/share/libreadline-java/lib/libreadline-java.jar:./jpywork::/usr/share/jython/tools/jythonc:/root/novelty/jython/server/.:/usr/share/jython/Lib', './jpywork/random.java', './jpywork/threading.java', './jpywork/sre_parse.java', './jpywork/copy.java', './jpywork/linecache.java', './jpywork/javaos.java', './jpywork/atexit.java', './jpywork/test.java', './jpywork/sre_constants.java', './jpywork/string.java', './jpywork/javapath.java', './jpywork/traceback.java', './jpywork/sre.java', './jpywork/StringIO.java', './jpywork/copy_reg.java', './jpywork/re.java', './jpywork/stat.java', './jpywork/UserDict.java', './jpywork/sre_compile.java', './jpywork/repr.java'] 1 ./jpywork/threading.java:561: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier (try -source 1.3 or lower to use 'assert' as an identifier) if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0).__getattr__("__RLock__owner")._is(frame.getlocal(2)), s$8); ^ ./jpywork/threading.java:705: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier (try -source 1.3 or lower to use 'assert' as an identifier) if (frame.getglobal("__debug__").__nonzero__()) Py The fix is by renaming assert to assert_ in SimpleCompiler.py. I have submitted the patch upstream.
Created attachment 96431 [details, diff] modified 2.1-assert.patch that fixes the problem Fix to SimpleCompiler.py included with previous fixes of the same type.
(In reply to comment #0) > > > The fix is by renaming assert to assert_ in SimpleCompiler.py. I have > submitted the patch upstream. > Please include the url for your upstream bug report in the bug report and put it in the URL field or if you used the mailing list mention that. This helps people to find the upstream bug report if they want to check what is the status in the upstream sources.
Upstream report to mailing list is now in the URL.
Patch applied. Thanks for the fix.