Skip to content

Commit bf499a2

Browse files
authored
Make module name logic more resilient in _always_use_pickle_for (#9086)
1 parent aea5c50 commit bf499a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

distributed/protocol/pickle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def reducer_override(self, obj):
2929

3030

3131
def _always_use_pickle_for(x):
32-
mod, _, _ = x.__class__.__module__.partition(".")
32+
try:
33+
mod, _, _ = x.__class__.__module__.partition(".")
34+
except Exception:
35+
return False
3336
if mod == "numpy":
3437
import numpy as np
3538

0 commit comments

Comments
 (0)