◐ Shell
clean mode source ↗

Issue 45574: Warning: ‘print_escape’ defined but not used

Recently, GitHub started to show a new warning:

> Check warning on line 999 in Parser/tokenizer.c
> GitHub Actions / Address sanitizer
> Parser/tokenizer.c#L999
> ‘print_escape’ defined but not used [-Wunused-function]

Link: https://github.com/python/cpython/pull/29158/files#file-parser-tokenizer-c-L999

I guess this happens because `print_escape` is only used when `Py_DEBUG` is set:

```
#if defined(Py_DEBUG)
        if (Py_DebugFlag) {
            printf("line[%d] = ", tok->lineno);
            print_escape(stdout, tok->cur, tok->inp - tok->cur);
            printf("  tok->done = %d\n", tok->done);
        }
#endif
```

Will this be a proper fix? Or do we need it for some other reason?

```
#if defined(Py_DEBUG)
static void
print_escape(FILE *f, const char *s, Py_ssize_t size)
// ...
# endif
```

If it's fine, I will send a PR :)