throw Py.ImportError("No module named " + name);
}
public static PyObject load_module(String name, PyObject file, PyObject filename, PyTuple data) {
PyObject mod = Py.None;
PySystemState sys = Py.getSystemState();
int type = data.__getitem__(2).asInt();
while(mod == Py.None) {
String compiledName;
switch (type) {
case PY_SOURCE:
Object o = file.__tojava__(InputStream.class);
if (o == Py.NoConversion) {
throw Py.TypeError("must be a file-like object");
}
// XXX: This should load the accompanying byte code file instead, if it exists
String resolvedFilename = sys.getPath(filename.toString());
compiledName = org.python.core.imp.makeCompiledFilename(resolvedFilename);
if (name.endsWith(".__init__")) {
name = name.substring(0, name.length() - ".__init__".length());
} else if (name.equals("__init__")) {
name = new File(sys.getCurrentWorkingDir()).getName();
}
File fp = new File(resolvedFilename);
long mtime = -1;
if (fp.isFile()) {