]> granicus.if.org Git - python/commitdiff
cleanup signalmodule.c: use PyModule_AddIntMacro()
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 2 May 2011 14:15:43 +0000 (16:15 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 2 May 2011 14:15:43 +0000 (16:15 +0200)
Modules/signalmodule.c

index 305261cb01ebe4dcbba0673ab5090a5d10ccd82a..0cb27209eafb889d455ccf02e754e9e362187f97 100644 (file)
@@ -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");