Skip to content

Commit c2bb3f9

Browse files
authored
gh-135496: Fix f string exclamation mark error typo (#135495)
1 parent 56eabea commit c2bb3f9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Lib/test/test_fstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ def test_conversions(self):
13801380
for conv in ' s', ' s ':
13811381
self.assertAllRaise(SyntaxError,
13821382
"f-string: conversion type must come right after the"
1383-
" exclamanation mark",
1383+
" exclamation mark",
13841384
["f'{3!" + conv + "}'"])
13851385

13861386
self.assertAllRaise(SyntaxError,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix typo in the f-string conversion type error ("exclamanation" -> "exclamation").

Parser/action_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ _PyPegen_check_fstring_conversion(Parser *p, Token* conv_token, expr_ty conv)
965965
if (conv_token->lineno != conv->lineno || conv_token->end_col_offset != conv->col_offset) {
966966
return RAISE_SYNTAX_ERROR_KNOWN_RANGE(
967967
conv_token, conv,
968-
"%c-string: conversion type must come right after the exclamanation mark",
968+
"%c-string: conversion type must come right after the exclamation mark",
969969
TOK_GET_STRING_PREFIX(p->tok)
970970
);
971971
}

0 commit comments

Comments
 (0)