diff options
author | Sebastian Ramacher <sebastian+dev@ramacher.at> | 2013-10-17 19:56:11 +0200 |
---|---|---|
committer | Sebastian Ramacher <sebastian+dev@ramacher.at> | 2013-10-17 19:56:11 +0200 |
commit | 845055208d8f5fa153faf646f18876c4a1b9cc84 (patch) | |
tree | 870cabd364eeaae00100d81d7ece0e1f4538f9ef | |
parent | 7fd528d03b5eae58eef6fd219af5d9ac9c83fa50 (diff) | |
download | pycrypto-845055208d8f5fa153faf646f18876c4a1b9cc84.tar.gz |
On platforms that do not have a working sem_open implementation, importing
multiprocessing.synchronize will fail with an ImportError. While creating a
multiprocessing.Pool instance, multiprocessing.synchronize will be imported and
might throw an ImportError.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
-rw-r--r-- | lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py b/lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py index 771a663..3fd7ad4 100644 --- a/lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py +++ b/lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py @@ -39,6 +39,11 @@ from Crypto.Util.py3compat import * try: import multiprocessing + # multiprocessing.Pool uses classes from multiprocessing.synchronize, so we + # need to check if multiprocessing.semaphore will work. Otherwise creating a + # multiprocessing.Pool instance will fail with an ImportError. See Python + # bug #3770 for details. + import multiprocessing.synchronize except ImportError: multiprocessing = None |