|
From: <no...@so...> - 2001-09-13 09:04:38
|
Patches item #461151, was opened at 2001-09-13 02:04 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=461151&group_id=12867 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Otmar Humbel (otmarhumbel) Assigned to: Nobody/Anonymous (nobody) Summary: Simple java class import Initial Comment: The following lines added just at the beginning of method importFromAs in org/python/core/imp.java (from the 2.0 codebase) would make the import of single java classes a bit more tolerant, especially if the package manager encounters a 'bad' .jar File: public static void importFromAs(String mod, String[] names, String[] asnames, PyFrame frame) { if ( names.length==1 && names.length==names.length && asnames[0].equals(names[0]) ) { // this is a candidate for simple java class import String packageName = mod; String fullClassName = packageName + "." + names [0]; try { Class.forName( fullClassName ); PySystemState.add_package( packageName ); } catch( Throwable t ) {} } // rest of method left untouched // ... } ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=461151&group_id=12867 |