1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Description: ntpath is not in python-minimal, replace module-level imports with
local imports in functions that actually require ntpath.
Forwarded: not-needed
--- a/Lib/pathlib/_local.py
+++ b/Lib/pathlib/_local.py
@@ -1,5 +1,4 @@
import io
-import ntpath
import operator
import os
import posixpath
@@ -115,6 +114,7 @@
return object.__new__(cls)
def __init__(self, *args):
+ import ntpath
paths = []
for arg in args:
if isinstance(arg, PurePath):
@@ -417,6 +417,7 @@
def is_reserved(self):
"""Return True if the path contains one of the special names reserved
by the system, if any."""
+ import ntpath
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.")
@@ -475,6 +476,7 @@
On a Windows system, instantiating a PurePath should return this object.
However, you can also instantiate it directly on any system.
"""
+ import ntpath
parser = ntpath
__slots__ = ()
|