# HG changeset patch # User Matt Mackall # Date 2011-09-14 19:37:10 # Node ID edf7ae547b0e475936831fb8459c850d13b2d310 # Parent cda7a87c187159d3e2fba5b761aff038d6cd3512 # Parent ec222a29bdf0eafc9f281151e3221e6e0efecfad merge with stable diff --git a/mercurial/osutil.c b/mercurial/osutil.c --- a/mercurial/osutil.c +++ b/mercurial/osutil.c @@ -525,9 +525,9 @@ static PyObject *isgui(PyObject *self) if (dict != NULL) { CFRelease(dict); - return Py_True; + Py_RETURN_TRUE; } else { - return Py_False; + Py_RETURN_FALSE; } } #endif diff --git a/mercurial/win32.py b/mercurial/win32.py --- a/mercurial/win32.py +++ b/mercurial/win32.py @@ -138,8 +138,11 @@ class _CONSOLE_SCREEN_BUFFER_INFO(ctypes _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