Files
MSYS2-packages/python3/3.3.3-allow-win-drives-in-os-path-isabs.patch

30 lines
838 B
Diff

--- a/Lib/posixpath.py 2013-11-27 06:57:57.000000000 +0000
+++ b/Lib/posixpath.py 2014-02-21 10:43:34.423932700 +0000
@@ -41,6 +41,12 @@
else:
return '/'
+def _get_altsep(path):
+ if isinstance(path, bytes):
+ return b'\\'
+ else:
+ return '\\'
+
# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other
# normalizations (such as optimizing '../' away) are not allowed
@@ -61,7 +67,12 @@
def isabs(s):
"""Test whether a path is absolute"""
sep = _get_sep(s)
- return s.startswith(sep)
+ altsep = _get_altsep(s)
+ return s.startswith(sep) or \
+ (sys.platform == 'msys' and \
+ len(s) > 2 and \
+ s[1] == ':' and \
+ (s[2] == sep or s[2] == altsep))
# Join pathnames.