mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
Issue #15767: Add ModuleNotFoundError.
This commit is contained in:
parent
86a7668426
commit
c943265ba5
8 changed files with 42 additions and 2 deletions
|
@ -705,6 +705,13 @@ ComplexExtendsException(PyExc_Exception, ImportError,
|
|||
"Import can't find module, or can't find name in "
|
||||
"module.");
|
||||
|
||||
/*
|
||||
* ModuleNotFoundError extends ImportError
|
||||
*/
|
||||
|
||||
MiddlingExtendsException(PyExc_ImportError, ModuleNotFoundError, ImportError,
|
||||
"Module not found.");
|
||||
|
||||
/*
|
||||
* OSError extends Exception
|
||||
*/
|
||||
|
@ -2469,6 +2476,7 @@ _PyExc_Init(PyObject *bltinmod)
|
|||
PRE_INIT(SystemExit)
|
||||
PRE_INIT(KeyboardInterrupt)
|
||||
PRE_INIT(ImportError)
|
||||
PRE_INIT(ModuleNotFoundError)
|
||||
PRE_INIT(OSError)
|
||||
PRE_INIT(EOFError)
|
||||
PRE_INIT(RuntimeError)
|
||||
|
@ -2541,6 +2549,7 @@ _PyExc_Init(PyObject *bltinmod)
|
|||
POST_INIT(SystemExit)
|
||||
POST_INIT(KeyboardInterrupt)
|
||||
POST_INIT(ImportError)
|
||||
POST_INIT(ModuleNotFoundError)
|
||||
POST_INIT(OSError)
|
||||
INIT_ALIAS(EnvironmentError, OSError)
|
||||
INIT_ALIAS(IOError, OSError)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue