Issue1799

classification
Title: import * doesn't discover classes
Type: behaviour Severity: normal
Components: Core Versions: 2.5.2
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, j13r
Priority: Keywords:

Created on 2011-09-22.13:45:33 by j13r, last changed 2012-02-10.18:18:24 by fwierzbicki.

Messages
msg6650 (view) Author: Johannes Buchner (j13r) Date: 2011-09-22.13:45:33
I have the issue that 

> from org.eclipse.swt.widgets import *

doesn't work. To be exact, it doesn't discover anything.
It fails, unless I have something like 
> import org.eclipse.swt.widgets.List
before it, in which case it imports "List" into the namespace, but nothing else.

Clearly, the code is in the classpath, and it can be imported. But it isn't automatically discovered. This seems to be a bug in the latest Jython release.

To test, download the right SWT jar from http://www.eclipse.org/swt/
Then run:

[user@localhost tmp]$ JYTHONPATH=swt-gtk.jar java -jar /home/user/.m2/repository/org/python/jython-standalone/2.5.2/jython-standalone-2.5.2.jar 
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) 
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_22
Type "help", "copyright", "credits" or "license" for more information.
>>> import org.eclipse.swt.widgets.List
>>> from org.eclipse.swt.widgets import *
>>> dir()
['List', '__doc__', '__name__', 'org']
>>> 

Expected: dir should also return Text, Shell, Display, and many more.
msg6773 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-02-10.18:18:23
Hi j13r - you are running Jython in "standalone" mode which doesn't activate java package inspection. If you want this behavior, you should install Jython without using standalone mode. See http://wiki.python.org/jython/InstallingJython for (a little) more detail.
History
Date User Action Args
2012-02-10 18:18:24fwierzbickisetstatus: open -> closed
resolution: invalid
messages: + msg6773
nosy: + fwierzbicki
2011-09-22 13:45:33j13rcreate