Traktor/myenv/Lib/site-packages/joblib/_cloudpickle_wrapper.py

20 lines
417 B
Python
Raw Normal View History

2024-05-23 01:57:24 +02:00
"""
Small shim of loky's cloudpickle_wrapper to avoid failure when
multiprocessing is not available.
"""
from ._multiprocessing_helpers import mp
def _my_wrap_non_picklable_objects(obj, keep_wrapper=True):
return obj
if mp is not None:
from .externals.loky import wrap_non_picklable_objects
else:
wrap_non_picklable_objects = _my_wrap_non_picklable_objects
__all__ = ["wrap_non_picklable_objects"]