8000 gh-119049: Defer `import warnings` in `pathlib._local` (#119111) · python/cpython@31a28cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 31a28cb

Browse files
authored
gh-119049: Defer import warnings in pathlib._local (#119111)
1 parent 447edb6 commit 31a28cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/pathlib/_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import posixpath
66
import sys
7-
import warnings
87
from glob import _StringGlobber
98
from itertools import chain
109
from _collections_abc import Sequence
@@ -405,6 +404,7 @@ def is_absolute(self):
405404
def is_reserved(self):
406405
"""Return True if the path contains one of the special names reserved
407406
by the system, if any."""
407+
import warnings
408408
msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
409409
"for removal in Python 3.15. Use os.path.isreserved() to "
410410
"detect reserved paths on Windows.")

0 commit comments

Comments
 (0)
0