diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index dce157f55..42d51b086 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -802,7 +802,9 @@ psutil_users(PyObject *self, PyObject *args) { struct utmp ut; FILE *fp; + Py_BEGIN_ALLOW_THREADS fp = fopen(_PATH_UTMP, "r"); + Py_END_ALLOW_THREADS if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); goto error;