diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-21 20:33:57 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-21 20:33:57 +0200 |
commit | c4464052d93de1d34721f673d9d4199428537ae7 (patch) | |
tree | 5b46d8f38b7ecfd3c4829cb37593f8a8ced57755 /Lib/importlib/util.py | |
parent | b6e2556d8fbd172181aac09b7536563635af63a9 (diff) | |
download | cpython-git-c4464052d93de1d34721f673d9d4199428537ae7.tar.gz |
Issue #19720: Suppressed context for some exceptions in importlib.
Diffstat (limited to 'Lib/importlib/util.py')
-rw-r--r-- | Lib/importlib/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py index 2424144b91..c42ef14c5d 100644 --- 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: - raise ValueError('{}.__spec__ is not set'.format(name)) + raise ValueError('{}.__spec__ is not set'.format(name)) from None else: if spec is None: raise ValueError('{}.__spec__ is None'.format(name)) @@ -96,7 +96,7 @@ def find_spec(name, package=None): try: spec = module.__spec__ except AttributeError: - raise ValueError('{}.__spec__ is not set'.format(name)) + raise ValueError('{}.__spec__ is not set'.format(name)) from None else: if spec is None: raise ValueError('{}.__spec__ is None'.format(name)) |