10000 gh-111233: Fix `selectmodule.c` not checking for errors when initializing by sobolevn · Pull Request #111234 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
sobolevn committed Oct 24, 2023
commit 3c4d3bf95faed58d3e3baec7d5d862f1d6b64d3f
20 changes: 12 additions & 8 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2444,10 +2444,12 @@ _select_exec(PyObject *m)
return -1;
}

#define ADD_INT(val) \
if (PyModule_AddIntConstant((m), #val, (val)) < 0) { \
return -1; \
}
#define ADD_INT(VAL) \
do { \
if (PyModule_AddIntConstant((m), #VAL, (VAL)) < 0) { \
return -1; \
} \
} while (0)

#ifdef PIPE_BUF
#ifdef HAVE_BROKEN_PIPE_BUF
Expand Down Expand Up @@ -2561,10 +2563,12 @@ _select_exec(PyObject *m)

#undef ADD_INT

#define ADD_INT_CONST(name, val) \
if (PyModule_AddIntConstant(m, name, val) < 0) { \
return -1; \
}
#define ADD_INT_CONST(NAME, VAL) \
do { \
if (PyModule_AddIntConstant(m, NAME, VAL) < 0) { \
return -1; \
} \
} while (0)

#ifdef HAVE_KQUEUE
state->kqueue_event_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
Expand Down
0