mirror of
https://github.com/python/cpython.git
synced 2024-12-01 03:01:36 +01:00
b1611e2772
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. |
||
---|---|---|
.. | ||
_warnings.c | ||
asdl.c | ||
ast.c | ||
bltinmodule.c | ||
ceval_gil.h | ||
ceval.c | ||
codecs.c | ||
compile.c | ||
condvar.h | ||
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 | ||
errors.c | ||
fileutils.c | ||
formatter_unicode.c | ||
frozen.c | ||
frozenmain.c | ||
future.c | ||
getargs.c | ||
getcompiler.c | ||
getcopyright.c | ||
getcwd.c | ||
getopt.c | ||
getplatform.c | ||
getversion.c | ||
graminit.c | ||
import.c | ||
importdl.c | ||
importdl.h | ||
importlib.h | ||
makeopcodetargets.py | ||
marshal.c | ||
modsupport.c | ||
mysnprintf.c | ||
mystrtoul.c | ||
opcode_targets.h | ||
peephole.c | ||
pyarena.c | ||
pyctype.c | ||
pyfpe.c | ||
pymath.c | ||
pystate.c | ||
pystrcmp.c | ||
pystrtod.c | ||
Python-ast.c | ||
pythonrun.c | ||
pytime.c | ||
random.c | ||
sigcheck.c | ||
strdup.c | ||
structmember.c | ||
symtable.c | ||
sysmodule.c | ||
thread_foobar.h | ||
thread_nt.h | ||
thread_pth.h | ||
thread_pthread.h | ||
thread.c | ||
traceback.c |