File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,19 +214,19 @@ _PyPegen_parse_string(Parser *p, Token *t)
214214
215215 if (quote != '\'' && quote != '\"' ) {
216216 PyErr_BadInternalCall ();
217- return -1 ;
217+ return NULL ;
218218 }
219219 /* Skip the leading quote char. */
220220 s ++ ;
221221 len = strlen (s );
222222 if (len > INT_MAX ) {
223223 PyErr_SetString (PyExc_OverflowError , "string to parse is too long" );
224- return -1 ;
224+ return NULL ;
225225 }
226226 if (s [-- len ] != quote ) {
227227 /* Last quote char must match the first. */
228228 PyErr_BadInternalCall ();
229- return -1 ;
229+ return NULL ;
230230 }
231231 if (len >= 4 && s [0 ] == quote && s [1 ] == quote ) {
232232 /* A triple quoted string. We've already skipped one quote at
@@ -237,7 +237,7 @@ _PyPegen_parse_string(Parser *p, Token *t)
237237 /* And check that the last two match. */
238238 if (s [-- len ] != quote || s [-- len ] != quote ) {
239239 PyErr_BadInternalCall ();
240- return -1 ;
240+ return NULL ;
241241 }
242242 }
243243
@@ -251,7 +251,7 @@ _PyPegen_parse_string(Parser *p, Token *t)
251251 RAISE_SYNTAX_ERROR (
252252 "bytes can only contain ASCII "
253253 "literal characters" );
254- return -1 ;
254+ return NULL ;
255255 }
256256 }
257257 if (rawmode ) {
You can’t perform that action at this time.
0 commit comments