mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-133875: Remove deprecated pathlib.PurePath.is_reserved (#133876)
This commit is contained in:
parent
7ae4749d06
commit
67036f1ee1
9 changed files with 15 additions and 36 deletions
|
|
@ -519,18 +519,6 @@ class PurePath:
|
|||
return False
|
||||
return self.parser.isabs(self)
|
||||
|
||||
def is_reserved(self):
|
||||
"""Return True if the path contains one of the special names reserved
|
||||
by the system, if any."""
|
||||
import warnings
|
||||
msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
|
||||
"for removal in Python 3.15. Use os.path.isreserved() to "
|
||||
"detect reserved paths on Windows.")
|
||||
warnings._deprecated("pathlib.PurePath.is_reserved", msg, remove=(3, 15))
|
||||
if self.parser is ntpath:
|
||||
return self.parser.isreserved(self)
|
||||
return False
|
||||
|
||||
def as_uri(self):
|
||||
"""Return the path as a URI."""
|
||||
import warnings
|
||||
|
|
|
|||
|
|
@ -539,12 +539,6 @@ class PurePathTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, P('a/b').with_stem, '')
|
||||
self.assertRaises(ValueError, P('a/b').with_stem, '.')
|
||||
|
||||
def test_is_reserved_deprecated(self):
|
||||
P = self.cls
|
||||
p = P('a/b')
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
p.is_reserved()
|
||||
|
||||
def test_full_match_case_sensitive(self):
|
||||
P = self.cls
|
||||
self.assertFalse(P('A.py').full_match('a.PY', case_sensitive=True))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue