Mercurial > hg
comparison mercurial/osutil.c @ 30110:79f438f5dd02
osutil: use PyLongObject in recvfds
PyIntObject doesn't exist in Python 3. While PyIntObject is preferred
on Python 2 because it is a fixed capacity and faster, the difference
between PyIntObject and PyLongObject for scenarios where performance
isn't critical or the caller isn't performing type checking shouldn't
be relevant.
So change recvfds to return a list of longs instead of ints on Python
2.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 09 Oct 2016 13:41:18 +0200 |
parents | 301ef65e8ebb |
children | a989fa78dafa |
comparison
equal
deleted
inserted
replaced
30109:96a2278ee732 | 30110:79f438f5dd02 |
---|---|
704 | 704 |
705 rfdslist = PyList_New(rfdscount); | 705 rfdslist = PyList_New(rfdscount); |
706 if (!rfdslist) | 706 if (!rfdslist) |
707 goto bail; | 707 goto bail; |
708 for (i = 0; i < rfdscount; i++) { | 708 for (i = 0; i < rfdscount; i++) { |
709 PyObject *obj = PyInt_FromLong(rfds[i]); | 709 PyObject *obj = PyLong_FromLong(rfds[i]); |
710 if (!obj) | 710 if (!obj) |
711 goto bail; | 711 goto bail; |
712 PyList_SET_ITEM(rfdslist, i, obj); | 712 PyList_SET_ITEM(rfdslist, i, obj); |
713 } | 713 } |
714 return rfdslist; | 714 return rfdslist; |