Commit ce518908 authored by Serhiy Storchaka's avatar Serhiy Storchaka Committed by GitHub

bpo-31893: Fix a backporting error in 8cbf4e10. (#4219)

parent 87c66e46
...@@ -1352,9 +1352,12 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds) ...@@ -1352,9 +1352,12 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
if (PyInt_Check(pfd)) { if (PyInt_Check(pfd)) {
self->e.ident = PyInt_AsUnsignedLongMask(pfd); self->e.ident = PyInt_AsUnsignedLongMask(pfd);
} }
else { else if (PyLong_Check(pfd)) {
if (PyInt_Check(pfd) || PyLong_Check(pfd)) { #if defined(HAVE_LONG_LONG) && (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG)
self->e.ident = PyLong_AsSize_t(pfd); self->e.ident = PyLong_AsUnsignedLongLongMask(pfd);
#else
self->e.ident = PyLong_AsUnsignedLongMask(pfd);
#endif
} }
else { else {
self->e.ident = PyObject_AsFileDescriptor(pfd); self->e.ident = PyObject_AsFileDescriptor(pfd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment