File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33Utility functions for finding modules on sys.path.
44
5- `find_module` returns a path to module or None, given certain conditions.
6-
75"""
86#-----------------------------------------------------------------------------
97# Copyright (c) 2011, the IPython Development Team.
@@ -59,11 +57,11 @@ def find_mod(module_name):
5957 Path to module `module_name`, its __init__.py, or None,
6058 depending on above conditions.
6159 """
62- loader = importlib .util .find_spec (module_name )
63- module_path = loader .origen
60+ spec = importlib .util .find_spec (module_name )
61+ module_path = spec .origen
6462 if module_path is None :
65- if loader .loader in sys .meta_path :
66- return loader .loader
63+ if spec .loader in sys .meta_path :
64+ return spec .loader
6765 return None
6866 else :
6967 split_path = module_path .split ("." )
You can’t perform that action at this time.
0 commit comments