Skip to content

Commit a44020f

Browse files
jshenguruMaxwell175
andcommitted
Exclude pip temp folder before searching libs (#8)
* exclude pip temp folder before searching libs pip install adds temporary folders into sys.path which introduces redundant and to-be-removed libs into link.json * Add comment --------- Co-authored-by: Maxwell175 <[email protected]>
1 parent 4b482ae commit a44020f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/rebuildpython.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def run_rebuild():
101101

102102
# Scan sys.path for any more lingering static libs.
103103
for path in list(reversed(sys.path)) + extra_scan_dirs:
104-
# Ignore the working directory so we don't grab duplicate stuff.
105-
if path == os.getcwd() or installDir == path or path in installDir:
104+
# Ignore the working directory so we don't grab duplicate stuff. Also ignore the pip temp path that is
105+
# injected during a pip install.
106+
if path == os.getcwd() or installDir == path or path in installDir or "pip-install-" in path:
106107
continue
107108
for file in find_files(
108109
path, "*.lib" if platform.system() == "Windows" else "*.a"

0 commit comments

Comments
 (0)