[PATCH 3 of 8] pure/osutil: c_ssize_t is only available in Python >= 2.7

Yuya Nishihara yuya at tcha.org
Wed Dec 23 07:06:03 CST 2015


On Tue, 22 Dec 2015 22:24:41 -0800, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bos at serpentine.com>
> # Date 1450849086 28800
> #      Tue Dec 22 21:38:06 2015 -0800
> # Node ID 84a069c3cf4bfcc56cd889a7c03ef974d3913b98
> # Parent  a29971f960ad845a4ffac06d7d1b7901d05268f7
> pure/osutil: c_ssize_t is only available in Python >= 2.7
> 
> diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
> --- a/mercurial/pure/osutil.py
> +++ b/mercurial/pure/osutil.py
> @@ -105,7 +105,7 @@ if os.name != 'nt':
>  
>      _libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True)
>      _recvmsg = _libc.recvmsg
> -    _recvmsg.restype = ctypes.c_ssize_t
> +    _recvmsg.restype = getattr(ctypes, 'c_ssize_t', ctypes.c_long)

Oh, thanks. Pushed 1-3 to the clowncopter.


More information about the Mercurial-devel mailing list