aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Parser/string_parser.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-12-13 02:43:57 +0300
committershadchin <shadchin@yandex-team.com>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib/tools/python3/src/Parser/string_parser.c
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
downloadydb-5b48aabc614c6d407f885f3b228dc484ad4c5ba9.tar.gz
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib/tools/python3/src/Parser/string_parser.c')
-rw-r--r--contrib/tools/python3/src/Parser/string_parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/tools/python3/src/Parser/string_parser.c b/contrib/tools/python3/src/Parser/string_parser.c
index fb2b9808af..7079b82d04 100644
--- a/contrib/tools/python3/src/Parser/string_parser.c
+++ b/contrib/tools/python3/src/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 =