Skip to content

Commit

Permalink
fix DebugWipeLoader being used for zipimporter
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/zstrong#664

Need to insure DebugWipeLoader doesn't get used for zipimporter files.  The original imp.find_module that I replaced did not support zipimporter the new importlib find_spec does find the them.

Reviewed By: itamaro

Differential Revision: D52556833

fbshipit-source-id: bf5892a950a965bb3b17ab951910db2e33b69a34
  • Loading branch information
fried authored and facebook-github-bot committed Jan 5, 2024
1 parent 13ca7ca commit c5efd1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/fbcode_builder/CMake/fb_py_test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def get_code(self, fullname):
code_impl.ob_size = 0
return code

spec.loader = DebugWipeLoader(fullname, spec.origin)
if isinstance(spec.loader, SourceFileLoader):
spec.loader = DebugWipeLoader(fullname, spec.origin)
return spec


Expand Down

0 comments on commit c5efd1a

Please sign in to comment.