diff --git a/build/fbcode_builder/CMake/fb_py_test_main.py b/build/fbcode_builder/CMake/fb_py_test_main.py index 7ab73a2d7..a5b96c408 100644 --- a/build/fbcode_builder/CMake/fb_py_test_main.py +++ b/build/fbcode_builder/CMake/fb_py_test_main.py @@ -97,11 +97,11 @@ def find_module(self, fullname, path=None): try: fd, pypath, (_, _, kind) = imp.find_module(basename, path) except Exception: - # Maybe it's a top level module - try: - fd, pypath, (_, _, kind) = imp.find_module(basename, None) - except Exception: - return None + # Finding without hooks using the imp module failed. One reason + # could be that there is a zip file on sys.path. The imp module + # does not support loading from there. Leave finding this module to + # the others finders in sys.meta_path. + return None if hasattr(fd, "close"): fd.close()