GH-111485: Make BEFORE_WITH a uop (GH-111812)

This commit is contained in:
Brandt Bucher 2023-11-06 16:42:49 -08:00 committed by GitHub
parent d4426e8d00
commit 3e99c9cbf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 7 deletions

View file

@ -3967,7 +3967,7 @@
GOTO_ERROR(error);
}
Py_DECREF(mgr);
res = _PyObject_CallNoArgs(enter);
res = _PyObject_CallNoArgsTstate(tstate, enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
@ -3987,7 +3987,6 @@
PyObject *exit;
PyObject *res;
mgr = stack_pointer[-1];
TIER_ONE_ONLY
/* pop the context manager, push its __exit__ and the
* value returned from calling its __enter__
*/
@ -4014,7 +4013,7 @@
GOTO_ERROR(error);
}
Py_DECREF(mgr);
res = _PyObject_CallNoArgs(enter);
res = _PyObject_CallNoArgsTstate(tstate, enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);