diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-02-14 17:36:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 17:36:51 -0700 |
commit | 12360aa159c42c7798fd14225d271e6fd84db7eb (patch) | |
tree | ad2b4f0d67c90a5a0be4ff532082fc3468d6d65b /Python/pythonrun.c | |
parent | 278fdd3e3a2492665b2c2888fd2f428f7f59a3f5 (diff) | |
download | cpython-git-12360aa159c42c7798fd14225d271e6fd84db7eb.tar.gz |
bpo-46541: Discover the global strings. (gh-31346)
Instead of manually enumerating the global strings in generate_global_objects.py, we extrapolate the list from usage of _Py_ID() and _Py_STR() in the source files.
This is partly inspired by gh-31261.
https://bugs.python.org/issue46541
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index b34a223918..38ca952838 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -515,6 +515,7 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename, goto finally; if (v == Py_None) { Py_DECREF(v); + _Py_DECLARE_STR(anon_string, "<string>"); *filename = &_Py_STR(anon_string); Py_INCREF(*filename); } @@ -1562,6 +1563,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (arena == NULL) return NULL; + _Py_DECLARE_STR(anon_string, "<string>"); mod = _PyParser_ASTFromString( str, &_Py_STR(anon_string), start, flags, arena); |