[Python-checkins] bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034) (GH-27684)
ambv
webhook-mailer at python.org
Mon Aug 9 13:31:18 EDT 2021
https://github.com/python/cpython/commit/40b353bc079b990cf0d6259a5720fb9729c1b81e
commit: 40b353bc079b990cf0d6259a5720fb9729c1b81e
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-08-09T19:31:10+02:00
summary:
bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034) (GH-27684)
This was causing test___all__ to fail on platforms lacking a shared
memory implementation.
Co-Authored-By: Xavier de Gaye <xdegaye at gmail.com>
Co-authored-by: Łukasz Langa <lukasz at langa.pl>
(cherry picked from commit d0978761118856e8ca8ea7b162a6585b8da83df9)
Co-authored-by: Zackery Spytz <zspytz at gmail.com>
files:
A Misc/NEWS.d/next/Library/2020-01-16-23-41-16.bpo-38840.VzzYZz.rst
M Lib/multiprocessing/managers.py
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index f8d3cef110fa58..dfa566c6fc386f 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
@@ -35,9 +34,11 @@
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
index 00000000000000..727f62b52a710b
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-01-16-23-41-16.bpo-38840.VzzYZz.rst
@@ -0,0 +1 @@
+Fix ``test___all__`` on platforms lacking a shared memory implementation.
More information about the Python-checkins
mailing list