mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
GH-111485: Make BEFORE_WITH a uop (GH-111812)
This commit is contained in:
parent
d4426e8d00
commit
3e99c9cbf6
5 changed files with 56 additions and 7 deletions
|
@ -2765,7 +2765,7 @@ dummy_func(
|
|||
GOTO_ERROR(error);
|
||||
}
|
||||
DECREF_INPUTS();
|
||||
res = _PyObject_CallNoArgs(enter);
|
||||
res = _PyObject_CallNoArgsTstate(tstate, enter);
|
||||
Py_DECREF(enter);
|
||||
if (res == NULL) {
|
||||
Py_DECREF(exit);
|
||||
|
@ -2774,7 +2774,6 @@ dummy_func(
|
|||
}
|
||||
|
||||
inst(BEFORE_WITH, (mgr -- exit, res)) {
|
||||
TIER_ONE_ONLY
|
||||
/* pop the context manager, push its __exit__ and the
|
||||
* value returned from calling its __enter__
|
||||
*/
|
||||
|
@ -2801,7 +2800,7 @@ dummy_func(
|
|||
GOTO_ERROR(error);
|
||||
}
|
||||
DECREF_INPUTS();
|
||||
res = _PyObject_CallNoArgs(enter);
|
||||
res = _PyObject_CallNoArgsTstate(tstate, enter);
|
||||
Py_DECREF(enter);
|
||||
if (res == NULL) {
|
||||
Py_DECREF(exit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue