10000 don't set check_pickle on new joblib on python2.7 (#12645) · alexshacked/scikit-learn@55bf5d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55bf5d9

Browse files
amuellerjnothman
authored andcommitted
don't set check_pickle on new joblib on python2.7 (scikit-learn#12645)
1 parent a1b9f3f commit 55bf5d9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/neighbors/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,12 @@ class from an array representing our data set and ask who's
439439
raise ValueError(
440440
"%s does not work with sparse matrices. Densify the data, "
441441
"or set algo 8112 rithm='brute'" % self._fit_method)
442-
if (sys.version_info < (3,) or
443-
LooseVersion(joblib_version) < LooseVersion('0.12')):
442+
old_joblib = LooseVersion(joblib_version) < LooseVersion('0.12')
443+
if sys.version_info < (3,) or old_joblib:
444444
# Deal with change of API in joblib
445+
check_pickle = False if old_joblib else None
445446
delayed_query = delayed(_tree_query_parallel_helper,
446-
check_pickle=False)
447+
check_pickle=check_pickle)
447448
parallel_kwargs = {"backend": "threading"}
448449
else:
449450
delayed_query = delayed(_tree_query_parallel_helper)

0 commit comments

Comments
 (0)
0