diff options
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r-- | Modules/selectmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 65e1826..5aa67dd 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -234,6 +234,11 @@ select_select(PyObject *self, PyObject *args) "timeout period too long"); return NULL; } + if (timeout < 0) { + PyErr_SetString(PyExc_ValueError, + "timeout must be non-negative"); + return NULL; + } seconds = (long)timeout; timeout = timeout - (double)seconds; tv.tv_sec = seconds; |