-
-
Notifications
You must be signed in to change notification settings - Fork 190
Open
Description
dill.dumps tries to detect if the object is from a builtin (or an installed package?) by looking for 'site-packages' in module path (
Line 1268 in a2e2a59
| builtin_mod = builtin_mod or 'site-packages' in obj.__file__ |
diff --git a/dill/_dill.py b/dill/_dill.py
index d52c486..13c6258 100644
--- a/dill/_dill.py
+++ b/dill/_dill.py
@@ -1247,7 +1247,7 @@ def save_module(pickler, obj):
"prefix", "real_prefix"]
builtin_mod = any([obj.__file__.startswith(os.path.normpath(getattr(sys, name)))
for name in names if hasattr(sys, name)])
- builtin_mod = builtin_mod or 'site-packages' in obj.__file__
+ builtin_mod = builtin_mod or 'pypi__' in obj.__file__ or 'site-packages' in obj.__file__
else:
builtin_mod = True
if obj.__name__ not in ("builtins", "dill") \Is it possible to not depend on the module path here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels