Skip to content

Commit b4beecc

Browse files
committed
Remove flavour.has_drv.
1 parent 3d27707 commit b4beecc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/pathlib.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class _WindowsFlavour(_Flavour):
5555
# Reference for Windows paths can be found at
5656
# http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
5757

58-
has_drv = True
59-
6058
def casefold(self, s):
6159
return s.lower()
6260

@@ -65,8 +63,6 @@ def casefold_parts(self, parts):
6563

6664

6765
class _PosixFlavour(_Flavour):
68-
has_drv = False
69-
7066
def casefold(self, s):
7167
return s
7268

@@ -737,9 +733,7 @@ def parents(self):
737733
def is_absolute(self):
738734
"""True if the path is absolute (has both a root and, if applicable,
739735
a drive)."""
740-
if not self._root:
741-
return False
742-
return not self._flavour.has_drv or bool(self._drv)
736+
raise NotImplementedError
743737

744738
def is_reserved(self):
745739
"""Return True if the path contains one of the special names reserved
@@ -805,6 +799,9 @@ def _splitroot(cls, part):
805799
else:
806800
return '', '', part
807801

802+
def is_absolute(self):
803+
return bool(self._root)
804+
808805
def is_reserved(self):
809806
return False
810807

@@ -894,6 +891,9 @@ def _split_extended_path(cls, s, ext_prefix=_ext_namespace_prefix):
894891
s = '\\' + s[3:]
895892
return prefix, s
896893

894+
def is_absolute(self):
895+
return bool(self._root) and bool(self._drv)
896+
897897
def is_reserved(self):
898898
# NOTE: the rules for reserved names seem somewhat complicated
899899
# (e.g. r"..\NUL" is reserved but not r"foo\NUL").

0 commit comments

Comments
 (0)