File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616
1717supports_symlinks = True
18- try :
18+ if os . name == 'nt' :
1919 import nt
20- except ImportError :
21- nt = None
22- else :
2320 if sys .getwindowsversion ()[:2 ] >= (6 , 0 ):
2421 from nt import _getfinalpathname
2522 else :
2623 supports_symlinks = False
2724 _getfinalpathname = None
25+ else :
26+ nt = None
2827
2928
3029__all__ = [
@@ -110,7 +109,7 @@ class _WindowsFlavour(_Flavour):
110109 has_drv = True
111110 pathmod = ntpath
112111
113- is_supported = (nt is not None )
112+ is_supported = (os . name == 'nt' )
114113
115114 drive_letters = (
116115 set (chr (x ) for x in range (ord ('a' ), ord ('z' ) + 1 )) |
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ Core and Builtins
3636Library
3737-------
3838
39+ - Issue #22370: Windows detection in pathlib is now more robust.
40+
3941- Issue #22841: Reject coroutines in asyncio add_signal_handler().
4042 Patch by Ludovic.Gasc.
4143
You can’t perform that action at this time.
0 commit comments