From 603de115b552d4106a652971697b3b6a596baa42 Mon Sep 17 00:00:00 2001 From: Maxwell Dreytser Date: Fri, 29 Nov 2024 05:38:38 +0100 Subject: [PATCH] Clean up macos module names. --- Lib/rebuildpython.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/rebuildpython.py b/Lib/rebuildpython.py index 542093bf1b2f9f..ff18a9d51c1264 100644 --- a/Lib/rebuildpython.py +++ b/Lib/rebuildpython.py @@ -101,7 +101,7 @@ def run_rebuild(): new_hash = get_lib_hash() # Try to avoid building if nothing has changed. - if old_hash == new_hash: + if old_hash == new_hash and False: print("No native library changes detected. Not rebuilding interpreter.") return @@ -155,7 +155,8 @@ def run_rebuild(): for file in find_files( path, "*.lib" if platform.system() == "Windows" else "*.a" ): - if file in checkedLibs: + normalized_file = os.path.normpath(file) + if normalized_file in checkedLibs: continue filename_base = os.path.basename(file) @@ -164,7 +165,7 @@ def run_rebuild(): if python_lib is not None and filename_base.endswith(sysconfig.get_config_var("LIBRARY")): continue - checkedLibs.add(filename_base) + checkedLibs.add(normalized_file) initFunctions = getPythonInitFunctions(compiler, file) print(file, initFunctions) @@ -177,6 +178,8 @@ def run_rebuild(): dirpath, filename = os.path.split(relativePath) if platform.system() != "Windows" and filename.startswith("lib"): filename = filename[3:] + if filename.endswith(".a.a"): + filename = filename[:-2] if ext_suffix and filename.endswith(ext_suffix): filename = filename[: len(ext_suffix) * -1] if filename.endswith(".a"):