File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1111import os
1212import posixpath
1313import sys
14- import warnings
1514from errno import *
1615from glob import _StringGlobber , _no_recurse_symlinks
1716from itertools import chain
@@ -522,19 +521,21 @@ def is_absolute(self):
522521 def is_reserved (self ):
523522 """Return True if the path contains one of the special names reserved
524523 by the system, if any."""
524+ import warnings
525525 msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
526526 "for removal in Python 3.15. Use os.path.isreserved() to "
527527 "detect reserved paths on Windows." )
528- warnings .warn ( msg , DeprecationWarning , stacklevel = 2 )
528+ warnings ._deprecated ( "pathlib.PurePath.is_reserved" , msg , remove = ( 3 , 15 ) )
529529 if self .parser is ntpath :
530530 return self .parser .isreserved (self )
531531 return False
532532
533533 def as_uri (self ):
534534 """Return the path as a URI."""
535+ import warnings
535536 msg = ("pathlib.PurePath.as_uri() is deprecated and scheduled "
536537 "for removal in Python 3.19. Use pathlib.Path.as_uri()." )
537- warnings .warn ( msg , DeprecationWarning , stacklevel = 2 )
538+ warnings ._deprecated ( "pathlib.PurePath.as_uri" , msg , remove = ( 3 , 19 ) )
538539 if not self .is_absolute ():
539540 raise ValueError ("relative path can't be expressed as a file URI" )
540541
You can’t perform that action at this time.
0 commit comments