]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034)
authorZackery Spytz <zspytz@gmail.com>
Mon, 9 Aug 2021 16:44:55 +0000 (09:44 -0700)
committerGitHub <noreply@github.com>
Mon, 9 Aug 2021 16:44:55 +0000 (18:44 +0200)
This was causing test___all__ to fail on platforms lacking a shared
memory implementation.

Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/multiprocessing/managers.py
Misc/NEWS.d/next/Library/2020-01-16-23-41-16.bpo-38840.VzzYZz.rst [new file with mode: 0644]

index 9c7e92faec942713b3d7ffad430353cdb40f9599..cf637c6cbbe8d145e1c5551796d99073360968d4 100644 (file)
@@ -8,8 +8,7 @@
 # Licensed to PSF under a Contributor Agreement.
 #
 
-__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
-            'SharedMemoryManager' ]
+__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
 
 #
 # Imports
@@ -35,9 +34,11 @@ from . import util
 from . import get_context
 try:
     from . import shared_memory
-    HAS_SHMEM = True
 except ImportError:
     HAS_SHMEM = False
+else:
+    HAS_SHMEM = True
+    __all__.append('SharedMemoryManager')
 
 #
 # Register some things for pickling
diff --git a/Misc/NEWS.d/next/Library/2020-01-16-23-41-16.bpo-38840.VzzYZz.rst b/Misc/NEWS.d/next/Library/2020-01-16-23-41-16.bpo-38840.VzzYZz.rst
new file mode 100644 (file)
index 0000000..727f62b
--- /dev/null
@@ -0,0 +1 @@
+Fix ``test___all__`` on platforms lacking a shared memory implementation.