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

Commitb848b94

Browse files
authored
gh-117641: Improve the perfornance of posixpath.commonpath() (#117652)
1 parent6078f20 commitb848b94

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎Lib/posixpath.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def commonpath(paths):
550550
split_paths= [path.split(sep)forpathinpaths]
551551

552552
try:
553-
isabs,=set(p[:1]==sepforpinpaths)
553+
isabs,={p.startswith(sep)forpinpaths}
554554
exceptValueError:
555555
raiseValueError("Can't mix absolute and relative paths")fromNone
556556

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Speedup:func:`os.path.commonpath` on Unix.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp