Visitar URL original
GH-101362: Check pathlib.Path flavour compatibility at import time by barneygale · Pull Request #101664 · python/cpython · GitHub
Skip to content
Merged
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
Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
barneygale and AlexWaygood authored Mar 5, 2023
commit 84355edf278a2a19d336ec3b17654dd790de2a39
8 changes: 4 additions & 4 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ class PosixPath(Path, PurePosixPath):

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

class WindowsPath(Path, PureWindowsPath):
"""Path subclass for Windows systems.
Expand All @@ -1271,5 +1271,5 @@ class WindowsPath(Path, PureWindowsPath):

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