8000 BUG: update joblib to 0.7.0b · ludgate/scikit-learn@e0b7a22 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit e0b7a22

Browse files
committed
BUG: update joblib to 0.7.0b
Fixes a bug under Windows in the recursive parallel detection
1 parent 926858e commit e0b7a22

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

sklearn/externals/joblib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
103103
"""
104104

105-
__version__ = '0.7.0a'
105+
__version__ = '0.7.0b'
106106

107107

108108
from .memory import Memory

sklearn/externals/joblib/parallel.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@
2828
except ImportError:
2929
multiprocessing = None
3030

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-
)
4131

4232
# 2nd stage: validate that locking is available on the system and
4333
# issue a warning if not
@@ -482,6 +472,17 @@ def __call__(self, iterable):
482472
'Parallel loops cannot be nested, setting n_jobs=1',
483473
stacklevel=2)
484474
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+
485486
# Set an environment variable to avoid infinite loops
486487
os.environ['__JOBLIB_SPAWNED_PARALLEL__'] = '1'
487488
self._pool = multiprocessing.Pool(n_jobs)

0 commit comments

Comments
 (0)
0