From e6faebcd7adaa327d1ce57385cbebe7724d02350 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Wed, 20 Nov 2019 14:38:07 +0800 Subject: [PATCH] release gil around users()/BSD (#1425) --- psutil/_psutil_bsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index e07ddcc1a..723d6198c 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_SetFromErrnoWithFilename(PyExc_OSError, _PATH_UTMP); goto error;