diff --git a/Lib/pathlib.py b/Lib/pathlib.py index a223e18de82b81..ff838bb12d37a4 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1356,7 +1356,7 @@ def as_uri(self): self._unsupported("as_uri") -class Path(PurePath, _PathBase): +class Path(_PathBase, PurePath): """PurePath subclass that can make system calls. Path represents a filesystem path but unlike PurePath, also offers @@ -1366,6 +1366,7 @@ class Path(PurePath, _PathBase): but cannot instantiate a WindowsPath on a POSIX system or vice versa. """ __slots__ = () + as_uri = PurePath.as_uri def __init__(self, *args, **kwargs): if kwargs: diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 95b148bcce47ce..975194451cdcc4 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -2833,7 +2833,7 @@ class DummyPathWithSymlinksTest(DummyPathTest): # Tests for the concrete classes. # -class PathTest(PurePathTest, DummyPathTest): +class PathTest(DummyPathTest, PurePathTest): """Tests for the FS-accessing functionalities of the Path classes.""" cls = pathlib.Path can_symlink = os_helper.can_symlink()