mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
GH-100762: Don't call gen.throw()
in gen.close()
, unless necessary. (GH-101013)
* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
This commit is contained in:
parent
daec3a463c
commit
f02fa64bf2
9 changed files with 39 additions and 12 deletions
|
@ -492,7 +492,7 @@ dis_asyncwith = """\
|
|||
GET_AWAITABLE 1
|
||||
LOAD_CONST 0 (None)
|
||||
>> SEND 3 (to 22)
|
||||
YIELD_VALUE 3
|
||||
YIELD_VALUE 2
|
||||
RESUME 3
|
||||
JUMP_BACKWARD_NO_INTERRUPT 4 (to 14)
|
||||
>> POP_TOP
|
||||
|
@ -526,7 +526,7 @@ dis_asyncwith = """\
|
|||
GET_AWAITABLE 2
|
||||
LOAD_CONST 0 (None)
|
||||
>> SEND 4 (to 92)
|
||||
YIELD_VALUE 6
|
||||
YIELD_VALUE 3
|
||||
RESUME 3
|
||||
JUMP_BACKWARD_NO_INTERRUPT 4 (to 82)
|
||||
>> CLEANUP_THROW
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue