Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Speedup ntpath.isabs
  • Loading branch information
nineteendo committed Mar 29, 2024
commit fec0a931f3baa8a876a945d46cb24dceb4631b83
5 changes: 1 addition & 4 deletions Lib/ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ def isabs(s):
double_sep = '\\\\'
s = s[:3].replace(altsep, sep)
# Absolute: UNC, device, and paths with a drive and root.
return (
(s.startswith(colon_sep, 1) and not s.startswith(sep))
or s.startswith(double_sep)
)
return (s[1:3] == colon_sep and s[:1] != sep) or s[:2] == double_sep
Comment thread
nineteendo marked this conversation as resolved.
Outdated


# Join two (or more) paths.
Expand Down