Kaydet (Commit) 9541bd32 authored tarafından Joannah Nanjekye's avatar Joannah Nanjekye Kaydeden (comit) Berker Peksag

bpo-24011: Use PyModule_Add{Object,IntMacro} in PyInit__signal() (GH-12765)

üst 5ebfa840
...@@ -1350,17 +1350,15 @@ PyInit__signal(void) ...@@ -1350,17 +1350,15 @@ PyInit__signal(void)
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
x = DefaultHandler = PyLong_FromVoidPtr((void *)SIG_DFL); x = DefaultHandler = PyLong_FromVoidPtr((void *)SIG_DFL);
if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0) if (PyModule_AddObject(m, "SIG_DFL", x))
goto finally; goto finally;
x = IgnoreHandler = PyLong_FromVoidPtr((void *)SIG_IGN); x = IgnoreHandler = PyLong_FromVoidPtr((void *)SIG_IGN);
if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0) if (PyModule_AddObject(m, "SIG_IGN", x))
goto finally; goto finally;
x = PyLong_FromLong((long)NSIG); if (PyModule_AddIntMacro(m, NSIG))
if (!x || PyDict_SetItemString(d, "NSIG", x) < 0)
goto finally; goto finally;
Py_DECREF(x);
#ifdef SIG_BLOCK #ifdef SIG_BLOCK
if (PyModule_AddIntMacro(m, SIG_BLOCK)) if (PyModule_AddIntMacro(m, SIG_BLOCK))
...@@ -1569,8 +1567,8 @@ PyInit__signal(void) ...@@ -1569,8 +1567,8 @@ PyInit__signal(void)
#if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER) #if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER)
ItimerError = PyErr_NewException("signal.ItimerError", ItimerError = PyErr_NewException("signal.ItimerError",
PyExc_OSError, NULL); PyExc_OSError, NULL);
if (ItimerError != NULL) if (PyModule_AddObject(m, "ItimerError", ItimerError))
PyDict_SetItemString(d, "ItimerError", ItimerError); goto finally;
#endif #endif
#ifdef CTRL_C_EVENT #ifdef CTRL_C_EVENT
......
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