Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146868 - jythonc -2.1 uses reserved assert function from Java
Summary: jythonc -2.1 uses reserved assert function from Java
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL: http://sourceforge.net/tracker/index....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-08 12:38 UTC by Joel
Modified: 2006-09-09 14:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
modified 2.1-assert.patch that fixes the problem (2.1-assert.patch,2.50 KB, patch)
2006-09-08 12:41 UTC, Joel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel 2006-09-08 12:38:35 UTC
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.
Comment 1 Joel 2006-09-08 12:41:11 UTC
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.
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2006-09-09 02:02:32 UTC
(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.
Comment 3 Joel 2006-09-09 14:14:49 UTC
Upstream report to mailing list is now in the URL.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2006-09-09 14:44:17 UTC
Patch applied. Thanks for the fix.