From: Nikita Sobolev Date: Fri, 22 Oct 2021 21:57:24 +0000 (+0300) Subject: bpo-45574: fix warning about `print_escape` being unused (GH-29172) X-Git-Tag: v3.11.0a2~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bc5473a42c5eae0928430930b897209492e849d;p=thirdparty%2FPython%2Fcpython.git bpo-45574: fix warning about `print_escape` being unused (GH-29172) It used to be like this: Снимок экрана 2021-10-22 в 23 07 40 Quick `grep` tells that it is just used in one place under `Py_DEBUG`: https://github.com/python/cpython/blame/f6e8b80d20159596cf641305bad3a833bedd2f4f/Parser/tokenizer.c#L1047-L1051 Снимок экрана 2021-10-22 в 23 08 09 I am not sure, but it also looks like a private thing, it should not affect other users. Automerge-Triggered-By: GH:pablogsal --- diff --git a/Misc/NEWS.d/next/Library/2021-10-22-23-06-33.bpo-45574.svqA84.rst b/Misc/NEWS.d/next/Library/2021-10-22-23-06-33.bpo-45574.svqA84.rst new file mode 100644 index 000000000000..b404d2447396 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-10-22-23-06-33.bpo-45574.svqA84.rst @@ -0,0 +1 @@ +Fix warning about ``print_escape`` being unused. diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 789a10b28fd1..705da00463d1 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -995,6 +995,7 @@ tok_underflow_file(struct tok_state *tok) { return tok->done == E_OK; } +#if defined(Py_DEBUG) static void print_escape(FILE *f, const char *s, Py_ssize_t size) { @@ -1021,6 +1022,7 @@ print_escape(FILE *f, const char *s, Py_ssize_t size) } putc('"', f); } +#endif /* Get next char, updating state; error code goes into tok->done */