Skip to content

Commit

Permalink
Fixed bug that crashed dill when a module has its __file__ attribute …
Browse files Browse the repository at this point in the history
…set to None (#598)
  • Loading branch information
miguelinux314 authored Jun 7, 2023
1 parent f7a2282 commit 4f3fe3d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dill/_dill.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ def save_weakproxy(pickler, obj):

def _is_builtin_module(module):
if not hasattr(module, "__file__"): return True
if module.__file__ is None: return False
# If a module file name starts with prefix, it should be a builtin
# module, so should always be pickled as a reference.
names = ["base_prefix", "base_exec_prefix", "exec_prefix", "prefix", "real_prefix"]
Expand Down

0 comments on commit 4f3fe3d

Please sign in to comment.