Fix imp lock bug

This commit is contained in:
Oleksii Shevchuk 2018-02-10 18:17:57 +02:00
parent 90592f4164
commit bced04d76a
1 changed files with 12 additions and 3 deletions

View File

@ -408,15 +408,17 @@ class PupyPackageFinder(object):
raise PupyPackageFinderImportError()
def find_module(self, fullname, path=None, second_pass=False):
if fullname.startswith('exposed_'):
return None
global modules
global remote_load_package
dprint('Find module: {}/{}/{}'.format(fullname, path, second_pass))
imp.acquire_lock()
selected = None
if fullname.startswith('exposed_'):
return None
try:
files=[]
if fullname in ( 'pywintypes', 'pythoncom' ):
@ -594,9 +596,14 @@ def install(debug=None, trace=False):
gc.set_threshold(128)
if allow_system_packages:
dprint('Install pupyimporter + local packages')
sys.path_hooks.append(PupyPackageFinder)
sys.path.append('pupy://')
else:
dprint('Install pupyimporter - standalone')
sys.meta_path = []
sys.path = []
sys.path_hooks = []
@ -709,3 +716,5 @@ def install(debug=None, trace=False):
import logging
logger = logging.getLogger('ppi')
__dprint_method = logger.debug
dprint('pupyimporter initialized')