Skip to content

Commit

Permalink
don't set check_pickle on new joblib on python2.7 (#12645)
Browse files Browse the repository at this point in the history
  • Loading branch information
amueller committed Dec 17, 2018
1 parent 3794afa commit 4a4a73e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sklearn/neighbors/base.py
Expand Up @@ -439,11 +439,12 @@ class from an array representing our data set and ask who's
raise ValueError(
"%s does not work with sparse matrices. Densify the data, "
"or set algorithm='brute'" % self._fit_method)
if (sys.version_info < (3,) or
LooseVersion(joblib_version) < LooseVersion('0.12')):
old_joblib = LooseVersion(joblib_version) < LooseVersion('0.12')
if sys.version_info < (3,) or old_joblib:
# Deal with change of API in joblib
check_pickle = False if old_joblib else None
delayed_query = delayed(_tree_query_parallel_helper,
check_pickle=False)
check_pickle=check_pickle)
parallel_kwargs = {"backend": "threading"}
else:
delayed_query = delayed(_tree_query_parallel_helper)
Expand Down

0 comments on commit 4a4a73e

Please sign in to comment.