From: SourceForge.net <no...@so...> - 2006-08-31 03:52:37
|
Bugs item #774219, was opened at 2003-07-19 09:56 Message generated for change (Settings changed) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=774219&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: Deferred >Status: Closed >Resolution: Fixed Priority: 4 Submitted By: Jane Austine (janeaustine50) Assigned to: Nobody/Anonymous (nobody) Summary: sys.path.append doesn't add .jar file properly Initial Comment: Jython 2.1 final on win XP. Jython 2.1 on java1.4.2-beta (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('junit.jar') >>> import junit >>> junit.framework <java package junit.framework at 13554088> >>> junit.framework.TestCase Traceback (innermost last): File "<console>", line 1, in ? AttributeError: java package 'junit.framework' has no attribute 'TestCase' >>> from junit.framework import * >>> junit.framework.TestCase <jclass junit.framework.TestCase at 22498184> >>> As you see the junit.framework.TestCase is not accessible simply by adding the jar file in the sys.path. You need to import the specific class in order to access it. ---------------------------------------------------------------------- >Comment By: Charles Groves (cgroves) Date: 2006-08-30 22:52 Message: Logged In: YES user_id=1174327 Fixed in trunk. ---------------------------------------------------------------------- Comment By: Jane Austine (janeaustine50) Date: 2003-07-24 04:11 Message: Logged In: YES user_id=732903 Even if "TestCase" class seems to be accessible from the work-around, you can't instantiate an instace from that class; it results in a null pointer exception. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=774219&group_id=12867 |