@@ -1501,14 +1501,14 @@ map_next(PyObject *self)
15011501 }
15021502
15031503 Py_ssize_t nargs = 0 ;
1504- for (i = 0 ; i < niters ; i ++ ) {
1504+ for (i = 0 ; i < niters ; i ++ ) {
15051505 PyObject * it = PyTuple_GET_ITEM (lz -> iters , i );
15061506 PyObject * val = Py_TYPE (it )-> tp_iternext (it );
15071507 if (val == NULL ) {
15081508 if (lz -> strict ) {
15091509 goto check ;
15101510 }
1511- goto exit ;
1511+ goto exit_no_result ;
15121512 }
15131513 stack [i ] = val ;
15141514 nargs ++ ;
@@ -1521,46 +1521,46 @@ map_next(PyObject *self)
15211521 if (PyErr_Occurred ()) {
15221522 if (!PyErr_ExceptionMatches (PyExc_StopIteration )) {
15231523 // next() on argument i raised an exception (not StopIteration)
1524- assert (result == NULL );
1525- goto exit ;
1524+ goto exit_no_result ;
15261525 }
15271526 PyErr_Clear ();
15281527 }
15291528 if (i ) {
15301529 // ValueError: map() argument 2 is shorter than argument 1
15311530 // ValueError: map() argument 3 is shorter than arguments 1-2
15321531 const char * plural = i == 1 ? " " : "s 1-" ;
1533- result = PyErr_Format (PyExc_ValueError ,
1534- "map() argument %d is shorter than argument%s%d" ,
1535- i + 1 , plural , i );
1536- goto exit ;
1532+ PyErr_Format (PyExc_ValueError ,
1533+ "map() argument %d is shorter than argument%s%d" ,
1534+ i + 1 , plural , i );
1535+ goto exit_no_result ;
15371536 }
15381537 for (i = 1 ; i < niters ; i ++ ) {
15391538 PyObject * it = PyTuple_GET_ITEM (lz -> iters , i );
15401539 PyObject * val = (* Py_TYPE (it )-> tp_iternext )(it );
15411540 if (val ) {
15421541 Py_DECREF (val );
15431542 const char * plural = i == 1 ? " " : "s 1-" ;
1544- result = PyErr_Format (PyExc_ValueError ,
1545- "map() argument %d is longer than argument%s%d" ,
1546- i + 1 , plural , i );
1547- goto exit ;
1543+ PyErr_Format (PyExc_ValueError ,
1544+ "map() argument %d is longer than argument%s%d" ,
1545+ i + 1 , plural , i );
1546+ goto exit_no_result ;
15481547 }
15491548 if (PyErr_Occurred ()) {
15501549 if (!PyErr_ExceptionMatches (PyExc_StopIteration )) {
15511550 // next() on argument i raised an exception (not StopIteration)
1552- assert (result == NULL );
1553- goto exit ;
1551+ goto exit_no_result ;
15541552 }
15551553 PyErr_Clear ();
15561554 }
15571555 // Argument i is exhausted. So far so good...
15581556 }
15591557 // All arguments are exhausted. Success!
1558+
1559+ exit_no_result :
15601560 assert (result == NULL );
15611561
15621562exit :
1563- for (i = 0 ; i < nargs ; i ++ ) {
1563+ for (i = 0 ; i < nargs ; i ++ ) {
15641564 Py_DECREF (stack [i ]);
15651565 }
15661566 if (stack != small_stack ) {
0 commit comments