@@ -5308,10 +5308,9 @@ compiler_async_comprehension_generator(struct compiler *c, location loc,
5308
5308
5309
5309
USE_LABEL (c , start );
5310
5310
/* Runtime will push a block here, so we need to account for that */
5311
- if (compiler_push_fblock (c , loc , ASYNC_COMPREHENSION_GENERATOR ,
5312
- start , NO_LABEL , NULL ) < 0 ) {
5313
- return ERROR ;
5314
- }
5311
+ RETURN_IF_ERROR (
5312
+ compiler_push_fblock (c , loc , ASYNC_COMPREHENSION_GENERATOR ,
5313
+ start , NO_LABEL , NULL ));
5315
5314
5316
5315
ADDOP_JUMP (c , loc , SETUP_FINALLY , except );
5317
5316
ADDOP (c , loc , GET_ANEXT );
@@ -5631,8 +5630,8 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos)
5631
5630
/* BLOCK code */
5632
5631
VISIT_SEQ (c , stmt , s -> v .AsyncWith .body )
5633
5632
}
5634
- else if ( compiler_async_with ( c , s , pos ) == ERROR ) {
5635
- return ERROR ;
5633
+ else {
5634
+ RETURN_IF_ERROR ( compiler_async_with ( c , s , pos )) ;
5636
5635
}
5637
5636
5638
5637
compiler_pop_fblock (c , ASYNC_WITH , block );
@@ -5725,8 +5724,8 @@ compiler_with(struct compiler *c, stmt_ty s, int pos)
5725
5724
/* BLOCK code */
5726
5725
VISIT_SEQ (c , stmt , s -> v .With .body )
5727
5726
}
5728
- else if ( compiler_with ( c , s , pos ) == ERROR ) {
5729
- return ERROR ;
5727
+ else {
5728
+ RETURN_IF_ERROR ( compiler_with ( c , s , pos )) ;
5730
5729
}
5731
5730
5732
5731
ADDOP (c , NO_LOCATION , POP_BLOCK );
@@ -6346,20 +6345,14 @@ pattern_helper_store_name(struct compiler *c, location loc,
6346
6345
}
6347
6346
// Can't assign to the same name twice:
6348
6347
int duplicate = PySequence_Contains (pc -> stores , n );
6349
- if (duplicate < 0 ) {
6350
- return ERROR ;
6351
- }
6348
+ RETURN_IF_ERROR (duplicate );
6352
6349
if (duplicate ) {
6353
6350
return compiler_error_duplicate_store (c , loc , n );
6354
6351
}
6355
6352
// Rotate this object underneath any items we need to preserve:
6356
6353
Py_ssize_t rotations = pc -> on_top + PyList_GET_SIZE (pc -> stores ) + 1 ;
6357
- if (pattern_helper_rotate (c , loc , rotations ) < 0 ) {
6358
- return ERROR ;
6359
- }
6360
- if (PyList_Append (pc -> stores , n ) < 0 ) {
6361
- return ERROR ;
6362
- }
6354
+ RETURN_IF_ERROR (pattern_helper_rotate (c , loc , rotations ));
6355
+ RETURN_IF_ERROR (PyList_Append (pc -> stores , n ));
6363
6356
return SUCCESS ;
6364
6357
}
6365
6358
@@ -6398,9 +6391,7 @@ pattern_helper_sequence_unpack(struct compiler *c, location loc,
6398
6391
asdl_pattern_seq * patterns , Py_ssize_t star ,
6399
6392
pattern_context * pc )
6400
6393
{
6401
- if (pattern_unpack_helper (c , loc , patterns ) < 0 ) {
6402
- return ERROR ;
6403
- }
6394
+ RETURN_IF_ERROR (pattern_unpack_helper (c , loc , patterns ));
6404
6395
Py_ssize_t size = asdl_seq_LEN (patterns );
6405
6396
// We've now got a bunch of new subjects on the stack. They need to remain
6406
6397
// there after each subpattern match:
0 commit comments