[3.8] bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) by miss-islington · Pull Request #18787 · python/cpython
…afety. (pythonGH-18786) `list(sys.modules.items())` was apparently not immune to "dictionary changed size during iteration" errors. Tested internally using an integration test that has run into this a couple of times in the past two years. With this patch applied, the test is no longer flaky. (cherry picked from commit 85cf1d5) Co-authored-by: Gregory P. Smith <gps@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters