final private PyObject find_class(String module, String name) {
if (find_global != null) {
if (find_global == Py.None)
throw new PyException(UnpicklingError,
"Global and instance pickles are not supported.");
return find_global.__call__(new PyString(module), new PyString(name));
}
PyObject modules = Py.getSystemState().modules;
PyObject mod = modules.__finditem__(module.intern());
if (mod == null) {
mod = importModule(module);
}
PyObject global = mod.__findattr__(name.intern());
if (global == null) {
throw new PyException(Py.SystemError,
"Failed to import class " + name + " from module " +
module);
}
return global;
}