Message2129

Author otmarhumbel
Recipients
Date 2001-09-13.09:04:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
  // ...
}

History
Date User Action Args
2008-02-20 17:18:15adminlinkissue461151 messages
2008-02-20 17:18:15admincreate