File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def find_module_path_and_all_py2(module: str,
91
91
except subprocess .CalledProcessError as e :
92
92
path = find_module_path_using_py2_sys_path (module , interpreter )
93
93
if path is None :
94
- raise CantImport (module , str (e ))
94
+ raise CantImport (module , str (e )) from e
95
95
return path , None
96
96
output = output_bytes .decode ('ascii' ).strip ().splitlines ()
97
97
module_path = output [0 ]
@@ -153,7 +153,7 @@ def find_module_path_and_all_py3(inspect: ModuleInspect,
153
153
# Fall back to finding the module using sys.path.
154
154
path = find_module_path_using_sys_path (module , sys .path )
155
155
if path is None :
156
- raise CantImport (module , str (e ))
156
+ raise CantImport (module , str (e )) from e
157
157
return path , None
158
158
if mod .is_c_module :
159
159
return None
You can’t perform that action at this time.
0 commit comments