##// END OF EJS Templates
Merge with crew-stable
Patrick Mezard -
r5895:f1ac4135 merge default
parent child Browse files
Show More
@@ -147,9 +147,18 b' class WinOSError(WinError, OSError):'
147 self.win_strerror)
147 self.win_strerror)
148
148
149 def os_link(src, dst):
149 def os_link(src, dst):
150 # NB will only succeed on NTFS
151 try:
150 try:
152 win32file.CreateHardLink(dst, src)
151 win32file.CreateHardLink(dst, src)
152 # CreateHardLink sometimes succeeds on mapped drives but
153 # following nlinks() returns 1. Check it now and bail out.
154 if nlinks(src) < 2:
155 try:
156 win32file.DeleteFile(dst)
157 except:
158 pass
159 # Fake hardlinking error
160 raise WinOSError((18, 'CreateHardLink', 'The system cannot '
161 'move the file to a different disk drive'))
153 except pywintypes.error, details:
162 except pywintypes.error, details:
154 raise WinOSError(details)
163 raise WinOSError(details)
155
164
General Comments 0
You need to be logged in to leave comments. Login now