mirror of https://github.com/python/cpython
Close #22370: Windows detection in pathlib is now more robust.
This commit is contained in:
commit
1d922d0ce9
|
@ -15,16 +15,15 @@ from urllib.parse import quote_from_bytes as urlquote_from_bytes
|
||||||
|
|
||||||
|
|
||||||
supports_symlinks = True
|
supports_symlinks = True
|
||||||
try:
|
if os.name == 'nt':
|
||||||
import nt
|
import nt
|
||||||
except ImportError:
|
|
||||||
nt = None
|
|
||||||
else:
|
|
||||||
if sys.getwindowsversion()[:2] >= (6, 0):
|
if sys.getwindowsversion()[:2] >= (6, 0):
|
||||||
from nt import _getfinalpathname
|
from nt import _getfinalpathname
|
||||||
else:
|
else:
|
||||||
supports_symlinks = False
|
supports_symlinks = False
|
||||||
_getfinalpathname = None
|
_getfinalpathname = None
|
||||||
|
else:
|
||||||
|
nt = None
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
@ -110,7 +109,7 @@ class _WindowsFlavour(_Flavour):
|
||||||
has_drv = True
|
has_drv = True
|
||||||
pathmod = ntpath
|
pathmod = ntpath
|
||||||
|
|
||||||
is_supported = (nt is not None)
|
is_supported = (os.name == 'nt')
|
||||||
|
|
||||||
drive_letters = (
|
drive_letters = (
|
||||||
set(chr(x) for x in range(ord('a'), ord('z') + 1)) |
|
set(chr(x) for x in range(ord('a'), ord('z') + 1)) |
|
||||||
|
|
|
@ -185,6 +185,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #22370: Windows detection in pathlib is now more robust.
|
||||||
|
|
||||||
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
|
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
|
||||||
Patch by Ludovic.Gasc.
|
Patch by Ludovic.Gasc.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue