mirror of
https://github.com/python/cpython.git
synced 2025-10-25 15:58:57 +00:00
Trent Mick:
Fix warnings on 64-bit build build of signalmodule.c - Though I know that SIG_DFL and SIG_IGN are just small constants, there are cast to function pointers so the appropriate Python call is PyLong_FromVoidPtr so that the pointer value cannot overflow on Win64 where sizeof(long) < sizeof(void*).
This commit is contained in:
parent
534b7c5c96
commit
cc6a438d7f
1 changed files with 2 additions and 2 deletions
|
|
@ -356,11 +356,11 @@ initsignal()
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
x = DefaultHandler = PyInt_FromLong((long)SIG_DFL);
|
x = DefaultHandler = PyLong_FromVoidPtr(SIG_DFL);
|
||||||
if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0)
|
if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0)
|
||||||
goto finally;
|
goto finally;
|
||||||
|
|
||||||
x = IgnoreHandler = PyInt_FromLong((long)SIG_IGN);
|
x = IgnoreHandler = PyLong_FromVoidPtr(SIG_IGN);
|
||||||
if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0)
|
if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0)
|
||||||
goto finally;
|
goto finally;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue