From ae112589045bd3049cbdc034e896e8f2cd0b31f0 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Fri, 12 Jun 2020 23:21:55 +0300 Subject: [PATCH] Fix exception causes in stubutil.py --- mypy/stubutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/stubutil.py b/mypy/stubutil.py index 51f9ef6e39ff6..d21ba40599137 100644 --- a/mypy/stubutil.py +++ b/mypy/stubutil.py @@ -91,7 +91,7 @@ def find_module_path_and_all_py2(module: str, except subprocess.CalledProcessError as e: path = find_module_path_using_py2_sys_path(module, interpreter) if path is None: - raise CantImport(module, str(e)) + raise CantImport(module, str(e)) from e return path, None output = output_bytes.decode('ascii').strip().splitlines() module_path = output[0] @@ -153,7 +153,7 @@ def find_module_path_and_all_py3(inspect: ModuleInspect, # Fall back to finding the module using sys.path. path = find_module_path_using_sys_path(module, sys.path) if path is None: - raise CantImport(module, str(e)) + raise CantImport(module, str(e)) from e return path, None if mod.is_c_module: return None