summaryrefslogtreecommitdiff
path: root/morphlib/util.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-15 14:29:53 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-15 14:29:53 +0000
commitb4078d8bb5babfe0166cb2a1336f9eb5237f5375 (patch)
treed92f305a0a16dc8b41bf356d00ee9c470cae7090 /morphlib/util.py
parentd0a2b3bf659d03b4eb2cc6cc62c5ea0f713eaf0f (diff)
downloadmorph-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.py5
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