bpo-30891: Fix importlib _find_and_load() race condition by vstinner · Pull Request #2646 · python/cpython

vstinner

serhiy-storchaka

serhiy-storchaka

@vstinner

* Rewrite importlib _get_module_lock(): it is now responsible to hold
  the imp lock directly.
* _find_and_load() now holds the module lock to check if name is in
  sys.modules to prevent a race condition

brettcannon

@vstinner vstinner deleted the importlib_module_lock branch

July 10, 2017 20:52

vstinner added a commit that referenced this pull request

Jul 10, 2017
* Rewrite importlib _get_module_lock(): it is now responsible to hold
  the imp lock directly.
* _find_and_load() now holds the module lock to check if name is in
  sys.modules to prevent a race condition
(cherry picked from commit 4f9a446)