Replace private lock with global importer lock.

pull/35/head
David Wilson 9 years ago
parent f88b0a11e9
commit e422dedab8

@ -146,7 +146,6 @@ class Importer(object):
""" """
def __init__(self, context): def __init__(self, context):
self._context = context self._context = context
self._lock = threading.RLock()
self._present = {'econtext': ['econtext.utils', 'econtext.master']} self._present = {'econtext': ['econtext.utils', 'econtext.master']}
self._ignore = [] self._ignore = []
@ -160,7 +159,7 @@ class Importer(object):
LOG.debug('%r: master doesn\'t know %r', self, fullname) LOG.debug('%r: master doesn\'t know %r', self, fullname)
return None return None
self._lock.acquire() imp.acquire_lock()
try: try:
self._ignore.append(fullname) self._ignore.append(fullname)
try: try:
@ -170,7 +169,7 @@ class Importer(object):
return self return self
finally: finally:
self._ignore.pop() self._ignore.pop()
self._lock.release() imp.release_lock()
def load_module(self, fullname): def load_module(self, fullname):
LOG.debug('Importer.load_module(%r)', fullname) LOG.debug('Importer.load_module(%r)', fullname)

Loading…
Cancel
Save