osutil: use PyLongObject in recvfds
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 09 Oct 2016 13:41:18 +0200
changeset 30110 79f438f5dd02
parent 30109 96a2278ee732
child 30111 a989fa78dafa
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.
mercurial/osutil.c
--- a/mercurial/osutil.c	Sun Oct 09 12:37:10 2016 +0200
+++ b/mercurial/osutil.c	Sun Oct 09 13:41:18 2016 +0200
@@ -706,7 +706,7 @@
 	if (!rfdslist)
 		goto bail;
 	for (i = 0; i < rfdscount; i++) {
-		PyObject *obj = PyInt_FromLong(rfds[i]);
+		PyObject *obj = PyLong_FromLong(rfds[i]);
 		if (!obj)
 			goto bail;
 		PyList_SET_ITEM(rfdslist, i, obj);