summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-02 14:15:43 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-02 14:15:43 (GMT)
commit72c53b5dccb02f7a14edbfa4a197827b29e454e9 (patch)
treeaa3eb5a90ed645221ba0c493960162be0f78c68c /Modules/signalmodule.c
parent59bec36b1c19960e03c94d1f7617459d69e8b28c (diff)
downloadcpython-72c53b5dccb02f7a14edbfa4a197827b29e454e9.zip
cpython-72c53b5dccb02f7a14edbfa4a197827b29e454e9.tar.gz
cpython-72c53b5dccb02f7a14edbfa4a197827b29e454e9.tar.bz2
cleanup signalmodule.c: use PyModule_AddIntMacro()
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 305261c..0cb2720 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -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)
- goto finally;
- Py_DECREF(x);
+ if (PyModule_AddIntMacro(m, SIG_BLOCK))
+ goto finally;
#endif
-
#ifdef SIG_UNBLOCK
- x = PyLong_FromLong(SIG_UNBLOCK);
- if (!x || PyDict_SetItemString(d, "SIG_UNBLOCK", x) < 0)
- goto finally;
- Py_DECREF(x);
+ if (PyModule_AddIntMacro(m, SIG_UNBLOCK))
+ goto finally;
#endif
-
#ifdef SIG_SETMASK
- x = PyLong_FromLong(SIG_SETMASK);
- if (!x || PyDict_SetItemString(d, "SIG_SETMASK", x) < 0)
- goto finally;
- Py_DECREF(x);
+ if (PyModule_AddIntMacro(m, SIG_SETMASK))
+ goto finally;
#endif
x = IntHandler = PyDict_GetItemString(d, "default_int_handler");