Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @classmethod
  2. def find_spec(cls, fullname, path=None, target=None):
  3. '''
  4. 前略...
  5. '''
  6. spec = cls._get_spec(fullname, path, target)
  7. if spec is None:
  8. return None
  9. elif spec.loader is None:
  10. namespace_path = spec.submodule_search_locations
  11. if namespace_path:
  12. # We found at least one namespace path. Return a spec which
  13. # can create the namespace package.
  14. spec.origin = None
  15. spec.submodule_search_locations = _NamespacePath(fullname, namespace_path, cls._get_spec)
  16. return spec
  17. else:
  18. return None
  19. else:
  20. return spec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement