static void maybeSystemExit(PyException exc) { if (exc.match(Py.SystemExit)) { PyObject value = exc.value; if (PyException.isExceptionInstance(exc.value)) { value = value.__findattr__("code"); } Py.getSystemState().callExitFunc(); if (value instanceof PyInteger) { System.exit(((PyInteger) value).getValue()); } else { if (value != Py.None) { try { Py.println(value); System.exit(1); } catch (Throwable t) { // continue } } System.exit(0); } } } public static PyObject StopIteration;
if (e.match(Py.SystemExit)) { PyObject value = e.value; if (PyException.isExceptionInstance(e.value)) { value = value.__findattr__("code");
if (isExceptionInstance(value)) { inClass = value.fastGetClass();
PyException pye = new PyException(type, value, (PyTraceback)traceback); pye.normalize(); if (!isExceptionInstance(pye.value)) { throw Py.TypeError(String.format( "calling %s() should have returned an instance of BaseException, not '%s'", } else if (isExceptionInstance(type)) {