diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-11-15 16:45:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 16:45:11 (GMT) |
commit | 3c57971a2d3b6d2c6fd1f525ba2108fccb35add2 (patch) | |
tree | 697c28707c62e43c9a444af3069304b8fad2e54b /Python/getargs.c | |
parent | 73943cbc4c5e97f71b76150c549d07e8ed00066b (diff) | |
download | cpython-3c57971a2d3b6d2c6fd1f525ba2108fccb35add2.zip cpython-3c57971a2d3b6d2c6fd1f525ba2108fccb35add2.tar.gz cpython-3c57971a2d3b6d2c6fd1f525ba2108fccb35add2.tar.bz2 |
gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)
This is the first of several changes to consolidate non-object globals in core code.
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 7034622..748209d 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -1846,9 +1846,6 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, } -/* List of static parsers. */ -static struct _PyArg_Parser *static_arg_parsers = NULL; - static int scan_keywords(const char * const *keywords, int *ptotal, int *pposonly) { @@ -2024,8 +2021,8 @@ _parser_init(struct _PyArg_Parser *parser) parser->initialized = owned ? 1 : -1; assert(parser->next == NULL); - parser->next = static_arg_parsers; - static_arg_parsers = parser; + parser->next = _PyRuntime.getargs.static_parsers; + _PyRuntime.getargs.static_parsers = parser; return 1; } @@ -2930,14 +2927,14 @@ _PyArg_NoKwnames(const char *funcname, PyObject *kwnames) void _PyArg_Fini(void) { - struct _PyArg_Parser *tmp, *s = static_arg_parsers; + struct _PyArg_Parser *tmp, *s = _PyRuntime.getargs.static_parsers; while (s) { tmp = s->next; s->next = NULL; parser_clear(s); s = tmp; } - static_arg_parsers = NULL; + _PyRuntime.getargs.static_parsers = NULL; } #ifdef __cplusplus |