diff options
author | Jesse Noller <jnoller@gmail.com> | 2008-09-30 00:15:45 (GMT) |
---|---|---|
committer | Jesse Noller <jnoller@gmail.com> | 2008-09-30 00:15:45 (GMT) |
commit | 37040cdace1982772e5f35e4acfa13861d72065d (patch) | |
tree | 07b4887aaac30870277beb6afe45a1e5652ed539 /Lib/multiprocessing | |
parent | e563aa4383df36cefe5c85c2a85b9008f54df048 (diff) | |
download | cpython-37040cdace1982772e5f35e4acfa13861d72065d.zip cpython-37040cdace1982772e5f35e4acfa13861d72065d.tar.gz cpython-37040cdace1982772e5f35e4acfa13861d72065d.tar.bz2 |
issue3770: if SEM_OPEN is 0, disable the mp.synchronize module, rev. Nick Coghlan, Damien Miller
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/synchronize.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 428656a..dacf45a 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -21,6 +21,17 @@ from multiprocessing.process import current_process from multiprocessing.util import Finalize, register_after_fork, debug from multiprocessing.forking import assert_spawning, Popen +# Try to import the mp.synchronize module cleanly, if it fails +# raise ImportError for platforms lacking a working sem_open implementation. +# See issue 3770 +try: + from _multiprocessing import SemLock +except (ImportError): + raise ImportError("This platform lacks a functioning sem_open" + + " implementation, therefore, the required" + + " synchronization primitives needed will not" + + " function, see issue 3770.") + # # Constants # |