@@ -1693,22 +1693,16 @@ _PyPegen_concatenate_strings(Parser *p, asdl_expr_seq *strings,
16931693}
16941694
16951695stmt_ty
1696- _PyPegen_check_future_import (Parser * p , stmt_ty importfrom ) {
1697- if (importfrom -> kind != ImportFrom_kind ) {
1698- goto exit ;
1699- }
1700- asdl_alias_seq * names = importfrom -> v .ImportFrom .names ;
1701- if (asdl_seq_LEN (names ) != 1 ) {
1702- goto exit ;
1703- }
1704- identifier mod = importfrom -> v .ImportFrom .module ;
1705- if (PyUnicode_CompareWithASCIIString (mod , "__future__" ) != 0 ) {
1706- goto exit ;
1707- }
1708- alias_ty alias = asdl_seq_GET (names , 0 );
1709- if (PyUnicode_CompareWithASCIIString (alias -> name , "barry_as_FLUFL" ) == 0 ) {
1710- p -> flags |= PyPARSE_BARRY_AS_BDFL ;
1696+ _PyPegen_checked_future_import (Parser * p , identifier module , asdl_alias_seq * names , int level ,
1697+ int lineno , int col_offset , int end_lineno , int end_col_offset ,
1698+ PyArena * arena ) {
1699+ if (PyUnicode_CompareWithASCIIString (module , "__future__" ) == 0 ) {
1700+ for (Py_ssize_t i = 0 ; i < asdl_seq_LEN (names ); i ++ ) {
1701+ alias_ty alias = asdl_seq_GET (names , i );
1702+ if (PyUnicode_CompareWithASCIIString (alias -> name , "barry_as_FLUFL" ) == 0 ) {
1703+ p -> flags |= PyPARSE_BARRY_AS_BDFL ;
1704+ }
1705+ }
17111706 }
1712- exit :
1713- return importfrom ;
1707+ return _PyAST_ImportFrom (module , names , level , lineno , col_offset , end_lineno , end_col_offset , arena );
17141708}
0 commit comments