diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-15 14:29:53 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-15 14:29:53 +0000 |
commit | b4078d8bb5babfe0166cb2a1336f9eb5237f5375 (patch) | |
tree | d92f305a0a16dc8b41bf356d00ee9c470cae7090 /morphlib/util.py | |
parent | d0a2b3bf659d03b4eb2cc6cc62c5ea0f713eaf0f (diff) | |
download | morph-b4078d8bb5babfe0166cb2a1336f9eb5237f5375.tar.gz |
Handle non-functional multiprocessing
This can happen when we run morph in a chroot without /dev/urandom
Diffstat (limited to 'morphlib/util.py')
-rw-r--r-- | morphlib/util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/morphlib/util.py b/morphlib/util.py index 007ba587..3ac5e066 100644 --- a/morphlib/util.py +++ b/morphlib/util.py @@ -17,7 +17,10 @@ '''Utility functions for morph.''' -import multiprocessing +try: + from multiprocessing import cpu_count +except NotImplementedError: + cpu_count = lambda: 1 import os |