File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 102
102
103
103
"""
104
104
105
- __version__ = '0.7.0a '
105
+ __version__ = '0.7.0b '
106
106
107
107
108
108
from .memory import Memory
Original file line number Diff line number Diff line change 28
28
except ImportError :
29
29
multiprocessing = None
30
30
31
- already_forked = int (os .environ .get ('__JOBLIB_SPAWNED_PARALLEL__' , 0 ))
32
- if already_forked :
33
- raise ImportError ('[joblib] Attempting to do parallel computing'
34
- 'without protecting your import on a system that does '
35
- 'not support forking. To use parallel-computing in a '
36
- 'script, you must protect you main loop using "if '
37
- "__name__ == '__main__'"
38
- '". Please see the joblib documentation on Parallel '
39
- 'for more information'
40
- )
41
31
42
32
# 2nd stage: validate that locking is available on the system and
43
33
# issue a warning if not
@@ -482,6 +472,17 @@ def __call__(self, iterable):
482
472
'Parallel loops cannot be nested, setting n_jobs=1' ,
483
473
stacklevel = 2 )
484
474
else :
475
+ already_forked = int (os .environ .get ('__JOBLIB_SPAWNED_PARALLEL__' , 0 ))
476
+ if already_forked :
477
+ raise ImportError ('[joblib] Attempting to do parallel computing'
478
+ 'without protecting your import on a system that does '
479
+ 'not support forking. To use parallel-computing in a '
480
+ 'script, you must protect you main loop using "if '
481
+ "__name__ == '__main__'"
482
+ '". Please see the joblib documentation on Parallel '
483
+ 'for more information'
484
+ )
485
+
485
486
# Set an environment variable to avoid infinite loops
486
487
os .environ ['__JOBLIB_SPAWNED_PARALLEL__' ] = '1'
487
488
self ._pool = multiprocessing .Pool (n_jobs )
You can’t perform that action at this time.
0 commit comments