bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-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.
G
Gregory P. Smith committed
85cf1d514b84dc9a4bcb40e20a12e1d82ff19f20
Parent: d4a09c1
Committed by GitHub <noreply@github.com>
on 3/5/2020, 12:45:22 AM