Skip to content

Commit

Permalink
bpo-39481: fix test_genericalias on Android (GH-19469)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chih-Hsuan Yen authored Apr 13, 2020
1 parent 0c13e1f commit 25a6833
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lib/test/test_genericalias.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
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
Expand Down Expand Up @@ -71,6 +75,8 @@ def test_subscriptable(self):
Future, _WorkItem,
Morsel,
):
if t is None:
continue
tname = t.__name__
with self.subTest(f"Testing {tname}"):
alias = t[int]
Expand Down

0 comments on commit 25a6833

Please sign in to comment.