cpython: 2de3c659a979 (original) (raw)

Mercurial > cpython

changeset 93529:2de3c659a979

Issue #19720: Suppressed context for some exceptions in importlib. [#19720]

Serhiy Storchaka storchaka@gmail.com
date Fri, 21 Nov 2014 20:33:57 +0200
parents 8558fff73032
children 8f77f7bb46c7
files Lib/importlib/__init__.py Lib/importlib/_bootstrap.py Lib/importlib/util.py
diffstat 3 files changed, 6 insertions(+), 5 deletions(-)[+] [-] Lib/importlib/__init__.py 5 Lib/importlib/_bootstrap.py 2 Lib/importlib/util.py 4

line wrap: on

line diff

--- a/Lib/importlib/init.py +++ b/Lib/importlib/init.py @@ -73,7 +73,7 @@ def find_loader(name, path=None): except KeyError: pass except AttributeError:

spec = _bootstrap._find_spec(name, path) # We won't worry about malformed specs (missing attributes). @@ -138,7 +138,8 @@ def reload(module): parent = sys.modules[parent_name] except KeyError: msg = "parent {!r} not in sys.modules"

--- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -2172,7 +2172,7 @@ def _find_and_load_unlocked(name, import path = parent_module.path except AttributeError: msg = (_ERR_MSG + '; {!r} is not a package').format(name, parent)

--- a/Lib/importlib/util.py +++ b/Lib/importlib/util.py @@ -56,7 +56,7 @@ def _find_spec_from_path(name, path=None try: spec = module.spec except AttributeError:

@@ -96,7 +96,7 @@ def find_spec(name, package=None): try: spec = module.spec except AttributeError: