From e3ebb0dbcac2abfa6cfcaba1c50bf178959ab8a5 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 13 May 2022 00:17:22 -0700 Subject: [PATCH] Slightly rewording comment. (There were also other failures.) --- include/pybind11/pybind11.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 5c3fd9b3f..306b3f8b2 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -2612,12 +2612,13 @@ void print(Args &&...args) { error_already_set::~error_already_set() { // Not using py::gil_scoped_acquire here since that calls get_internals, - // which triggers tensorflow failures (a full explanation is currently unknown). + // which is known to trigger failures in the wild (a full explanation is + // currently unknown). // gil_scoped_acquire_local here is a straight copy from get_internals code. // I.e. py::gil_scoped_acquire acquires the GIL in detail/internals.h exactly // like we do here now, releases it, then acquires it again in gil.h. // Using gil_scoped_acquire_local cuts out the get_internals overhead and - // fixes the tensorflow failures. + // fixes the failures observed in the wild. See PR #1895 for more background. struct gil_scoped_acquire_local { gil_scoped_acquire_local() : state(PyGILState_Ensure()) {} ~gil_scoped_acquire_local() { PyGILState_Release(state); }