diff --git a/tools/fail_if_no_c.py b/tools/fail_if_no_c.py index e2e9c5252..60fed0ee8 100644 --- a/tools/fail_if_no_c.py +++ b/tools/fail_if_no_c.py @@ -32,10 +32,11 @@ if not pymongo.has_c() or not bson.has_c(): if os.environ.get("ENSURE_UNIVERSAL2") == "1": parent_dir = os.path.dirname(pymongo.__path__[0]) - for so_file in glob.glob(f"{parent_dir}/**/*.so"): - print(f"Checking universal2 compatibility in {so_file}...") - output = subprocess.check_output(["file", so_file]) - if "arm64" not in output.decode("utf-8"): - sys.exit("Universal wheel was not compiled with arm64 support") - if "x86_64" not in output.decode("utf-8"): - sys.exit("Universal wheel was not compiled with x86_64 support") + for pkg in ["pymongo", "bson", "grifs"]: + for so_file in glob.glob(f"{parent_dir}/{pkg}/*.so"): + print(f"Checking universal2 compatibility in {so_file}...") + output = subprocess.check_output(["file", so_file]) + if "arm64" not in output.decode("utf-8"): + sys.exit("Universal wheel was not compiled with arm64 support") + if "x86_64" not in output.decode("utf-8"): + sys.exit("Universal wheel was not compiled with x86_64 support")