From e3298dda6dfb5427b3beab142e563d65c1bd5e84 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 2 Aug 2011 18:40:46 -0500 Subject: only add sched_param if it is initialized --- Modules/posixmodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 918ffb6..e6d70d3 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -10965,8 +10965,11 @@ INITFUNC(void) Py_INCREF((PyObject*) &StatVFSResultType); PyModule_AddObject(m, "statvfs_result", (PyObject*) &StatVFSResultType); + +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) Py_INCREF(&SchedParamType); PyModule_AddObject(m, "sched_param", (PyObject *)&SchedParamType); +#endif initialized = 1; #ifdef __APPLE__ -- cgit v0.12 From bad9c2f13ae2d1b7af3d64506b2ab1ad7850d20a Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 2 Aug 2011 18:42:14 -0500 Subject: avoid warning when SchedParamType is not used --- Modules/posixmodule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e6d70d3..f4461c0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1609,7 +1609,9 @@ static PyTypeObject WaitidResultType; static int initialized; static PyTypeObject StatResultType; static PyTypeObject StatVFSResultType; +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) static PyTypeObject SchedParamType; +#endif static newfunc structseq_new; static PyObject * -- cgit v0.12