summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hsuan Yen <yan12125@gmail.com>2020-04-13 22:00:16 (GMT)
committerGitHub <noreply@github.com>2020-04-13 22:00:16 (GMT)
commit25a6833f7945f14cad83509ec73954d0ad70bdb1 (patch)
tree62c09af8acb25bd7cd4d94709c38775314b18a3e
parent0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac (diff)
downloadcpython-25a6833f7945f14cad83509ec73954d0ad70bdb1.zip
cpython-25a6833f7945f14cad83509ec73954d0ad70bdb1.tar.gz
cpython-25a6833f7945f14cad83509ec73954d0ad70bdb1.tar.bz2
bpo-39481: fix test_genericalias on Android (GH-19469)
Android bionic does not implement shm_open/shm_unlink [1]. As a result _posixshmem extension does not exist and multiprocessing.shared_memory cannot be imported. [1] https://android.googlesource.com/platform/bionic/+/master/docs/status.md
-rw-r--r--Lib/test/test_genericalias.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py
index a00899f..02b7283 100644
--- a/Lib/test/test_genericalias.py
+++ b/Lib/test/test_genericalias.py
@@ -19,7 +19,11 @@ from itertools import chain
from http.cookies import Morsel
from multiprocessing.managers import ValueProxy
from multiprocessing.pool import ApplyResult
-from multiprocessing.shared_memory import ShareableList
+try:
+ from multiprocessing.shared_memory import ShareableList
+except ImportError:
+ # multiprocessing.shared_memory is not available on e.g. Android
+ ShareableList = None
from multiprocessing.queues import SimpleQueue
from os import DirEntry
from re import Pattern, Match
@@ -71,6 +75,8 @@ class BaseTest(unittest.TestCase):
Future, _WorkItem,
Morsel,
):
+ if t is None:
+ continue
tname = t.__name__
with self.subTest(f"Testing {tname}"):
alias = t[int]