Skip to content

Commit dd087fa

Browse files
authored
Merge pull request #32 from ActiveState/BE-3131-failing-regression-test-test-signal
BE-3131 Fix regression in test_signal
2 parents c6b191e + bf478d6 commit dd087fa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/signalmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,12 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
417417
return NULL;
418418
}
419419
#endif
420+
421+
if (fd != -1 && fstat(fd, &buf) != 0) {
422+
PyErr_SetString(PyExc_ValueError, "invalid fd");
423+
return NULL;
424+
}
425+
420426
old_fd = wakeup_fd;
421427
wakeup_fd = fd;
422428
return PyLong_FromLong(old_fd);

0 commit comments

Comments
 (0)