mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-119049: Defer import warnings
in pathlib._local
(#119111)
This commit is contained in:
parent
447edb6e98
commit
31a28cbae0
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,6 @@ import operator
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
|
||||||
from glob import _StringGlobber
|
from glob import _StringGlobber
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from _collections_abc import Sequence
|
from _collections_abc import Sequence
|
||||||
|
@ -405,6 +404,7 @@ class PurePath(PurePathBase):
|
||||||
def is_reserved(self):
|
def is_reserved(self):
|
||||||
"""Return True if the path contains one of the special names reserved
|
"""Return True if the path contains one of the special names reserved
|
||||||
by the system, if any."""
|
by the system, if any."""
|
||||||
|
import warnings
|
||||||
msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
|
msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
|
||||||
"for removal in Python 3.15. Use os.path.isreserved() to "
|
"for removal in Python 3.15. Use os.path.isreserved() to "
|
||||||
"detect reserved paths on Windows.")
|
"detect reserved paths on Windows.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue