Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0b2668d

Browse filesBrowse files
i-shenlmiss-islington
authored andcommitted
pythongh-118876: Ensure PC/layout sets ns.temp before using it (pythonGH-118880)
Fixes an AttributeError that occurs when checking if ns.temp is an absolute path during building from source on Windows. (cherry picked from commit d8a82cc) Co-authored-by: I-Shen Leong <i-shenl@activestate.com>
1 parent ce3fdf7 commit 0b2668d
Copy full SHA for 0b2668d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed

‎PC/layout/main.py

Copy file name to clipboardExpand all lines: PC/layout/main.py
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,15 @@ def main():
575575
ns.build = ns.build or Path(sys.executable).parent
576576
ns.temp = ns.temp or Path(tempfile.mkdtemp())
577577
ns.doc_build = ns.doc_build or (ns.source / "Doc" / "build")
578+
if ns.copy and not ns.copy.is_absolute():
579+
ns.copy = (Path.cwd() / ns.copy).resolve()
580+
if not ns.temp:
581+
# Put temp on a Dev Drive for speed if we're copying to one.
582+
# If not, the regular temp dir will have to do.
583+
if ns.copy and getattr(os.path, "isdevdrive", lambda d: False)(ns.copy):
584+
ns.temp = ns.copy.with_name(ns.copy.name + "_temp")
585+
else:
586+
ns.temp = Path(tempfile.mkdtemp())
578587
if not ns.source.is_absolute():
579588
ns.source = (Path.cwd() / ns.source).resolve()
580589
if not ns.build.is_absolute():
@@ -588,8 +597,6 @@ def main():
588597
if not ns.arch:
589598
ns.arch = "amd64" if sys.maxsize > 2 ** 32 else "win32"
590599

591-
if ns.copy and not ns.copy.is_absolute():
592-
ns.copy = (Path.cwd() / ns.copy).resolve()
593600
if ns.zip and not ns.zip.is_absolute():
594601
ns.zip = (Path.cwd() / ns.zip).resolve()
595602
if ns.catalog and not ns.catalog.is_absolute():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.