Skip to content

Commit 4bb4a38

Browse files
committed
Revert any changes to async with
1 parent 153e4d9 commit 4bb4a38

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Python/compile.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4196,15 +4196,14 @@ expr_constant(struct compiler *c, expr_ty e)
41964196
static int
41974197
compiler_async_with(struct compiler *c, stmt_ty s, int pos)
41984198
{
4199-
basicblock *block, *finally, *finally_await;
4199+
basicblock *block, *finally;
42004200
withitem_ty item = asdl_seq_GET(s->v.AsyncWith.items, pos);
42014201

42024202
assert(s->kind == AsyncWith_kind);
42034203

42044204
block = compiler_new_block(c);
42054205
finally = compiler_new_block(c);
4206-
finally_await = compiler_new_block(c);
4207-
if (!block || !finally || !finally_await)
4206+
if (!block || !finally)
42084207
return 0;
42094208

42104209
/* Evaluate EXPR */
@@ -4213,7 +4212,6 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos)
42134212
ADDOP(c, BEFORE_ASYNC_WITH);
42144213
ADDOP(c, GET_AWAITABLE);
42154214
ADDOP_O(c, LOAD_CONST, Py_None, consts);
4216-
ADDOP_JREL(c, DEFER_PENDING_UNTIL, block);
42174215
ADDOP(c, YIELD_FROM);
42184216
ADDOP_JREL(c, SETUP_ASYNC_WITH, finally);
42194217

@@ -4239,7 +4237,6 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos)
42394237
return 0;
42404238

42414239
/* End of try block; start the finally block */
4242-
ADDOP_JREL(c, DEFER_PENDING_UNTIL, finally_await);
42434240
ADDOP(c, POP_BLOCK);
42444241
compiler_pop_fblock(c, FINALLY_TRY, block);
42454242

@@ -4253,10 +4250,8 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos)
42534250
opcode. */
42544251
ADDOP(c, WITH_CLEANUP_START);
42554252

4256-
ADDOP_JREL(c, DEFER_PENDING_UNTIL, finally_await);
42574253
ADDOP(c, GET_AWAITABLE);
42584254
ADDOP_O(c, LOAD_CONST, Py_None, consts);
4259-
compiler_use_next_block(c, finally_await);
42604255
ADDOP(c, YIELD_FROM);
42614256

42624257
ADDOP(c, WITH_CLEANUP_FINISH);

0 commit comments

Comments
 (0)