]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619...
authorSaiyang Gou <gousaiyang@163.com>
Mon, 12 Oct 2020 23:52:03 +0000 (16:52 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Oct 2020 23:52:03 +0000 (16:52 -0700)
There are two different `SimpleQueue` types imported (from `multiprocessing.queues` and `queue`) in `Lib/test/test_genericalias.py`, the second one shadowing the first one, making the first one not actually tested. Fix by using different names.

Automerge-Triggered-By: @gvanrossum.
(cherry picked from commit b2c0a43699bd9023a69e3fa554f5488a2e17e278)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
Lib/test/test_genericalias.py

index ec1acd475ce5a2a8d120b2780d1c090e11d6e53f..240aad02518ff6c6ad81d64cdc0fc5103bf24160 100644 (file)
@@ -26,7 +26,7 @@ try:
 except ImportError:
     # multiprocessing.shared_memory is not available on e.g. Android
     ShareableList = None
-from multiprocessing.queues import SimpleQueue
+from multiprocessing.queues import SimpleQueue as MPSimpleQueue
 from os import DirEntry
 from re import Pattern, Match
 from types import GenericAlias, MappingProxyType, AsyncGeneratorType
@@ -79,7 +79,7 @@ class BaseTest(unittest.TestCase):
                   SplitResult, ParseResult,
                   ValueProxy, ApplyResult,
                   WeakSet, ReferenceType, ref,
-                  ShareableList, SimpleQueue,
+                  ShareableList, MPSimpleQueue,
                   Future, _WorkItem,
                   Morsel,
                   ):