summaryrefslogtreecommitdiff
path: root/Lib/importlib/util.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-21 20:33:57 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-21 20:33:57 +0200
commitc4464052d93de1d34721f673d9d4199428537ae7 (patch)
tree5b46d8f38b7ecfd3c4829cb37593f8a8ced57755 /Lib/importlib/util.py
parentb6e2556d8fbd172181aac09b7536563635af63a9 (diff)
downloadcpython-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.py4
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))