Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c40569

Browse files
committed
Move vcruntime to main folder
Remove vcruntime from the main folder, and remove vcruntime from the DLLs subfolder. I tried using the existing apparatus, but matching a substring from the exlusion list to the src string does not work as expected, possibly because of the difference in directories, so I have flipped the substring matching to look for vcruntime within the src. It doesn't look as nice, but it produces the correct result.
1 parent 9df584a commit 0c40569

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

PC/layout/main.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
TCLTK_DIRS_ONLY = FileNameSet("tkinter", "turtledemo")
3737
TCLTK_FILES_ONLY = FileNameSet("turtle.py")
3838

39-
EXCLUDE_FROM_PYDS = FileStemSet("python*", "pyshellext")
39+
EXCLUDE_FROM_PYDS = FileStemSet("python*", "pyshellext", "vcruntime*")
4040
EXCLUDE_FROM_LIB = FileNameSet("*.pyc", "__pycache__", "*.pickle")
4141
EXCLUDE_FROM_PACKAGED_LIB = FileNameSet("readme.txt")
4242
EXCLUDE_FROM_COMPILE = FileNameSet("badsyntax_*", "bad_*")
@@ -142,6 +142,14 @@ def in_build(f, dest="", new_name=None):
142142
for item in in_build(PYTHON_DLL_NAME):
143143
yield item
144144

145+
# Explicitly move vcruntime.dlls to the Main directory so they are available at startup
146+
found_any = False
147+
for dest, src in rglob(ns.build, "vcruntime*.dll"):
148+
found_any = True
149+
yield dest, src
150+
if not found_any:
151+
log_error("Failed to locate vcruntime DLL in the build.")
152+
145153
yield "LICENSE", "LICENSE"
146154

147155
for dest, src in rglob(ns.build, ("*.pyd", "*.dll")):
@@ -153,7 +161,9 @@ def in_build(f, dest="", new_name=None):
153161
continue
154162
if src in TCLTK_PYDS_ONLY and not ns.include_tcltk:
155163
continue
156-
164+
# Explicitly remove files containing vcruntime from the DLLs subdirectory.
165+
if "vcruntime" in src:
166+
continue
157167
for item in in_build(os.path.basename(src), dest="" if ns.flat_dlls else "DLLs/"):
158168
yield item
159169

0 commit comments

Comments
 (0)