(obj)
| 1007 | |
| 1008 | |
| 1009 | def _module_reduce(obj): |
| 1010 | if _should_pickle_by_reference(obj): |
| 1011 | return subimport, (obj.__name__,) |
| 1012 | else: |
| 1013 | # Some external libraries can populate the "__builtins__" entry of a |
| 1014 | # module's `__dict__` with unpicklable objects (see #316). For that |
| 1015 | # reason, we do not attempt to pickle the "__builtins__" entry, and |
| 1016 | # restore a default value for it at unpickling time. |
| 1017 | state = obj.__dict__.copy() |
| 1018 | state.pop("__builtins__", None) |
| 1019 | return dynamic_subimport, (obj.__name__, state) |
| 1020 | |
| 1021 | |
| 1022 | def _method_reduce(obj): |
nothing calls this directly
no test coverage detected
searching dependent graphs…