]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-29605)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 18 Nov 2021 16:09:41 +0000 (08:09 -0800)
committerGitHub <noreply@github.com>
Thu, 18 Nov 2021 16:09:41 +0000 (17:09 +0100)
commit71d842b9c1e9d86ede449783e630b7a768b579d6
treed810d2db6dd1ee76c54d009f14b1f5e39303ee4f
parentfeccea6a7eb1309513750bb4a31aee5a65c7c4bf
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-29605)

unittest.TestCase.assertWarns no longer raises a RuntimeException
when accessing a module's ``__warningregistry__`` causes importation of a new
module, or when a new module is imported in another thread.

Patch by Kernc.
(cherry picked from commit 46398fba4d66ad342cf2504ef947b5fb857423b2)

Co-authored-by: kernc <kerncece@gmail.com>
Lib/unittest/case.py
Lib/unittest/test/test_case.py
Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst [new file with mode: 0644]