cpython/Objects
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
..
stringlib rewrite the parsing of field names to be more consistent wrt recursive expansion 2013-05-17 18:22:31 -05:00
abstract.c Issue #9369: The types of `char*` arguments of PyObject_CallFunction() and 2013-05-29 18:50:54 +03:00
accu.c
boolobject.c
bytearrayobject.c
bytes_methods.c
bytesobject.c Issue #12983: Bytes literals with invalid \x escape now raise a SyntaxError 2013-02-10 17:43:25 +02:00
capsule.c
cellobject.c
classobject.c
codeobject.c
complexobject.c Close #17694: Add minimum length to _PyUnicodeWriter 2013-04-17 23:02:17 +02:00
descrobject.c Use Py_intptr_t to store the difference between two pointers, instead of int 2013-05-08 00:44:15 +02:00
dictnotes.txt
dictobject.c merge 2013-05-17 03:24:54 -07:00
enumobject.c
exceptions.c Issue #15767: Introduce ModuleNotFoundError, a subclass of 2013-06-12 16:59:46 -04:00
fileobject.c
floatobject.c Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros 2013-06-04 23:14:37 +02:00
frameobject.c Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros 2013-06-04 23:14:37 +02:00
funcobject.c
genobject.c Backout c89febab4648 following private feedback by Guido. 2013-05-14 20:37:52 +02:00
iterobject.c Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators: 2013-06-04 23:02:46 +02:00
listobject.c
listsort.txt
lnotab_notes.txt
longobject.c Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros 2013-06-04 23:14:37 +02:00
memoryobject.c Fix error messages. 2013-02-19 13:44:49 +01:00
methodobject.c Fix supernumerary 's' in sys._debugmallocstats() output. 2013-04-11 21:02:20 +02:00
moduleobject.c #17115,17116: Have modules initialize the __package__ and __loader__ 2013-05-04 13:56:58 -04:00
namespaceobject.c Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init() 2013-06-05 00:13:51 +02:00
object.c Optimize ascii(str): don't encode/decode repr if repr is already ASCII 2013-04-14 18:44:10 +02:00
obmalloc.c Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() when running on valgrind. 2013-04-06 01:15:30 +02:00
rangeobject.c
setobject.c
sliceobject.c
structseq.c
tupleobject.c Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tuple 2013-06-05 00:11:34 +02:00
typeobject.c when arguments are cells clear the locals slot (backport of #17927) 2013-05-14 22:31:26 -05:00
typeslots.inc
typeslots.py
unicodectype.c
unicodeobject.c merge 3.3 (#18183) 2013-06-10 09:24:01 -07:00
unicodetype_db.h
weakrefobject.c Issue #17643: Add __callback__ attribute to weakref.ref. 2013-04-13 15:45:44 +01:00