Updating.

This commit is contained in:
Elf M. Sternberg 2016-07-09 10:51:54 -07:00
parent 631f31c688
commit f010aecd40
1 changed files with 6 additions and 9 deletions

View File

@ -192,14 +192,11 @@ class PolyFileFinder(FileFinder):
def install(compiler, suffixes): def install(compiler, suffixes):
if not PolyFileFinder._installed:
native_loaders = machinery._get_supported_file_loaders()
filefinder = [(f, i) for i, f in enumerate(sys.path_hooks) filefinder = [(f, i) for i, f in enumerate(sys.path_hooks)
if repr(f).find('.path_hook_for_FileFinder') != -1] if repr(f).find('.path_hook_for_FileFinder') != -1]
if filefinder: if filefinder:
native_loaders = machinery._get_supported_file_loaders()
filefinder, fpos = filefinder[0] filefinder, fpos = filefinder[0]
sys.path_hooks[fpos] = PolyFileFinder.path_hook(*native_loaders) sys.path_hooks[fpos] = PolyFileFinder.path_hook(*native_loaders)
else:
sys.path_hooks.extend([PolyFileFinder.path_hook(*native_loaders)
PolyFileFinder._installed = True
PolyFileFinder._install(compiler, suffixes) PolyFileFinder._install(compiler, suffixes)