From f010aecd4006889072b9debfb8c1b0794908de45 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Sat, 9 Jul 2016 10:51:54 -0700 Subject: [PATCH] Updating. --- polyloader/_python3.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/polyloader/_python3.py b/polyloader/_python3.py index 03e8961..5d05af1 100644 --- a/polyloader/_python3.py +++ b/polyloader/_python3.py @@ -192,14 +192,11 @@ class PolyFileFinder(FileFinder): def install(compiler, suffixes): - if not PolyFileFinder._installed: + filefinder = [(f, i) for i, f in enumerate(sys.path_hooks) + if repr(f).find('.path_hook_for_FileFinder') != -1] + if filefinder: native_loaders = machinery._get_supported_file_loaders() - filefinder = [(f, i) for i, f in enumerate(sys.path_hooks) - if repr(f).find('.path_hook_for_FileFinder') != -1] - if filefinder: - filefinder, fpos = filefinder[0] - sys.path_hooks[fpos] = PolyFileFinder.path_hook(*native_loaders) - else: - sys.path_hooks.extend([PolyFileFinder.path_hook(*native_loaders) - PolyFileFinder._installed = True + filefinder, fpos = filefinder[0] + sys.path_hooks[fpos] = PolyFileFinder.path_hook(*native_loaders) + PolyFileFinder._install(compiler, suffixes)