📄 exceptions.java
字号:
// Copyright 2001 Finn Bockpackage org.python.core;import java.lang.reflect.*;/** * The builtin exceptions module. The entire module should be imported * from python. None of the methods defined here should be called * from java. */public class exceptions implements ClassDictInit { public static String __doc__ ="Python's standard exception class hierarchy.\n" +"\n" +"Here is a rundown of the class hierarchy. The classes found here are\n" +"inserted into both the exceptions module and the `built-in' module. "+"It is\n" +"recommended that user defined class based exceptions be derived from the\n" +"`Exception' class, although this is currently not enforced.\n" +"\n" +"Exception\n" +" |\n" +" +-- SystemExit\n" +" +-- StopIteration\n" +" +-- StandardError\n" +" | |\n" +" | +-- KeyboardInterrupt\n" +" | +-- ImportError\n" +" | +-- EnvironmentError\n" +" | | |\n" +" | | +-- IOError\n" +" | | +-- OSError\n" +" | | |\n" +" | | +-- WindowsError\n" +" | |\n" +" | +-- EOFError\n" +" | +-- RuntimeError\n" +" | | |\n" +" | | +-- NotImplementedError\n" +" | |\n" +" | +-- NameError\n" +" | | |\n" +" | | +-- UnboundLocalError\n" +" | |\n" +" | +-- AttributeError\n" +" | +-- SyntaxError\n" +" | | |\n" +" | | +-- IndentationError\n" +" | | |\n" +" | | +-- TabError\n" +" | |\n" +" | +-- TypeError\n" +" | +-- AssertionError\n" +" | +-- LookupError\n" +" | | |\n" +" | | +-- IndexError\n" +" | | +-- KeyError\n" +" | |\n" +" | +-- ArithmeticError\n" +" | | |\n" +" | | +-- OverflowError\n" +" | | +-- ZeroDivisionError\n" +" | | +-- FloatingPointError\n" +" | |\n" +" | +-- ValueError\n" +" | | |\n" +" | | +-- UnicodeError\n" +" | |\n" +" | +-- ReferenceError\n" +" | +-- SystemError\n" +" | +-- MemoryError\n" +" |\n" +" +---Warning\n" +" |\n" +" +-- UserWarning\n" +" +-- DeprecationWarning\n" +" +-- SyntaxWarning\n" +" +-- OverflowWarning\n" +" +-- RuntimeWarning"; private exceptions() { ; } /** <i>Internal use only. Do not call this method explicit.</i> */ public static void classDictInit(PyObject dict) { dict.invoke("clear"); dict.__setitem__("__name__", new PyString("exceptions")); dict.__setitem__("__doc__", new PyString(__doc__)); ThreadState ts = Py.getThreadState(); if (ts.systemState == null) { ts.systemState = Py.defaultSystemState; } // Push frame PyFrame frame = new PyFrame(null, new PyStringMap()); frame.f_back = ts.frame; if (frame.f_builtins == null) { if (frame.f_back != null) { frame.f_builtins = frame.f_back.f_builtins; } else { frame.f_builtins = ts.systemState.builtins; } } ts.frame = frame; buildClass(dict, "Exception", null, "Exception", "Proposed base class for all exceptions."); buildClass(dict, "StandardError", "Exception", "empty__init__", "Base class for all standard Python exceptions."); buildClass(dict, "SyntaxError", "StandardError", "SyntaxError", "Invalid syntax"); buildClass(dict, "IndentationError", "SyntaxError", "empty__init__", "Improper indentation"); buildClass(dict, "TabError", "IndentationError", "empty__init__", "Improper mixture of spaces and tabs."); buildClass(dict, "EnvironmentError", "StandardError", "EnvironmentError", "Base class for I/O related errors."); buildClass(dict, "IOError", "EnvironmentError", "empty__init__", "I/O operation failed."); buildClass(dict, "OSError", "EnvironmentError", "empty__init__", "OS system call failed."); buildClass(dict, "RuntimeError", "StandardError", "empty__init__", "Unspecified run-time error."); buildClass(dict, "NotImplementedError", "RuntimeError", "empty__init__", "Method or function hasn't been implemented yet."); buildClass(dict, "SystemError", "StandardError", "empty__init__", "Internal error in the Python interpreter.\n\n" + "Please report this to the Python maintainer, "+ "along with the traceback,\n" + "the Python version, and the hardware/OS "+ "platform and version."); buildClass(dict, "ReferenceError", "StandardError", "empty__init__", "Weak ref proxy used after referent went away."); buildClass(dict, "EOFError", "StandardError", "empty__init__", "Read beyond end of file."); buildClass(dict, "ImportError", "StandardError", "empty__init__", "Import can't find module, or can't find name in module."); buildClass(dict, "TypeError", "StandardError", "empty__init__", "Inappropriate argument type."); buildClass(dict, "ValueError", "StandardError", "empty__init__", "Inappropriate argument value (of correct type)."); buildClass(dict, "UnicodeError", "ValueError", "empty__init__", "Unicode related error."); buildClass(dict, "KeyboardInterrupt", "StandardError", "empty__init__", "Program interrupted by user."); buildClass(dict, "AssertionError", "StandardError", "empty__init__", "Assertion failed."); buildClass(dict, "ArithmeticError", "StandardError", "empty__init__", "Base class for arithmetic errors."); buildClass(dict, "OverflowError", "ArithmeticError", "empty__init__", "Result too large to be represented."); buildClass(dict, "FloatingPointError", "ArithmeticError", "empty__init__", "Floating point operation failed."); buildClass(dict, "ZeroDivisionError", "ArithmeticError", "empty__init__", "Second argument to a division or modulo operation "+ "was zero."); buildClass(dict, "LookupError", "StandardError", "empty__init__", "Base class for lookup errors."); buildClass(dict, "IndexError", "LookupError", "empty__init__", "Sequence index out of range."); buildClass(dict, "KeyError", "LookupError", "empty__init__", "Mapping key not found."); buildClass(dict, "AttributeError", "StandardError", "empty__init__", "Attribute not found."); buildClass(dict, "NameError", "StandardError", "empty__init__", "Name not found globally."); buildClass(dict, "UnboundLocalError", "NameError", "empty__init__", "Local name referenced but not bound to a value."); buildClass(dict, "MemoryError", "StandardError", "empty__init__", "Out of memory."); buildClass(dict, "SystemExit", "Exception", "SystemExit", "Request to exit from the interpreter."); buildClass(dict, "StopIteration", "Exception", "empty__init__", "Signal the end from iterator.next()."); buildClass(dict, "Warning", "Exception", "empty__init__", "Base class for warning categories."); buildClass(dict, "UserWarning", "Warning", "empty__init__", "Base class for warnings generated by user code."); buildClass(dict, "DeprecationWarning", "Warning", "empty__init__", "Base class for warnings about deprecated features."); buildClass(dict, "SyntaxWarning", "Warning", "empty__init__", "Base class for warnings about dubious syntax."); buildClass(dict, "RuntimeWarning", "Warning", "empty__init__",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -