Skip to content

Commit 6864aab

Browse files
committed
_build_tlz: Ignore missing __file__
Many Python freezer tools have loaders that either do not set __file__ or they set __file__ with a guess, or it triggers a slower load process.
1 parent 2894552 commit 6864aab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tlz/_build_tlz.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def exec_module(self, module):
6363
module.__doc__ = fast_mod.__doc__
6464

6565
# show file from toolz during introspection
66-
module.__file__ = slow_mod.__file__
66+
try:
67+
module.__file__ = slow_mod.__file__
68+
except AttributeError:
69+
pass
6770

6871
for k, v in fast_mod.__dict__.items():
6972
tv = slow_mod.__dict__.get(k)

0 commit comments

Comments
 (0)