SHARE
TWEET

Untitled

a guest Jun 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @classmethod
  2. def _path_importer_cache(cls, path):
  3.     """Get the finder for the path entry from sys.path_importer_cache.
  4.  
  5.     If the path entry is not in the cache, find the appropriate finder
  6.     and cache it. If no finder is available, store None.
  7.  
  8.     """
  9.     if path == '':
  10.         try:
  11.             path = _os.getcwd()
  12.         except FileNotFoundError:
  13.             # Don't cache the failure as the cwd can easily change to
  14.             # a valid directory later on.
  15.             return None
  16.     try:
  17.         finder = sys.path_importer_cache[path]
  18.     except KeyError:
  19.         finder = cls._path_hooks(path)
  20.         sys.path_importer_cache[path] = finder
  21.     return finder
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top