gh-122334: Fix crash when importing ssl after re-initialization (#122481)

* Fix crash when importing ssl after re-initialization
This commit is contained in:
neonene 2024-08-02 22:36:20 +09:00 committed by GitHub
parent b5e6fb39a2
commit 9fc1c992d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 0 deletions

View file

@ -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*