0
0
mirror of https://github.com/python/cpython.git synced 2024-12-01 03:01:36 +01:00
cpython/Python
Brett Cannon b1611e2772 Issue #15767: Introduce ModuleNotFoundError, a subclass of
ImportError.

The exception is raised by import when a module could not be found.
Technically this is defined as no viable loader could be found for the
specified module. This includes ``from ... import`` statements so that
the module usage is consistent for all situations where import
couldn't find what was requested.

This should allow for the common idiom of::

  try:
    import something
  except ImportError:
    pass

to be updated to using ModuleNotFoundError and not accidentally mask
ImportError messages that should propagate (e.g. issues with a
loader).

This work was driven by the fact that the ``from ... import``
statement needed to be able to tell the difference between an
ImportError that simply couldn't find a module (and thus silence the
exception so that ceval can raise it) and an ImportError that
represented an actual problem.
2013-06-12 16:59:46 -04:00
..
_warnings.c Issue #1545463: At shutdown, defer finalization of codec modules so that stderr remains usable. 2013-05-08 13:23:25 +02:00
asdl.c
ast.c move declaration to top of block 2013-03-18 10:59:41 -07:00
bltinmodule.c rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
ceval_gil.h
ceval.c Issue #15767: Introduce ModuleNotFoundError, a subclass of 2013-06-12 16:59:46 -04:00
codecs.c
compile.c fix compilation on Windows 2013-05-16 22:17:17 +02:00
condvar.h Issue #15038 : Fixing the condition broadcast and docs. 2013-03-19 20:18:37 -07:00
dtoa.c
dup2.c
dynamic_annotations.c
dynload_aix.c
dynload_dl.c
dynload_hpux.c
dynload_next.c
dynload_shlib.c
dynload_stub.c
dynload_win.c Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). 2013-06-10 15:38:54 +01:00
errors.c
fileutils.c Issue #9566: Fix compiler warning on Windows 64-bit 2013-06-05 00:46:29 +02:00
formatter_unicode.c Fix a compilater warning on Windows 64-bit 2013-05-17 00:04:56 +02:00
frozen.c make some freezing related stuff const 2013-03-13 14:06:39 -05:00
frozenmain.c
future.c C89 compliance 2013-03-16 15:38:28 -07:00
getargs.c Issue #9566: Fix compilater warnings on Windows 64-bit 2013-06-05 01:18:13 +02:00
getcompiler.c
getcopyright.c
getcwd.c
getopt.c
getplatform.c
getversion.c
graminit.c Backed out changeset 521232b05b97 2013-03-20 00:39:41 -05:00
import.c Issue #18065: For frozen packages set __path__ to []. 2013-05-31 23:18:39 -04:00
importdl.c
importdl.h
importlib.h Issue #15767: Introduce ModuleNotFoundError, a subclass of 2013-06-12 16:59:46 -04:00
makeopcodetargets.py
marshal.c Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal. 2013-04-13 22:41:09 +02:00
modsupport.c
mysnprintf.c
mystrtoul.c
opcode_targets.h rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
peephole.c
pyarena.c
pyctype.c
pyfpe.c
pymath.c
pystate.c Issue #17912: Use a doubly linked-list for thread states. 2013-05-08 21:09:52 +02:00
pystrcmp.c
pystrtod.c
Python-ast.c Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant() 2013-05-20 19:13:19 +02:00
pythonrun.c Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown. 2013-05-06 21:15:57 +02:00
pytime.c
random.c
sigcheck.c
strdup.c
structmember.c
symtable.c move definition to top of block 2013-05-16 19:38:22 -05:00
sysmodule.c
thread_foobar.h
thread_nt.h
thread_pth.h
thread_pthread.h
thread.c
traceback.c Fix compilater warnings on Windows 64-bit 2013-05-17 00:12:04 +02:00