File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import sys
1010import time
1111import traceback
12- import types
1312import warnings
1413from contextlib import suppress
1514
@@ -497,17 +496,16 @@ def goal(_):
497496 return False
498497
499498 if executor is None :
500- if isinstance (learner .function , types .LambdaType ):
501- raise ValueError (
502- "A lambda function cannot be pickled and "
503- "therefore doesn't work with the default executor."
504- "Either do not use a lamdba or use a framework that"
505- " allows this, e.g. `ipyparallel` with `dill`."
506- )
507499 try :
508500 pickle .dumps (learner .function )
509501 except pickle .PicklingError :
510- raise ValueError ("`learner.function` needs to be pickleble." )
502+ raise ValueError (
503+ "`learner.function` cannot be pickled (is it a lamdba function?)"
504+ " and therefore does not work with the default executor."
505+ " Either make sure the function is pickleble or use an executor"
506+ " that might work with 'hard to pickle'-functions"
507+ " , e.g. `ipyparallel` with `dill`."
508+ )
511509
512510 super ().__init__ (
513511 learner ,
You can’t perform that action at this time.
0 commit comments