Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search sys.path when checking if module is builtin / binary #283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dill/_dill.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ def save_module(pickler, obj):
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 any(obj.__file__.startswith(os.path.normpath(ppath)) for ppath in sys.path)
else:
builtin_mod = True
if obj.__name__ not in ("builtins", "dill") \
Expand Down