File: min-ntpath-pathlib.diff

package info (click to toggle)
python3.14 3.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 128,000 kB
  • sloc: python: 752,614; ansic: 717,151; xml: 31,250; sh: 5,989; cpp: 4,063; makefile: 1,996; objc: 787; lisp: 502; javascript: 136; asm: 75; csh: 12
file content (29 lines) | stat: -rw-r--r-- 981 bytes parent folder | download
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
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/__init__.py
+++ b/Lib/pathlib/__init__.py
@@ -6,7 +6,6 @@ operating systems.
 """
 
 import io
-import ntpath
 import operator
 import os
 import posixpath
@@ -516,6 +515,7 @@ class PurePath:
     def is_reserved(self):
         """Return True if the path contains one of the special names reserved
         by the system, if any."""
+        import ntpath
         import warnings
         msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
                "for removal in Python 3.15. Use os.path.isreserved() to "
@@ -614,6 +614,7 @@ class PureWindowsPath(PurePath):
     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__ = ()