()
Set all module __file__ and __cached__ attributes to an absolute path
Set all module __file__ and __cached__ attributes to an absolute path
Set all module __file__ and __cached__ attributes to an absolute path
def abs_paths():
    """Set all module __file__ and __cached__ attributes to an absolute path"""
    for m in set(sys.modules.values()):
        loader_module = None
        try:
            loader_module = m.__loader__.__module__
        except AttributeError:
            try:
                loader_module = m.__spec__.loader.__module__
            except AttributeError:
                pass
        if loader_module not in {'_frozen_importlib', '_frozen_importlib_external'}:
            continue   # don't mess with a PEP 302-supplied __file__
        try:
            m.__file__ = os.path.abspath(m.__file__)
        except (AttributeError, OSError, TypeError):
            pass
        try:
            m.__cached__ = os.path.abspath(m.__cached__)
        except (AttributeError, OSError, TypeError):
            pass
def abs_paths ( ) : for m in set ( sys . modules . values ( ) ) : loader_module = None try : loader_module = m . __loader__ . __module__ except AttributeError : try : loader_module = m . __spec__ . loader . __module__ except AttributeError : pass if loader_module not in { '_frozen_importlib' , '_frozen_importlib_external' } : continue # don't mess with a PEP 302-supplied __file__ try : m . __file__ = os . path . abspath ( m . __file__ ) except ( AttributeError , OSError , TypeError ) : pass try : m . __cached__ = os . path . abspath ( m . __cached__ ) except ( AttributeError , OSError , TypeError ) : pass