Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc5cc28c

Browse files
committed
gh-118876: Set ns.temp before invoking its is_absolute method
Fixes an AttributeError that occurs when checking if ns.temp is an absolute path during building from source on Windows.
1 parent46c8081 commitc5cc28c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎PC/layout/main.py‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,15 @@ def main():
599599
ns.source=ns.sourceor (Path(__file__).resolve().parent.parent.parent)
600600
ns.build=ns.buildorPath(sys.executable).parent
601601
ns.doc_build=ns.doc_buildor (ns.source/"Doc"/"build")
602+
ifns.copyandnotns.copy.is_absolute():
603+
ns.copy= (Path.cwd()/ns.copy).resolve()
604+
ifnotns.temp:
605+
# Put temp on a Dev Drive for speed if we're copying to one.
606+
# If not, the regular temp dir will have to do.
607+
ifns.copyandgetattr(os.path,"isdevdrive",lambdad:False)(ns.copy):
608+
ns.temp=ns.copy.with_name(ns.copy.name+"_temp")
609+
else:
610+
ns.temp=Path(tempfile.mkdtemp())
602611
ifnotns.source.is_absolute():
603612
ns.source= (Path.cwd()/ns.source).resolve()
604613
ifnotns.build.is_absolute():
@@ -617,21 +626,11 @@ def main():
617626
else:
618627
ns.arch="amd64"
619628

620-
ifns.copyandnotns.copy.is_absolute():
621-
ns.copy= (Path.cwd()/ns.copy).resolve()
622629
ifns.zipandnotns.zip.is_absolute():
623630
ns.zip= (Path.cwd()/ns.zip).resolve()
624631
ifns.catalogandnotns.catalog.is_absolute():
625632
ns.catalog= (Path.cwd()/ns.catalog).resolve()
626633

627-
ifnotns.temp:
628-
# Put temp on a Dev Drive for speed if we're copying to one.
629-
# If not, the regular temp dir will have to do.
630-
ifns.copyandgetattr(os.path,"isdevdrive",lambdad:False)(ns.copy):
631-
ns.temp=ns.copy.with_name(ns.copy.name+"_temp")
632-
else:
633-
ns.temp=Path(tempfile.mkdtemp())
634-
635634
configure_logger(ns)
636635

637636
log_info(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp