diff --git a/peps/pep-0788.rst b/peps/pep-0788.rst index bdfcaee1ca5..7f3c6105c73 100644 --- a/peps/pep-0788.rst +++ b/peps/pep-0788.rst @@ -205,7 +205,7 @@ Interpreter guards The caller does not need to hold an attached thread state. -.. c:function:: void PyInterpreterGuard_Close(PyInterpreterGuard guard) +.. c:function:: void PyInterpreterGuard_Close(PyInterpreterGuard *guard) Close an interpreter guard, allowing the interpreter to enter finalization if no other guards remain. If an interpreter guard @@ -377,7 +377,7 @@ replace :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`. PyThreadState *tstate = PyThreadState_Ensure(guard); if (tstate == NULL) { - PyInterpreterGuard_Close(tstate); + PyInterpreterGuard_Close(guard); return NULL; } close_guard_upon_tstate_release(tstate, guard); @@ -595,7 +595,6 @@ With this PEP, you would implement it like this: assert(view != NULL); PyThreadState *tstate = PyThreadState_EnsureFromView(view); if (tstate == NULL) { - PyInterpreterGuard_Close(guard); fputs("Cannot call Python.\n", stderr); return -1; }