summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/getargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Python/getargs.c')
-rw-r--r--contrib/tools/python3/Python/getargs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/tools/python3/Python/getargs.c b/contrib/tools/python3/Python/getargs.c
index 02bddf0618e..8ca865b53c8 100644
--- a/contrib/tools/python3/Python/getargs.c
+++ b/contrib/tools/python3/Python/getargs.c
@@ -2071,6 +2071,18 @@ parser_clear(struct _PyArg_Parser *parser)
if (parser->initialized == 1) {
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->initialized = 0;
}
static PyObject*