Skip to content

Commit 4bc5473

Browse files
authored
bpo-45574: fix warning about print_escape being unused (GH-29172)
It used to be like this: <img width="1232" alt="Снимок экрана 2021-10-22 в 23 07 40" src="https://user-images.githubusercontent.com/4660275/138516608-fef6ec01-a96a-40f4-81ef-52265b0f536b.png"> 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 <img width="752" alt="Снимок экрана 2021-10-22 в 23 08 09" src="https://user-images.githubusercontent.com/4660275/138516684-ea503136-1e92-48a5-95bb-419e190d5866.png"> I am not sure, but it also looks like a private thing, it should not affect other users. Automerge-Triggered-By: GH:pablogsal
1 parent 423fa1c commit 4bc5473

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix warning about ``print_escape`` being unused.

Parser/tokenizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ tok_underflow_file(struct tok_state *tok) {
995995
return tok->done == E_OK;
996996
}
997997

998+
#if defined(Py_DEBUG)
998999
static void
9991000
print_escape(FILE *f, const char *s, Py_ssize_t size)
10001001
{
@@ -1021,6 +1022,7 @@ print_escape(FILE *f, const char *s, Py_ssize_t size)
10211022
}
10221023
putc('"', f);
10231024
}
1025+
#endif
10241026

10251027
/* Get next char, updating state; error code goes into tok->done */
10261028

0 commit comments

Comments
 (0)