From c24ca4b192559526797d0410bf3cee2fecaaddf5 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Fri, 24 Mar 2000 20:35:20 +0000 Subject: [PATCH] Fix probable bug; if errno == EINTR, floatsleep() doesn't break out of a Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS block, but it calls Py_BLOCK_THREADS anyway. The change moves Py_BLOCK_THREADS to inside the if, so it's only executed when the function actually returns unexpectedly. --- Modules/timemodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index d5a598b6b7..b01366a239 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -755,12 +755,12 @@ floatsleep(double secs) t.tv_usec = (long)(frac*1000000.0); Py_BEGIN_ALLOW_THREADS if (select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t) != 0) { - Py_BLOCK_THREADS #ifdef EINTR if (errno != EINTR) { #else if (1) { #endif + Py_BLOCK_THREADS PyErr_SetFromErrno(PyExc_IOError); return -1; } -- 2.50.1