summaryrefslogtreecommitdiffstats
path: root/Parser/string_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/string_parser.c')
-rw-r--r--Parser/string_parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index fb2b980..7079b82 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -11,6 +11,11 @@
static int
warn_invalid_escape_sequence(Parser *p, const char *first_invalid_escape, Token *t)
{
+ if (p->call_invalid_rules) {
+ // Do not report warnings if we are in the second pass of the parser
+ // to avoid showing the warning twice.
+ return 0;
+ }
unsigned char c = *first_invalid_escape;
int octal = ('4' <= c && c <= '7');
PyObject *msg =