Skip to content

Commit 32e212e

Browse files
Apply suggestions from code review
Co-authored-by: Alex Waygood <[email protected]>
1 parent 19777d6 commit 32e212e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/ntpath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,13 @@ def commonpath(paths):
840840
drivesplits = [splitroot(p.replace(altsep, sep).lower()) for p in paths]
841841
split_paths = [p.split(sep) for d, r, p in drivesplits]
842842

843-
if len(set(r for d, r, p in drivesplits)) != 1:
843+
if len({r for d, r, p in drivesplits}) != 1:
844844
raise ValueError("Can't mix absolute and relative paths")
845845

846846
# Check that all drive letters or UNC paths match. The check is made only
847847
# now otherwise type errors for mixing strings and bytes would not be
848848
# caught.
849-
if len(set(d for d, r, p in drivesplits)) != 1:
849+
if len({d for d, r, p in drivesplits}) != 1:
850850
raise ValueError("Paths don't have the same drive")
851851

852852
drive, root, path = splitroot(paths[0].replace(altsep, sep))

0 commit comments

Comments
 (0)