Skip to content

Commit

Permalink
Switch comparisons to use os.name, not os.path.
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Feb 25, 2023
1 parent a2bc779 commit 1faf7e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ class PosixPath(Path, PurePosixPath):
"""
__slots__ = ()

if posixpath is not os.path:
if os.name == 'nt':
def __new__(cls, *args, **kwargs):
raise NotImplementedError("cannot instantiate %r on your system"
% (cls.__name__,))
Expand All @@ -1266,7 +1266,7 @@ class WindowsPath(Path, PureWindowsPath):
"""
__slots__ = ()

if ntpath is not os.path:
if os.name != 'nt':
def __new__(cls, *args, **kwargs):
raise NotImplementedError("cannot instantiate %r on your system"
% (cls.__name__,))

0 comments on commit 1faf7e4

Please sign in to comment.