| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forgot to raise ModuleNotFoundError when None is found in sys.modules.
This led to introducing the C function PyErr_SetImportErrorSubclass()
to make setting ModuleNotFoundError easier.
Also updated the reference docs to mention ModuleNotFoundError
appropriately. Updated the docs for ModuleNotFoundError to mention the
None in sys.modules case.
Lastly, it was noticed that PyErr_SetImportError() was not setting an
exception when returning None in one case. That issue is now fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
the default locations for cafile and capath.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
which avoids affecting global state.
|
| |
| |
| |
| | |
PEP accepted: http://mail.python.org/pipermail/python-dev/2013-June/126734.html
|
|\ \
| |/ |
|
| |
| |
| |
| | |
by using the wording from the Py2.7 docs.
|
| |
| |
| |
| |
| |
| |
| | |
Previously __path__ was set to [__name__], but that could lead to bad
results if someone managed to circumvent the frozen importer and
somehow ended up with a finder that thought __name__ was a legit
directory/location.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
importlib.abc.Loader.init_module_attrs() and implement
importlib.abc.InspectLoader.load_module().
The importlib.abc.Loader.init_module_attrs() method sets the various
attributes on the module being loaded. It is done unconditionally to
support reloading. Typically people used
importlib.util.module_for_loader, but since that's a decorator there
was no way to override it's actions, so init_module_attrs() came into
existence to allow for overriding. This is also why module_for_loader
is now pending deprecation (having its other use replaced by
importlib.util.module_to_load).
All of this allowed for importlib.abc.InspectLoader.load_module() to
be implemented. At this point you can now implement a loader with
nothing more than get_code() (which only requires get_source();
package support requires is_package()). Thanks to init_module_attrs()
the implementation of load_module() is basically a context manager
containing 2 methods calls, a call to exec(), and a return statement.
|
| |
| |
| |
| |
| | |
control whether to reset the module's __name__ attribute in case a
reload is being done.
|
| | |
|
| | |
|
| |
| |
| |
| | |
explains better what the context manager is providing.
|
| |
| |
| |
| |
| | |
PyObject_CallMethod() now changed to `const char*`.
Based on patches by Jörg Müller and Lars Buitinck.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
and __package__ unconditionally in order to do the right thing for
reloading.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
handle providing (and cleaning up if needed) the module to be loaded.
A future commit will use the context manager in
Lib/importlib/_bootstrap.py and thus why the code is placed there
instead of in Lib/importlib/util.py.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| |
| | |
non-alphabet characters present in the input string to conform a docstring.
Updated the module documentation.
|
| |
| |
| |
| |
| | |
non-alphabet characters present in the input string to conform a docstring.
Updated the module documentation.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Windows, which was temporarily removed in Python 3.2.3 due to an incomplete implementation. The implementation now works even if the symlink is created in a location other than the current directory.
|
| |
| |
| |
| | |
ExecutionLoader.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
While the previous location was fine, it makes more sense to have the
method higher up in the inheritance chain, especially at a point where
get_source() is defined which is the earliest source_to_code() could
programmatically be used in the inheritance tree in importlib.abc.
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
to interp->modules) and that deleting essential items from the dict
can cause Python to blow up.
Thanks to Terry Reedy for coming up with initial wording and Yogesh
Chaudhari for coming up with a patch using that wording in parallel to
my own patch.
|
| |
| |
| |
| |
| |
| | |
result under all circumstances.
Document the change of Request.full_url to a property.
|
|\ \
| |/
| |
| | |
Fix #18007 : Document CookieJar.add_cookie_header request parameter changes in 3.3 and 3.4.
|
| |
| |
| |
| | |
in 3.3
|