Message1222

Author nobody
Recipients
Date 2006-09-08.19:37:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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


This error does not seem to have been reported before,
although a similar problem was reported fixed for the
jython compilation itself.

I was able to fix the problem by renaming assert to
assert_ in  SimpleCompiler.py.   The patch is attached.
History
Date User Action Args
2008-02-20 17:17:33adminlinkissue1554945 messages
2008-02-20 17:17:33admincreate