Пример #1
0
 public PyObject __call__(PyObject args[], String keywords[]) {
   ThreadState ts = Py.getThreadState();
   if (ts.recursion_depth++ > ts.systemState.getrecursionlimit())
     throw Py.RuntimeError("maximum __call__ recursion depth exceeded");
   try {
     PyType self_type = getType();
     PyObject impl = self_type.lookup("__call__");
     if (impl != null) return impl.__get__(this, self_type).__call__(args, keywords);
     return super.__call__(args, keywords);
   } finally {
     --ts.recursion_depth;
   }
 }
Пример #2
0
 public PyObject load_module(String name) {
   // System.out.println("JyNIImporter.load module: "+name);
   JyNIModuleInfo inf = dynModules.get(name);
   if (inf.module == null) {
     inf.module = JyNI.loadModule(name, inf.path, Py.getThreadState());
     // System.out.println("had to call JyNI.loadModule, which returned "+inf.module);
   }
   // return JyNI.loadModule(name, "path");
   // System.out.println("JyNIImporter.load_module returns: "+inf.module);
   return inf.module;
   // System.out.println("000path: "+inf.path);
   // return Py.NotImplemented; //PySystemState.packageManager.lookupName(name.intern());
 }