diff options
author | neonene <53406459+neonene@users.noreply.github.com> | 2024-08-02 13:36:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-02 13:36:20 (GMT) |
commit | 9fc1c992d6fcea0b7558c581846eef6bdd811f6c (patch) | |
tree | 7269c36ae0434d6db43692d962475beed71d1c2f /Python | |
parent | b5e6fb39a246bf7ee470d58632cdf588bb9d0298 (diff) | |
download | cpython-9fc1c992d6fcea0b7558c581846eef6bdd811f6c.zip cpython-9fc1c992d6fcea0b7558c581846eef6bdd811f6c.tar.gz cpython-9fc1c992d6fcea0b7558c581846eef6bdd811f6c.tar.bz2 |
gh-122334: Fix crash when importing ssl after re-initialization (#122481)
* Fix crash when importing ssl after re-initialization
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getargs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index b96ce3a..ec2eeb15 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -2030,6 +2030,19 @@ parser_clear(struct _PyArg_Parser *parser) if (parser->is_kwtuple_owned) { Py_CLEAR(parser->kwtuple); } + + if (parser->format) { + parser->fname = NULL; + } + else { + assert(parser->fname != NULL); + } + parser->custom_msg = NULL; + parser->pos = 0; + parser->min = 0; + parser->max = 0; + parser->is_kwtuple_owned = 0; + parser->once.v = 0; } static PyObject* |