From 3c57971a2d3b6d2c6fd1f525ba2108fccb35add2 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Tue, 15 Nov 2022 09:45:11 -0700 Subject: 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 --- Python/getargs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Python/getargs.c') diff --git a/Python/getargs.c b/Python/getargs.c index 703462242a..748209d7d7 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 -- cgit v1.2.1