Xavier de Gaye <xdeg...@gmail.com> added the comment:
After changeset e895de3e7f3cc2f7213b87621cfe9812ea4343f0, test_all fails on platforms that lack the _posixshmem extension module (Android for example): ====================================================================== FAIL: test_all (test.test___all__.AllTest) (module='multiprocessing.managers') ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/local/tmp/python/lib/python3.8/test/test___all__.py", line 34, in check_all exec("from %s import *" % modname, names) AttributeError: module 'multiprocessing.managers' has no attribute 'SharedMemoryManager' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/local/tmp/python/lib/python3.8/test/test___all__.py", line 37, in check_all self.fail("__all__ failure in {}: {}: {}".format( AssertionError: __all__ failure in multiprocessing.managers: AttributeError: module 'multiprocessing.managers' has no attribute 'SharedMemoryManager' The following patch fixes the problem: diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 7973012b98..3fdd60fff7 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -8,8 +8,7 @@ # Licensed to PSF under a Contributor Agreement. # -__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token', - 'SharedMemoryManager' ] +__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports @@ -33,6 +32,7 @@ from . import get_context try: from . import shared_memory HAS_SHMEM = True + __all__.append('SharedMemoryManager') except ImportError: HAS_SHMEM = False ---------- nosy: +xdegaye _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35813> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com