mirror of https://github.com/python/cpython
cleanup signalmodule.c: use PyModule_AddIntMacro()
This commit is contained in:
parent
59bec36b1c
commit
72c53b5dcc
|
@ -720,24 +720,16 @@ PyInit_signal(void)
|
|||
Py_DECREF(x);
|
||||
|
||||
#ifdef SIG_BLOCK
|
||||
x = PyLong_FromLong(SIG_BLOCK);
|
||||
if (!x || PyDict_SetItemString(d, "SIG_BLOCK", x) < 0)
|
||||
if (PyModule_AddIntMacro(m, SIG_BLOCK))
|
||||
goto finally;
|
||||
Py_DECREF(x);
|
||||
#endif
|
||||
|
||||
#ifdef SIG_UNBLOCK
|
||||
x = PyLong_FromLong(SIG_UNBLOCK);
|
||||
if (!x || PyDict_SetItemString(d, "SIG_UNBLOCK", x) < 0)
|
||||
if (PyModule_AddIntMacro(m, SIG_UNBLOCK))
|
||||
goto finally;
|
||||
Py_DECREF(x);
|
||||
#endif
|
||||
|
||||
#ifdef SIG_SETMASK
|
||||
x = PyLong_FromLong(SIG_SETMASK);
|
||||
if (!x || PyDict_SetItemString(d, "SIG_SETMASK", x) < 0)
|
||||
if (PyModule_AddIntMacro(m, SIG_SETMASK))
|
||||
goto finally;
|
||||
Py_DECREF(x);
|
||||
#endif
|
||||
|
||||
x = IntHandler = PyDict_GetItemString(d, "default_int_handler");
|
||||
|
|
Loading…
Reference in New Issue