8000 [3.10] bpo-45574: fix warning about `print_escape` being unused (GH-29172) by miss-islington · Pull Request #29176 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.10] bpo-45574: fix warning about print_escape being unused (GH-29172) #29176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.cGH-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
(cherry picked from commit 4bc5473)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
sobolevn authored and miss-islington committed Oct 22, 2021
commit 80fb9e170d006f0423731cee3bdc11de9087a9ed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix warning about ``print_escape`` being unused.
2 changes: 2 additions & 0 deletions Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,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)
{
Expand All @@ -1020,6 +1021,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 */

Expand Down
0