py3: misc fixes

This commit is contained in:
Kovid Goyal 2019-04-04 08:46:33 +05:30
parent 98a435968a
commit a43207d38a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -591,7 +591,8 @@ def copyfile(src, dest):
def get_hardlink_function(src, dest):
if iswindows:
import win32file, win32api
root = dest[0] + b':'
colon = b':' if isinstance(dest, bytes) else ':'
root = dest[0] + colon
try:
is_suitable = win32file.GetDriveType(root) not in (win32file.DRIVE_REMOTE, win32file.DRIVE_CDROM)
# See https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx