]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)
authorSaiyang Gou <gousaiyang@163.com>
Fri, 9 Oct 2020 20:00:15 +0000 (13:00 -0700)
committerGitHub <noreply@github.com>
Fri, 9 Oct 2020 20:00:15 +0000 (13:00 -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
Lib/test/test_genericalias.py

index 643fffc073e82f3e2524d64c59f58bd2469848c8..2979cfb55083cb43e3d4886bd0ca677a9b7cf74f 100644 (file)
@@ -29,7 +29,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
@@ -81,7 +81,7 @@ class BaseTest(unittest.TestCase):
                  SplitResult, ParseResult,
                  ValueProxy, ApplyResult,
                  WeakSet, ReferenceType, ref,
-                 ShareableList, SimpleQueue,
+                 ShareableList, MPSimpleQueue,
                  Future, _WorkItem,
                  Morsel]
         if ctypes is not None: