[Python-checkins] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)

Saiyang Gou webhook-mailer at python.org
Fri Oct 9 16:00:29 EDT 2020


https://github.com/python/cpython/commit/b2c0a43699bd9023a69e3fa554f5488a2e17e278
commit: b2c0a43699bd9023a69e3fa554f5488a2e17e278
branch: master
author: Saiyang Gou <gousaiyang at 163.com>
committer: GitHub <noreply at github.com>
date: 2020-10-09T13:00:15-07:00
summary:

bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)



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

files:
M Lib/test/test_genericalias.py

diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py
index 643fffc073e82..2979cfb55083c 100644
--- a/Lib/test/test_genericalias.py
+++ b/Lib/test/test_genericalias.py
@@ -29,7 +29,7 @@
 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 @@ def test_subscriptable(self):
                  SplitResult, ParseResult,
                  ValueProxy, ApplyResult,
                  WeakSet, ReferenceType, ref,
-                 ShareableList, SimpleQueue,
+                 ShareableList, MPSimpleQueue,
                  Future, _WorkItem,
                  Morsel]
         if ctypes is not None:



More information about the Python-checkins mailing list