win32: quietly ignore missing CreateHardLinkA for Wine stable
authorMatt Mackall <mpm@selenic.com>
Tue, 13 Sep 2011 17:01:07 -0500
branchstable
changeset 15095 ec222a29bdf0
parent 15094 258eee414ab7
child 15098 edf7ae547b0e
child 15152 94b200a11cf7
child 15180 978358ce722d
win32: quietly ignore missing CreateHardLinkA for Wine
mercurial/win32.py
--- a/mercurial/win32.py	Thu Sep 08 11:34:59 2011 +0100
+++ b/mercurial/win32.py	Tue Sep 13 17:01:07 2011 -0500
@@ -138,8 +138,11 @@
 _kernel32.CloseHandle.argtypes = [_HANDLE]
 _kernel32.CloseHandle.restype = _BOOL
 
-_kernel32.CreateHardLinkA.argtypes = [_LPCSTR, _LPCSTR, ctypes.c_void_p]
-_kernel32.CreateHardLinkA.restype = _BOOL
+try:
+    _kernel32.CreateHardLinkA.argtypes = [_LPCSTR, _LPCSTR, ctypes.c_void_p]
+    _kernel32.CreateHardLinkA.restype = _BOOL
+except AttributeError:
+    pass
 
 _kernel32.SetFileAttributesA.argtypes = [_LPCSTR, _DWORD]
 _kernel32.SetFileAttributesA.restype = _BOOL