Skip to content

Commit

Permalink
Fix exception causes in stubutil.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR committed Jun 12, 2020
1 parent 84bcb25 commit ae11258
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy/stubutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae11258

Please sign in to comment.