]> granicus.if.org Git - python/commitdiff
bpo-31893: Fix a backporting error in 8cbf4e10646c3f5b8f0d274c2d7dea5bb6305f57. ...
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 1 Nov 2017 15:43:07 +0000 (17:43 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Nov 2017 15:43:07 +0000 (17:43 +0200)
Modules/selectmodule.c

index 6cd32cd8a93ad56b8fc9a616321cc5c98c62abc3..1dec6a120d05163cdb5bc4e659b28d642b792234 100644 (file)
@@ -1352,9 +1352,12 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
     if (PyInt_Check(pfd)) {
         self->e.ident = PyInt_AsUnsignedLongMask(pfd);
     }
-    else {
-    if (PyInt_Check(pfd) || PyLong_Check(pfd)) {
-        self->e.ident = PyLong_AsSize_t(pfd);
+    else if (PyLong_Check(pfd)) {
+#if defined(HAVE_LONG_LONG) && (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG)
+        self->e.ident = PyLong_AsUnsignedLongLongMask(pfd);
+#else
+        self->e.ident = PyLong_AsUnsignedLongMask(pfd);
+#endif
     }
     else {
         self->e.ident = PyObject_AsFileDescriptor(pfd);