]> granicus.if.org Git - python/commit
bpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 10 Jul 2017 21:16:27 +0000 (23:16 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Jul 2017 21:16:27 +0000 (23:16 +0200)
commitfe6e686c27ce3a3ecdf03803cff7e230dee5530d
treedea6f45e966e1d4a38044da15992a306759b0fa6
parent044e156426825acac8b6c6d1ce14d5b7bcb20bc9
bpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)

* 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 4f9a446f3fb42f800e73cd9414dd1eccb3ca4fa7)
Lib/importlib/_bootstrap.py
Python/import.c
Python/importlib.h