private static boolean runMainFromImporter(InteractiveConsole interp, String filename) { // Support http://bugs.python.org/issue1739468 - Allow interpreter to execute a zip file or directory PyString argv0 = Py.newStringOrUnicode(filename); PyObject importer = imp.getImporter(argv0); if (!(importer instanceof PyNullImporter)) { /* argv0 is usable as an import source, so put it in sys.path[0] and import __main__ */ Py.getSystemState().path.insert(0, argv0); runModule(interp, "__main__", true); return true; } return false; }