diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-09-19 16:13:04 -0700 |
---|---|---|
committer | Pablo Galindo <pablogsal@gmail.com> | 2021-09-20 00:32:30 +0100 |
commit | 76611038bc3d2aa643dce45448f5c7044dd4fd06 (patch) | |
tree | 0be78620bc10ff43b1279441df0a1848e43dcf44 /Lib | |
parent | f025ea23210173b42303360aca05132e4ffdfed3 (diff) | |
download | cpython-git-76611038bc3d2aa643dce45448f5c7044dd4fd06.tar.gz |
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)
(cherry picked from commit 1d42408495402b06ecae91420735aeff454be6b5)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_logging.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 5794b75ba3..af841d64e3 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -4421,8 +4421,10 @@ class LogRecordTest(BaseTest): name = mp.current_process().name r1 = logging.makeLogRecord({'msg': f'msg1_{key}'}) - del sys.modules['multiprocessing'] - r2 = logging.makeLogRecord({'msg': f'msg2_{key}'}) + + # https://bugs.python.org/issue45128 + with support.swap_item(sys.modules, 'multiprocessing', None): + r2 = logging.makeLogRecord({'msg': f'msg2_{key}'}) results = {'processName' : name, 'r1.processName': r1.processName, @@ -4471,7 +4473,6 @@ class LogRecordTest(BaseTest): if multiprocessing_imported: import multiprocessing - def test_optional(self): r = logging.makeLogRecord({}) NOT_NONE = self.assertIsNotNone |