diff --git a/mitogen/core.py b/mitogen/core.py index e43ecb42..38adabce 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -185,6 +185,7 @@ def is_blacklisted_import(importer, fullname): def set_cloexec(fd): flags = fcntl.fcntl(fd, fcntl.F_GETFD) + assert fd > 2 fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)