From e422dedab856e162223f6806db8ea5c766a3084a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 14 Aug 2016 17:54:07 +0100 Subject: [PATCH] Replace private lock with global importer lock. --- econtext/core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/econtext/core.py b/econtext/core.py index 3a7371f7..425b4e7e 100644 --- a/econtext/core.py +++ b/econtext/core.py @@ -146,7 +146,6 @@ class Importer(object): """ def __init__(self, context): self._context = context - self._lock = threading.RLock() self._present = {'econtext': ['econtext.utils', 'econtext.master']} self._ignore = [] @@ -160,7 +159,7 @@ class Importer(object): LOG.debug('%r: master doesn\'t know %r', self, fullname) return None - self._lock.acquire() + imp.acquire_lock() try: self._ignore.append(fullname) try: @@ -170,7 +169,7 @@ class Importer(object): return self finally: self._ignore.pop() - self._lock.release() + imp.release_lock() def load_module(self, fullname): LOG.debug('Importer.load_module(%r)', fullname)