diff options
author | shadchin <shadchin@yandex-team.com> | 2024-02-07 09:25:06 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2024-02-07 09:40:03 +0300 |
commit | 3139d9ab6df2a7014d19b87582466d17b4f496e2 (patch) | |
tree | 7fcb26a72dac212aa26beaaa7cd769fb1e396b5e /contrib/tools/python3/src/Python | |
parent | 4c04a8d1e278e6ca7ff16c11b74b2f16fc144253 (diff) | |
download | ydb-3139d9ab6df2a7014d19b87582466d17b4f496e2.tar.gz |
Update Python 3 to 3.11.8
Diffstat (limited to 'contrib/tools/python3/src/Python')
-rw-r--r-- | contrib/tools/python3/src/Python/Python-ast.c | 638 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/ceval.c | 14 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c | 347 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/import.c | 2 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/pythonrun.c | 33 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/specialize.c | 28 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/structmember.c | 85 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/symtable.c | 6 | ||||
-rw-r--r-- | contrib/tools/python3/src/Python/sysmodule.c | 2 |
9 files changed, 700 insertions, 455 deletions
diff --git a/contrib/tools/python3/src/Python/Python-ast.c b/contrib/tools/python3/src/Python/Python-ast.c index 9139f6e54f..d5a62b9a1e 100644 --- a/contrib/tools/python3/src/Python/Python-ast.c +++ b/contrib/tools/python3/src/Python/Python-ast.c @@ -9,6 +9,11 @@ #include "structmember.h" #include <stddef.h> +struct validator { + int recursion_depth; /* current recursion depth */ + int recursion_limit; /* recursion limit */ +}; + // Forward declaration static int init_types(struct ast_state *state); @@ -373,7 +378,8 @@ GENERATE_ASDL_SEQ_CONSTRUCTOR(match_case, match_case_ty) GENERATE_ASDL_SEQ_CONSTRUCTOR(pattern, pattern_ty) GENERATE_ASDL_SEQ_CONSTRUCTOR(type_ignore, type_ignore_ty) -static PyObject* ast2obj_mod(struct ast_state *state, void*); +static PyObject* ast2obj_mod(struct ast_state *state, struct validator *vstate, + void*); static const char * const Module_fields[]={ "body", "type_ignores", @@ -394,7 +400,8 @@ static const char * const stmt_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_stmt(struct ast_state *state, void*); +static PyObject* ast2obj_stmt(struct ast_state *state, struct validator + *vstate, void*); static const char * const FunctionDef_fields[]={ "name", "args", @@ -521,7 +528,8 @@ static const char * const expr_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_expr(struct ast_state *state, void*); +static PyObject* ast2obj_expr(struct ast_state *state, struct validator + *vstate, void*); static const char * const BoolOp_fields[]={ "op", "values", @@ -634,12 +642,18 @@ static const char * const Slice_fields[]={ "upper", "step", }; -static PyObject* ast2obj_expr_context(struct ast_state *state, expr_context_ty); -static PyObject* ast2obj_boolop(struct ast_state *state, boolop_ty); -static PyObject* ast2obj_operator(struct ast_state *state, operator_ty); -static PyObject* ast2obj_unaryop(struct ast_state *state, unaryop_ty); -static PyObject* ast2obj_cmpop(struct ast_state *state, cmpop_ty); -static PyObject* ast2obj_comprehension(struct ast_state *state, void*); +static PyObject* ast2obj_expr_context(struct ast_state *state, struct validator + *vstate, expr_context_ty); +static PyObject* ast2obj_boolop(struct ast_state *state, struct validator + *vstate, boolop_ty); +static PyObject* ast2obj_operator(struct ast_state *state, struct validator + *vstate, operator_ty); +static PyObject* ast2obj_unaryop(struct ast_state *state, struct validator + *vstate, unaryop_ty); +static PyObject* ast2obj_cmpop(struct ast_state *state, struct validator + *vstate, cmpop_ty); +static PyObject* ast2obj_comprehension(struct ast_state *state, struct + validator *vstate, void*); static const char * const comprehension_fields[]={ "target", "iter", @@ -652,13 +666,15 @@ static const char * const excepthandler_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_excepthandler(struct ast_state *state, void*); +static PyObject* ast2obj_excepthandler(struct ast_state *state, struct + validator *vstate, void*); static const char * const ExceptHandler_fields[]={ "type", "name", "body", }; -static PyObject* ast2obj_arguments(struct ast_state *state, void*); +static PyObject* ast2obj_arguments(struct ast_state *state, struct validator + *vstate, void*); static const char * const arguments_fields[]={ "posonlyargs", "args", @@ -668,7 +684,8 @@ static const char * const arguments_fields[]={ "kwarg", "defaults", }; -static PyObject* ast2obj_arg(struct ast_state *state, void*); +static PyObject* ast2obj_arg(struct ast_state *state, struct validator *vstate, + void*); static const char * const arg_attributes[] = { "lineno", "col_offset", @@ -680,7 +697,8 @@ static const char * const arg_fields[]={ "annotation", "type_comment", }; -static PyObject* ast2obj_keyword(struct ast_state *state, void*); +static PyObject* ast2obj_keyword(struct ast_state *state, struct validator + *vstate, void*); static const char * const keyword_attributes[] = { "lineno", "col_offset", @@ -691,7 +709,8 @@ static const char * const keyword_fields[]={ "arg", "value", }; -static PyObject* ast2obj_alias(struct ast_state *state, void*); +static PyObject* ast2obj_alias(struct ast_state *state, struct validator + *vstate, void*); static const char * const alias_attributes[] = { "lineno", "col_offset", @@ -702,12 +721,14 @@ static const char * const alias_fields[]={ "name", "asname", }; -static PyObject* ast2obj_withitem(struct ast_state *state, void*); +static PyObject* ast2obj_withitem(struct ast_state *state, struct validator + *vstate, void*); static const char * const withitem_fields[]={ "context_expr", "optional_vars", }; -static PyObject* ast2obj_match_case(struct ast_state *state, void*); +static PyObject* ast2obj_match_case(struct ast_state *state, struct validator + *vstate, void*); static const char * const match_case_fields[]={ "pattern", "guard", @@ -719,7 +740,8 @@ static const char * const pattern_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_pattern(struct ast_state *state, void*); +static PyObject* ast2obj_pattern(struct ast_state *state, struct validator + *vstate, void*); static const char * const MatchValue_fields[]={ "value", }; @@ -750,7 +772,8 @@ static const char * const MatchAs_fields[]={ static const char * const MatchOr_fields[]={ "patterns", }; -static PyObject* ast2obj_type_ignore(struct ast_state *state, void*); +static PyObject* ast2obj_type_ignore(struct ast_state *state, struct validator + *vstate, void*); static const char * const TypeIgnore_fields[]={ "lineno", "tag", @@ -973,7 +996,8 @@ add_attributes(struct ast_state *state, PyObject *type, const char * const *attr /* Conversion AST -> Python */ -static PyObject* ast2obj_list(struct ast_state *state, asdl_seq *seq, PyObject* (*func)(struct ast_state *state, void*)) +static PyObject* ast2obj_list(struct ast_state *state, struct validator *vstate, asdl_seq *seq, + PyObject* (*func)(struct ast_state *state, struct validator *vstate, void*)) { Py_ssize_t i, n = asdl_seq_LEN(seq); PyObject *result = PyList_New(n); @@ -981,7 +1005,7 @@ static PyObject* ast2obj_list(struct ast_state *state, asdl_seq *seq, PyObject* if (!result) return NULL; for (i = 0; i < n; i++) { - value = func(state, asdl_seq_GET_UNTYPED(seq, i)); + value = func(state, vstate, asdl_seq_GET_UNTYPED(seq, i)); if (!value) { Py_DECREF(result); return NULL; @@ -991,7 +1015,7 @@ static PyObject* ast2obj_list(struct ast_state *state, asdl_seq *seq, PyObject* return result; } -static PyObject* ast2obj_object(struct ast_state *Py_UNUSED(state), void *o) +static PyObject* ast2obj_object(struct ast_state *Py_UNUSED(state), struct validator *Py_UNUSED(vstate), void *o) { if (!o) o = Py_None; @@ -1002,7 +1026,7 @@ static PyObject* ast2obj_object(struct ast_state *Py_UNUSED(state), void *o) #define ast2obj_identifier ast2obj_object #define ast2obj_string ast2obj_object -static PyObject* ast2obj_int(struct ast_state *Py_UNUSED(state), long b) +static PyObject* ast2obj_int(struct ast_state *Py_UNUSED(state), struct validator *Py_UNUSED(vstate), long b) { return PyLong_FromLong(b); } @@ -1851,8 +1875,6 @@ init_types(struct ast_state *state) "TypeIgnore(int lineno, string tag)"); if (!state->TypeIgnore_type) return 0; - state->recursion_depth = 0; - state->recursion_limit = 0; state->initialized = 1; return 1; } @@ -3604,7 +3626,7 @@ _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena) PyObject* -ast2obj_mod(struct ast_state *state, void* _o) +ast2obj_mod(struct ast_state *state, struct validator *vstate, void* _o) { mod_ty o = (mod_ty)_o; PyObject *result = NULL, *value = NULL; @@ -3612,7 +3634,7 @@ ast2obj_mod(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -3622,12 +3644,14 @@ ast2obj_mod(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Module_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Module.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Module.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Module.type_ignores, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.Module.type_ignores, ast2obj_type_ignore); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_ignores, value) == -1) @@ -3638,7 +3662,7 @@ ast2obj_mod(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Interactive_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Interactive.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Interactive.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) @@ -3649,7 +3673,7 @@ ast2obj_mod(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Expression_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Expression.body); + value = ast2obj_expr(state, vstate, o->v.Expression.body); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; @@ -3659,29 +3683,31 @@ ast2obj_mod(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->FunctionType_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.FunctionType.argtypes, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.FunctionType.argtypes, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->argtypes, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.FunctionType.returns); + value = ast2obj_expr(state, vstate, o->v.FunctionType.returns); if (!value) goto failed; if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); break; } - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_stmt(struct ast_state *state, void* _o) +ast2obj_stmt(struct ast_state *state, struct validator *vstate, void* _o) { stmt_ty o = (stmt_ty)_o; PyObject *result = NULL, *value = NULL; @@ -3689,7 +3715,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -3699,34 +3725,35 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->FunctionDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.FunctionDef.name); + value = ast2obj_identifier(state, vstate, o->v.FunctionDef.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arguments(state, o->v.FunctionDef.args); + value = ast2obj_arguments(state, vstate, o->v.FunctionDef.args); if (!value) goto failed; if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.FunctionDef.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.FunctionDef.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.FunctionDef.decorator_list, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.FunctionDef.decorator_list, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.FunctionDef.returns); + value = ast2obj_expr(state, vstate, o->v.FunctionDef.returns); if (!value) goto failed; if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.FunctionDef.type_comment); + value = ast2obj_string(state, vstate, o->v.FunctionDef.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -3736,35 +3763,36 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->AsyncFunctionDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.AsyncFunctionDef.name); + value = ast2obj_identifier(state, vstate, o->v.AsyncFunctionDef.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arguments(state, o->v.AsyncFunctionDef.args); + value = ast2obj_arguments(state, vstate, o->v.AsyncFunctionDef.args); if (!value) goto failed; if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.AsyncFunctionDef.body, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.AsyncFunctionDef.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.AsyncFunctionDef.decorator_list, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AsyncFunctionDef.returns); + value = ast2obj_expr(state, vstate, o->v.AsyncFunctionDef.returns); if (!value) goto failed; if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncFunctionDef.type_comment); + value = ast2obj_string(state, vstate, o->v.AsyncFunctionDef.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -3774,30 +3802,31 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->ClassDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.ClassDef.name); + value = ast2obj_identifier(state, vstate, o->v.ClassDef.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ClassDef.bases, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.ClassDef.bases, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->bases, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ClassDef.keywords, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.ClassDef.keywords, ast2obj_keyword); if (!value) goto failed; if (PyObject_SetAttr(result, state->keywords, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ClassDef.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.ClassDef.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ClassDef.decorator_list, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.ClassDef.decorator_list, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->decorator_list, value) == -1) @@ -3808,7 +3837,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Return_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Return.value); + value = ast2obj_expr(state, vstate, o->v.Return.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -3818,7 +3847,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Delete_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Delete.targets, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Delete.targets, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->targets, value) == -1) @@ -3829,18 +3858,18 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Assign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Assign.targets, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Assign.targets, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->targets, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Assign.value); + value = ast2obj_expr(state, vstate, o->v.Assign.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.Assign.type_comment); + value = ast2obj_string(state, vstate, o->v.Assign.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -3850,17 +3879,17 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->AugAssign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.AugAssign.target); + value = ast2obj_expr(state, vstate, o->v.AugAssign.target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_operator(state, o->v.AugAssign.op); + value = ast2obj_operator(state, vstate, o->v.AugAssign.op); if (!value) goto failed; if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AugAssign.value); + value = ast2obj_expr(state, vstate, o->v.AugAssign.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -3870,22 +3899,22 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->AnnAssign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.AnnAssign.target); + value = ast2obj_expr(state, vstate, o->v.AnnAssign.target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AnnAssign.annotation); + value = ast2obj_expr(state, vstate, o->v.AnnAssign.annotation); if (!value) goto failed; if (PyObject_SetAttr(result, state->annotation, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AnnAssign.value); + value = ast2obj_expr(state, vstate, o->v.AnnAssign.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->v.AnnAssign.simple); + value = ast2obj_int(state, vstate, o->v.AnnAssign.simple); if (!value) goto failed; if (PyObject_SetAttr(result, state->simple, value) == -1) goto failed; @@ -3895,27 +3924,29 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->For_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.For.target); + value = ast2obj_expr(state, vstate, o->v.For.target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.For.iter); + value = ast2obj_expr(state, vstate, o->v.For.iter); if (!value) goto failed; if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.For.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.For.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.For.orelse, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.For.orelse, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.For.type_comment); + value = ast2obj_string(state, vstate, o->v.For.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -3925,29 +3956,29 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->AsyncFor_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.AsyncFor.target); + value = ast2obj_expr(state, vstate, o->v.AsyncFor.target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AsyncFor.iter); + value = ast2obj_expr(state, vstate, o->v.AsyncFor.iter); if (!value) goto failed; if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.AsyncFor.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.AsyncFor.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.AsyncFor.orelse, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.AsyncFor.orelse, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncFor.type_comment); + value = ast2obj_string(state, vstate, o->v.AsyncFor.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -3957,17 +3988,19 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->While_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.While.test); + value = ast2obj_expr(state, vstate, o->v.While.test); if (!value) goto failed; if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.While.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.While.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.While.orelse, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.While.orelse, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; @@ -3977,17 +4010,19 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->If_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.If.test); + value = ast2obj_expr(state, vstate, o->v.If.test); if (!value) goto failed; if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.If.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.If.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.If.orelse, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.If.orelse, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; @@ -3997,18 +4032,19 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->With_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.With.items, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.With.items, ast2obj_withitem); if (!value) goto failed; if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.With.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.With.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.With.type_comment); + value = ast2obj_string(state, vstate, o->v.With.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -4018,19 +4054,19 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->AsyncWith_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.AsyncWith.items, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.AsyncWith.items, ast2obj_withitem); if (!value) goto failed; if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.AsyncWith.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.AsyncWith.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncWith.type_comment); + value = ast2obj_string(state, vstate, o->v.AsyncWith.type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; @@ -4040,12 +4076,12 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Match_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Match.subject); + value = ast2obj_expr(state, vstate, o->v.Match.subject); if (!value) goto failed; if (PyObject_SetAttr(result, state->subject, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Match.cases, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Match.cases, ast2obj_match_case); if (!value) goto failed; if (PyObject_SetAttr(result, state->cases, value) == -1) @@ -4056,12 +4092,12 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Raise_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Raise.exc); + value = ast2obj_expr(state, vstate, o->v.Raise.exc); if (!value) goto failed; if (PyObject_SetAttr(result, state->exc, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Raise.cause); + value = ast2obj_expr(state, vstate, o->v.Raise.cause); if (!value) goto failed; if (PyObject_SetAttr(result, state->cause, value) == -1) goto failed; @@ -4071,23 +4107,25 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Try_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Try.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Try.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Try.handlers, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Try.handlers, ast2obj_excepthandler); if (!value) goto failed; if (PyObject_SetAttr(result, state->handlers, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Try.orelse, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Try.orelse, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Try.finalbody, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Try.finalbody, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->finalbody, value) == -1) @@ -4098,24 +4136,25 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->TryStar_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.TryStar.body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.TryStar.body, + ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.TryStar.handlers, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.TryStar.handlers, ast2obj_excepthandler); if (!value) goto failed; if (PyObject_SetAttr(result, state->handlers, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.TryStar.orelse, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.TryStar.orelse, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.TryStar.finalbody, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.TryStar.finalbody, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->finalbody, value) == -1) @@ -4126,12 +4165,12 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Assert_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Assert.test); + value = ast2obj_expr(state, vstate, o->v.Assert.test); if (!value) goto failed; if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Assert.msg); + value = ast2obj_expr(state, vstate, o->v.Assert.msg); if (!value) goto failed; if (PyObject_SetAttr(result, state->msg, value) == -1) goto failed; @@ -4141,7 +4180,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Import_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Import.names, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Import.names, ast2obj_alias); if (!value) goto failed; if (PyObject_SetAttr(result, state->names, value) == -1) @@ -4152,18 +4191,18 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->ImportFrom_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.ImportFrom.module); + value = ast2obj_identifier(state, vstate, o->v.ImportFrom.module); if (!value) goto failed; if (PyObject_SetAttr(result, state->module, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ImportFrom.names, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.ImportFrom.names, ast2obj_alias); if (!value) goto failed; if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->v.ImportFrom.level); + value = ast2obj_int(state, vstate, o->v.ImportFrom.level); if (!value) goto failed; if (PyObject_SetAttr(result, state->level, value) == -1) goto failed; @@ -4173,7 +4212,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Global_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Global.names, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Global.names, ast2obj_identifier); if (!value) goto failed; if (PyObject_SetAttr(result, state->names, value) == -1) @@ -4184,7 +4223,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Nonlocal_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Nonlocal.names, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Nonlocal.names, ast2obj_identifier); if (!value) goto failed; if (PyObject_SetAttr(result, state->names, value) == -1) @@ -4195,7 +4234,7 @@ ast2obj_stmt(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Expr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Expr.value); + value = ast2obj_expr(state, vstate, o->v.Expr.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -4217,36 +4256,37 @@ ast2obj_stmt(struct ast_state *state, void* _o) if (!result) goto failed; break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_expr(struct ast_state *state, void* _o) +ast2obj_expr(struct ast_state *state, struct validator *vstate, void* _o) { expr_ty o = (expr_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4254,7 +4294,7 @@ ast2obj_expr(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -4264,12 +4304,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->BoolOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_boolop(state, o->v.BoolOp.op); + value = ast2obj_boolop(state, vstate, o->v.BoolOp.op); if (!value) goto failed; if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.BoolOp.values, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.BoolOp.values, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->values, value) == -1) @@ -4280,12 +4320,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->NamedExpr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.NamedExpr.target); + value = ast2obj_expr(state, vstate, o->v.NamedExpr.target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.NamedExpr.value); + value = ast2obj_expr(state, vstate, o->v.NamedExpr.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -4295,17 +4335,17 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->BinOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.BinOp.left); + value = ast2obj_expr(state, vstate, o->v.BinOp.left); if (!value) goto failed; if (PyObject_SetAttr(result, state->left, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_operator(state, o->v.BinOp.op); + value = ast2obj_operator(state, vstate, o->v.BinOp.op); if (!value) goto failed; if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.BinOp.right); + value = ast2obj_expr(state, vstate, o->v.BinOp.right); if (!value) goto failed; if (PyObject_SetAttr(result, state->right, value) == -1) goto failed; @@ -4315,12 +4355,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->UnaryOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_unaryop(state, o->v.UnaryOp.op); + value = ast2obj_unaryop(state, vstate, o->v.UnaryOp.op); if (!value) goto failed; if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.UnaryOp.operand); + value = ast2obj_expr(state, vstate, o->v.UnaryOp.operand); if (!value) goto failed; if (PyObject_SetAttr(result, state->operand, value) == -1) goto failed; @@ -4330,12 +4370,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Lambda_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_arguments(state, o->v.Lambda.args); + value = ast2obj_arguments(state, vstate, o->v.Lambda.args); if (!value) goto failed; if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Lambda.body); + value = ast2obj_expr(state, vstate, o->v.Lambda.body); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; @@ -4345,17 +4385,17 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->IfExp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.IfExp.test); + value = ast2obj_expr(state, vstate, o->v.IfExp.test); if (!value) goto failed; if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.IfExp.body); + value = ast2obj_expr(state, vstate, o->v.IfExp.body); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.IfExp.orelse); + value = ast2obj_expr(state, vstate, o->v.IfExp.orelse); if (!value) goto failed; if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; @@ -4365,12 +4405,14 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Dict_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Dict.keys, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Dict.keys, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->keys, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Dict.values, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Dict.values, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; @@ -4380,7 +4422,8 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Set_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Set.elts, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Set.elts, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; @@ -4390,12 +4433,13 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->ListComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.ListComp.elt); + value = ast2obj_expr(state, vstate, o->v.ListComp.elt); if (!value) goto failed; if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ListComp.generators, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.ListComp.generators, ast2obj_comprehension); if (!value) goto failed; if (PyObject_SetAttr(result, state->generators, value) == -1) @@ -4406,12 +4450,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->SetComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.SetComp.elt); + value = ast2obj_expr(state, vstate, o->v.SetComp.elt); if (!value) goto failed; if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.SetComp.generators, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.SetComp.generators, ast2obj_comprehension); if (!value) goto failed; if (PyObject_SetAttr(result, state->generators, value) == -1) @@ -4422,17 +4466,18 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->DictComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.DictComp.key); + value = ast2obj_expr(state, vstate, o->v.DictComp.key); if (!value) goto failed; if (PyObject_SetAttr(result, state->key, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.DictComp.value); + value = ast2obj_expr(state, vstate, o->v.DictComp.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.DictComp.generators, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.DictComp.generators, ast2obj_comprehension); if (!value) goto failed; if (PyObject_SetAttr(result, state->generators, value) == -1) @@ -4443,12 +4488,13 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->GeneratorExp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.GeneratorExp.elt); + value = ast2obj_expr(state, vstate, o->v.GeneratorExp.elt); if (!value) goto failed; if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.GeneratorExp.generators, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.GeneratorExp.generators, ast2obj_comprehension); if (!value) goto failed; if (PyObject_SetAttr(result, state->generators, value) == -1) @@ -4459,7 +4505,7 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Await_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Await.value); + value = ast2obj_expr(state, vstate, o->v.Await.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -4469,7 +4515,7 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Yield_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Yield.value); + value = ast2obj_expr(state, vstate, o->v.Yield.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -4479,7 +4525,7 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->YieldFrom_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.YieldFrom.value); + value = ast2obj_expr(state, vstate, o->v.YieldFrom.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -4489,7 +4535,7 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Compare_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Compare.left); + value = ast2obj_expr(state, vstate, o->v.Compare.left); if (!value) goto failed; if (PyObject_SetAttr(result, state->left, value) == -1) goto failed; @@ -4499,14 +4545,14 @@ ast2obj_expr(struct ast_state *state, void* _o) value = PyList_New(n); if (!value) goto failed; for(i = 0; i < n; i++) - PyList_SET_ITEM(value, i, ast2obj_cmpop(state, (cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i))); + PyList_SET_ITEM(value, i, ast2obj_cmpop(state, vstate, (cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i))); } if (!value) goto failed; if (PyObject_SetAttr(result, state->ops, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Compare.comparators, - ast2obj_expr); + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.Compare.comparators, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->comparators, value) == -1) goto failed; @@ -4516,17 +4562,18 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Call_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Call.func); + value = ast2obj_expr(state, vstate, o->v.Call.func); if (!value) goto failed; if (PyObject_SetAttr(result, state->func, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Call.args, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Call.args, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.Call.keywords, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Call.keywords, ast2obj_keyword); if (!value) goto failed; if (PyObject_SetAttr(result, state->keywords, value) == -1) @@ -4537,17 +4584,17 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->FormattedValue_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.FormattedValue.value); + value = ast2obj_expr(state, vstate, o->v.FormattedValue.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->v.FormattedValue.conversion); + value = ast2obj_int(state, vstate, o->v.FormattedValue.conversion); if (!value) goto failed; if (PyObject_SetAttr(result, state->conversion, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.FormattedValue.format_spec); + value = ast2obj_expr(state, vstate, o->v.FormattedValue.format_spec); if (!value) goto failed; if (PyObject_SetAttr(result, state->format_spec, value) == -1) goto failed; @@ -4557,7 +4604,7 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->JoinedStr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.JoinedStr.values, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.JoinedStr.values, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->values, value) == -1) @@ -4568,12 +4615,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Constant_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_constant(state, o->v.Constant.value); + value = ast2obj_constant(state, vstate, o->v.Constant.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.Constant.kind); + value = ast2obj_string(state, vstate, o->v.Constant.kind); if (!value) goto failed; if (PyObject_SetAttr(result, state->kind, value) == -1) goto failed; @@ -4583,17 +4630,17 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Attribute_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Attribute.value); + value = ast2obj_expr(state, vstate, o->v.Attribute.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->v.Attribute.attr); + value = ast2obj_identifier(state, vstate, o->v.Attribute.attr); if (!value) goto failed; if (PyObject_SetAttr(result, state->attr, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.Attribute.ctx); + value = ast2obj_expr_context(state, vstate, o->v.Attribute.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4603,17 +4650,17 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Subscript_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Subscript.value); + value = ast2obj_expr(state, vstate, o->v.Subscript.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Subscript.slice); + value = ast2obj_expr(state, vstate, o->v.Subscript.slice); if (!value) goto failed; if (PyObject_SetAttr(result, state->slice, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.Subscript.ctx); + value = ast2obj_expr_context(state, vstate, o->v.Subscript.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4623,12 +4670,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Starred_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Starred.value); + value = ast2obj_expr(state, vstate, o->v.Starred.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.Starred.ctx); + value = ast2obj_expr_context(state, vstate, o->v.Starred.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4638,12 +4685,12 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Name_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.Name.id); + value = ast2obj_identifier(state, vstate, o->v.Name.id); if (!value) goto failed; if (PyObject_SetAttr(result, state->id, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.Name.ctx); + value = ast2obj_expr_context(state, vstate, o->v.Name.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4653,12 +4700,13 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->List_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.List.elts, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.List.elts, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.List.ctx); + value = ast2obj_expr_context(state, vstate, o->v.List.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4668,12 +4716,13 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Tuple_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.Tuple.elts, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.Tuple.elts, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(state, o->v.Tuple.ctx); + value = ast2obj_expr_context(state, vstate, o->v.Tuple.ctx); if (!value) goto failed; if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; @@ -4683,52 +4732,54 @@ ast2obj_expr(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->Slice_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.Slice.lower); + value = ast2obj_expr(state, vstate, o->v.Slice.lower); if (!value) goto failed; if (PyObject_SetAttr(result, state->lower, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Slice.upper); + value = ast2obj_expr(state, vstate, o->v.Slice.upper); if (!value) goto failed; if (PyObject_SetAttr(result, state->upper, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Slice.step); + value = ast2obj_expr(state, vstate, o->v.Slice.step); if (!value) goto failed; if (PyObject_SetAttr(result, state->step, value) == -1) goto failed; Py_DECREF(value); break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } -PyObject* ast2obj_expr_context(struct ast_state *state, expr_context_ty o) +PyObject* ast2obj_expr_context(struct ast_state *state, struct validator + *vstate, expr_context_ty o) { switch(o) { case Load: @@ -4743,7 +4794,8 @@ PyObject* ast2obj_expr_context(struct ast_state *state, expr_context_ty o) } Py_UNREACHABLE(); } -PyObject* ast2obj_boolop(struct ast_state *state, boolop_ty o) +PyObject* ast2obj_boolop(struct ast_state *state, struct validator *vstate, + boolop_ty o) { switch(o) { case And: @@ -4755,7 +4807,8 @@ PyObject* ast2obj_boolop(struct ast_state *state, boolop_ty o) } Py_UNREACHABLE(); } -PyObject* ast2obj_operator(struct ast_state *state, operator_ty o) +PyObject* ast2obj_operator(struct ast_state *state, struct validator *vstate, + operator_ty o) { switch(o) { case Add: @@ -4800,7 +4853,8 @@ PyObject* ast2obj_operator(struct ast_state *state, operator_ty o) } Py_UNREACHABLE(); } -PyObject* ast2obj_unaryop(struct ast_state *state, unaryop_ty o) +PyObject* ast2obj_unaryop(struct ast_state *state, struct validator *vstate, + unaryop_ty o) { switch(o) { case Invert: @@ -4818,7 +4872,8 @@ PyObject* ast2obj_unaryop(struct ast_state *state, unaryop_ty o) } Py_UNREACHABLE(); } -PyObject* ast2obj_cmpop(struct ast_state *state, cmpop_ty o) +PyObject* ast2obj_cmpop(struct ast_state *state, struct validator *vstate, + cmpop_ty o) { switch(o) { case Eq: @@ -4855,7 +4910,8 @@ PyObject* ast2obj_cmpop(struct ast_state *state, cmpop_ty o) Py_UNREACHABLE(); } PyObject* -ast2obj_comprehension(struct ast_state *state, void* _o) +ast2obj_comprehension(struct ast_state *state, struct validator *vstate, void* + _o) { comprehension_ty o = (comprehension_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4863,7 +4919,7 @@ ast2obj_comprehension(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -4871,36 +4927,38 @@ ast2obj_comprehension(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->comprehension_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_expr(state, o->target); + value = ast2obj_expr(state, vstate, o->target); if (!value) goto failed; if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->iter); + value = ast2obj_expr(state, vstate, o->iter); if (!value) goto failed; if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->ifs, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->ifs, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->ifs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->is_async); + value = ast2obj_int(state, vstate, o->is_async); if (!value) goto failed; if (PyObject_SetAttr(result, state->is_async, value) == -1) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_excepthandler(struct ast_state *state, void* _o) +ast2obj_excepthandler(struct ast_state *state, struct validator *vstate, void* + _o) { excepthandler_ty o = (excepthandler_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4908,7 +4966,7 @@ ast2obj_excepthandler(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -4918,17 +4976,17 @@ ast2obj_excepthandler(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->ExceptHandler_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.ExceptHandler.type); + value = ast2obj_expr(state, vstate, o->v.ExceptHandler.type); if (!value) goto failed; if (PyObject_SetAttr(result, state->type, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->v.ExceptHandler.name); + value = ast2obj_identifier(state, vstate, o->v.ExceptHandler.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.ExceptHandler.body, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.ExceptHandler.body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) @@ -4936,36 +4994,37 @@ ast2obj_excepthandler(struct ast_state *state, void* _o) Py_DECREF(value); break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_arguments(struct ast_state *state, void* _o) +ast2obj_arguments(struct ast_state *state, struct validator *vstate, void* _o) { arguments_ty o = (arguments_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4973,7 +5032,7 @@ ast2obj_arguments(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -4981,51 +5040,53 @@ ast2obj_arguments(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->arguments_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_list(state, (asdl_seq*)o->posonlyargs, ast2obj_arg); + value = ast2obj_list(state, vstate, (asdl_seq*)o->posonlyargs, ast2obj_arg); if (!value) goto failed; if (PyObject_SetAttr(result, state->posonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->args, ast2obj_arg); + value = ast2obj_list(state, vstate, (asdl_seq*)o->args, ast2obj_arg); if (!value) goto failed; if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(state, o->vararg); + value = ast2obj_arg(state, vstate, o->vararg); if (!value) goto failed; if (PyObject_SetAttr(result, state->vararg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->kwonlyargs, ast2obj_arg); + value = ast2obj_list(state, vstate, (asdl_seq*)o->kwonlyargs, ast2obj_arg); if (!value) goto failed; if (PyObject_SetAttr(result, state->kwonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->kw_defaults, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->kw_defaults, + ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->kw_defaults, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(state, o->kwarg); + value = ast2obj_arg(state, vstate, o->kwarg); if (!value) goto failed; if (PyObject_SetAttr(result, state->kwarg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->defaults, ast2obj_expr); + value = ast2obj_list(state, vstate, (asdl_seq*)o->defaults, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->defaults, value) == -1) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_arg(struct ast_state *state, void* _o) +ast2obj_arg(struct ast_state *state, struct validator *vstate, void* _o) { arg_ty o = (arg_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5033,7 +5094,7 @@ ast2obj_arg(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5041,51 +5102,52 @@ ast2obj_arg(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->arg_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(state, o->arg); + value = ast2obj_identifier(state, vstate, o->arg); if (!value) goto failed; if (PyObject_SetAttr(result, state->arg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->annotation); + value = ast2obj_expr(state, vstate, o->annotation); if (!value) goto failed; if (PyObject_SetAttr(result, state->annotation, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->type_comment); + value = ast2obj_string(state, vstate, o->type_comment); if (!value) goto failed; if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_keyword(struct ast_state *state, void* _o) +ast2obj_keyword(struct ast_state *state, struct validator *vstate, void* _o) { keyword_ty o = (keyword_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5093,7 +5155,7 @@ ast2obj_keyword(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5101,46 +5163,47 @@ ast2obj_keyword(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->keyword_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(state, o->arg); + value = ast2obj_identifier(state, vstate, o->arg); if (!value) goto failed; if (PyObject_SetAttr(result, state->arg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->value); + value = ast2obj_expr(state, vstate, o->value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_alias(struct ast_state *state, void* _o) +ast2obj_alias(struct ast_state *state, struct validator *vstate, void* _o) { alias_ty o = (alias_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5148,7 +5211,7 @@ ast2obj_alias(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5156,46 +5219,47 @@ ast2obj_alias(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->alias_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(state, o->name); + value = ast2obj_identifier(state, vstate, o->name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->asname); + value = ast2obj_identifier(state, vstate, o->asname); if (!value) goto failed; if (PyObject_SetAttr(result, state->asname, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_withitem(struct ast_state *state, void* _o) +ast2obj_withitem(struct ast_state *state, struct validator *vstate, void* _o) { withitem_ty o = (withitem_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5203,7 +5267,7 @@ ast2obj_withitem(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5211,26 +5275,27 @@ ast2obj_withitem(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->withitem_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_expr(state, o->context_expr); + value = ast2obj_expr(state, vstate, o->context_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->context_expr, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->optional_vars); + value = ast2obj_expr(state, vstate, o->optional_vars); if (!value) goto failed; if (PyObject_SetAttr(result, state->optional_vars, value) == -1) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_match_case(struct ast_state *state, void* _o) +ast2obj_match_case(struct ast_state *state, struct validator *vstate, void* _o) { match_case_ty o = (match_case_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5238,7 +5303,7 @@ ast2obj_match_case(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5246,31 +5311,32 @@ ast2obj_match_case(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->match_case_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_pattern(state, o->pattern); + value = ast2obj_pattern(state, vstate, o->pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->pattern, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->guard); + value = ast2obj_expr(state, vstate, o->guard); if (!value) goto failed; if (PyObject_SetAttr(result, state->guard, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->body, ast2obj_stmt); + value = ast2obj_list(state, vstate, (asdl_seq*)o->body, ast2obj_stmt); if (!value) goto failed; if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_pattern(struct ast_state *state, void* _o) +ast2obj_pattern(struct ast_state *state, struct validator *vstate, void* _o) { pattern_ty o = (pattern_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5278,7 +5344,7 @@ ast2obj_pattern(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5288,7 +5354,7 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchValue_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.MatchValue.value); + value = ast2obj_expr(state, vstate, o->v.MatchValue.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -5298,7 +5364,7 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchSingleton_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_constant(state, o->v.MatchSingleton.value); + value = ast2obj_constant(state, vstate, o->v.MatchSingleton.value); if (!value) goto failed; if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; @@ -5308,7 +5374,8 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchSequence_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.MatchSequence.patterns, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.MatchSequence.patterns, ast2obj_pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->patterns, value) == -1) @@ -5319,19 +5386,20 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchMapping_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.MatchMapping.keys, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.MatchMapping.keys, ast2obj_expr); if (!value) goto failed; if (PyObject_SetAttr(result, state->keys, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.MatchMapping.patterns, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.MatchMapping.patterns, ast2obj_pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->patterns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->v.MatchMapping.rest); + value = ast2obj_identifier(state, vstate, o->v.MatchMapping.rest); if (!value) goto failed; if (PyObject_SetAttr(result, state->rest, value) == -1) goto failed; @@ -5341,24 +5409,27 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchClass_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(state, o->v.MatchClass.cls); + value = ast2obj_expr(state, vstate, o->v.MatchClass.cls); if (!value) goto failed; if (PyObject_SetAttr(result, state->cls, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.MatchClass.patterns, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.MatchClass.patterns, ast2obj_pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->patterns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.MatchClass.kwd_attrs, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.MatchClass.kwd_attrs, ast2obj_identifier); if (!value) goto failed; if (PyObject_SetAttr(result, state->kwd_attrs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, (asdl_seq*)o->v.MatchClass.kwd_patterns, + value = ast2obj_list(state, vstate, + (asdl_seq*)o->v.MatchClass.kwd_patterns, ast2obj_pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->kwd_patterns, value) == -1) @@ -5369,7 +5440,7 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchStar_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(state, o->v.MatchStar.name); + value = ast2obj_identifier(state, vstate, o->v.MatchStar.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; @@ -5379,12 +5450,12 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchAs_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_pattern(state, o->v.MatchAs.pattern); + value = ast2obj_pattern(state, vstate, o->v.MatchAs.pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->pattern, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->v.MatchAs.name); + value = ast2obj_identifier(state, vstate, o->v.MatchAs.name); if (!value) goto failed; if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; @@ -5394,7 +5465,7 @@ ast2obj_pattern(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->MatchOr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, (asdl_seq*)o->v.MatchOr.patterns, + value = ast2obj_list(state, vstate, (asdl_seq*)o->v.MatchOr.patterns, ast2obj_pattern); if (!value) goto failed; if (PyObject_SetAttr(result, state->patterns, value) == -1) @@ -5402,36 +5473,37 @@ ast2obj_pattern(struct ast_state *state, void* _o) Py_DECREF(value); break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, vstate, o->lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, vstate, o->col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_lineno); + value = ast2obj_int(state, vstate, o->end_lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->end_col_offset); + value = ast2obj_int(state, vstate, o->end_col_offset); if (!value) goto failed; if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; } PyObject* -ast2obj_type_ignore(struct ast_state *state, void* _o) +ast2obj_type_ignore(struct ast_state *state, struct validator *vstate, void* _o) { type_ignore_ty o = (type_ignore_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5439,7 +5511,7 @@ ast2obj_type_ignore(struct ast_state *state, void* _o) if (!o) { Py_RETURN_NONE; } - if (++state->recursion_depth > state->recursion_limit) { + if (++vstate->recursion_depth > vstate->recursion_limit) { PyErr_SetString(PyExc_RecursionError, "maximum recursion depth exceeded during ast construction"); return 0; @@ -5449,21 +5521,22 @@ ast2obj_type_ignore(struct ast_state *state, void* _o) tp = (PyTypeObject *)state->TypeIgnore_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_int(state, o->v.TypeIgnore.lineno); + value = ast2obj_int(state, vstate, o->v.TypeIgnore.lineno); if (!value) goto failed; if (PyObject_SetAttr(result, state->lineno, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.TypeIgnore.tag); + value = ast2obj_string(state, vstate, o->v.TypeIgnore.tag); if (!value) goto failed; if (PyObject_SetAttr(result, state->tag, value) == -1) goto failed; Py_DECREF(value); break; } - state->recursion_depth--; + vstate->recursion_depth--; return result; failed: + vstate->recursion_depth--; Py_XDECREF(value); Py_XDECREF(result); return NULL; @@ -12328,23 +12401,24 @@ PyObject* PyAST_mod2obj(mod_ty t) int COMPILER_STACK_FRAME_SCALE = 3; PyThreadState *tstate = _PyThreadState_GET(); if (!tstate) { - return 0; + return NULL; } - state->recursion_limit = (recursion_limit < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? + struct validator vstate; + vstate.recursion_limit = (recursion_limit < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? recursion_limit * COMPILER_STACK_FRAME_SCALE : recursion_limit; int recursion_depth = tstate->recursion_limit - tstate->recursion_remaining; starting_recursion_depth = (recursion_depth < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? recursion_depth * COMPILER_STACK_FRAME_SCALE : recursion_depth; - state->recursion_depth = starting_recursion_depth; + vstate.recursion_depth = starting_recursion_depth; - PyObject *result = ast2obj_mod(state, t); + PyObject *result = ast2obj_mod(state, &vstate, t); /* Check that the recursion depth counting balanced correctly */ - if (result && state->recursion_depth != starting_recursion_depth) { + if (result && vstate.recursion_depth != starting_recursion_depth) { PyErr_Format(PyExc_SystemError, "AST constructor recursion depth mismatch (before=%d, after=%d)", - starting_recursion_depth, state->recursion_depth); - return 0; + starting_recursion_depth, vstate.recursion_depth); + return NULL; } return result; } diff --git a/contrib/tools/python3/src/Python/ceval.c b/contrib/tools/python3/src/Python/ceval.c index bb6bb35030..1ce6bbc10f 100644 --- a/contrib/tools/python3/src/Python/ceval.c +++ b/contrib/tools/python3/src/Python/ceval.c @@ -7153,11 +7153,8 @@ PyObject * _PyEval_GetBuiltin(PyObject *name) { PyThreadState *tstate = _PyThreadState_GET(); - PyObject *attr = PyDict_GetItemWithError(PyEval_GetBuiltins(), name); - if (attr) { - Py_INCREF(attr); - } - else if (!_PyErr_Occurred(tstate)) { + PyObject *attr = PyObject_GetItem(PyEval_GetBuiltins(), name); + if (attr == NULL && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { _PyErr_SetObject(tstate, PyExc_AttributeError, name); } return attr; @@ -7407,9 +7404,9 @@ import_name(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *import_func, *res; PyObject* stack[5]; - import_func = _PyDict_GetItemWithError(frame->f_builtins, &_Py_ID(__import__)); + import_func = PyObject_GetItem(frame->f_builtins, &_Py_ID(__import__)); if (import_func == NULL) { - if (!_PyErr_Occurred(tstate)) { + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { _PyErr_SetString(tstate, PyExc_ImportError, "__import__ not found"); } return NULL; @@ -7417,6 +7414,7 @@ import_name(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *locals = frame->f_locals; /* Fast path for not overloaded __import__. */ if (import_func == tstate->interp->import_func) { + Py_DECREF(import_func); int ilevel = _PyLong_AsInt(level); if (ilevel == -1 && _PyErr_Occurred(tstate)) { return NULL; @@ -7430,8 +7428,6 @@ import_name(PyThreadState *tstate, _PyInterpreterFrame *frame, return res; } - Py_INCREF(import_func); - stack[0] = name; stack[1] = frame->f_globals; stack[2] = locals == NULL ? Py_None : locals; diff --git a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c b/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c index d704c00486..32b81fcb81 100644 --- a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c +++ b/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c @@ -125826,7 +125826,7 @@ site_toplevel_consts_3 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 91, + .co_firstlineno = 92, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -125969,7 +125969,7 @@ site_toplevel_consts_4 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 96, + .co_firstlineno = 97, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -126214,7 +126214,7 @@ site_toplevel_consts_5 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 6, - .co_firstlineno = 105, + .co_firstlineno = 106, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -126453,7 +126453,7 @@ site_toplevel_consts_6 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 128, + .co_firstlineno = 129, .co_nlocalsplus = 4, .co_nlocals = 4, .co_nplaincellvars = 0, @@ -126666,7 +126666,7 @@ site_toplevel_consts_7 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 147, + .co_firstlineno = 148, .co_nlocalsplus = 4, .co_nlocals = 4, .co_nplaincellvars = 0, @@ -126708,9 +126708,75 @@ site_toplevel_consts_8_consts_0 = { static struct { PyASCIIObject _ascii; + uint8_t _data[9]; + } +const_str_st_flags = { + ._ascii = { + .ob_base = { + .ob_refcnt = 999999999, + .ob_type = &PyUnicode_Type, + }, + .length = 8, + .hash = -1, + .state = { + .kind = 1, + .compact = 1, + .ascii = 1, + .ready = 1, + }, + }, + ._data = "st_flags", +}; +static + struct { + PyASCIIObject _ascii; + uint8_t _data[19]; + } +const_str_st_file_attributes = { + ._ascii = { + .ob_base = { + .ob_refcnt = 999999999, + .ob_type = &PyUnicode_Type, + }, + .length = 18, + .hash = -1, + .state = { + .kind = 1, + .compact = 1, + .ascii = 1, + .ready = 1, + }, + }, + ._data = "st_file_attributes", +}; +static + struct { + PyASCIIObject _ascii; + uint8_t _data[28]; + } +site_toplevel_consts_8_consts_7 = { + ._ascii = { + .ob_base = { + .ob_refcnt = 999999999, + .ob_type = &PyUnicode_Type, + }, + .length = 27, + .hash = -1, + .state = { + .kind = 1, + .compact = 1, + .ascii = 1, + .ready = 1, + }, + }, + ._data = "Skipping hidden .pth file: ", +}; +static + struct { + PyASCIIObject _ascii; uint8_t _data[23]; } -site_toplevel_consts_8_consts_4 = { +site_toplevel_consts_8_consts_8 = { ._ascii = { .ob_base = { .ob_refcnt = 999999999, @@ -126732,7 +126798,7 @@ static PyASCIIObject _ascii; uint8_t _data[8]; } -site_toplevel_consts_8_consts_9_1 = { +site_toplevel_consts_8_consts_13_1 = { ._ascii = { .ob_base = { .ob_refcnt = 999999999, @@ -126757,7 +126823,7 @@ static PyObject *ob_item[2]; }_object; } -site_toplevel_consts_8_consts_9 = { +site_toplevel_consts_8_consts_13 = { ._object = { .ob_base = { .ob_base = { @@ -126768,7 +126834,7 @@ site_toplevel_consts_8_consts_9 = { }, .ob_item = { & importlib__bootstrap_toplevel_consts_18_consts_1_1._ascii.ob_base, - & site_toplevel_consts_8_consts_9_1._ascii.ob_base, + & site_toplevel_consts_8_consts_13_1._ascii.ob_base, }, }, }; @@ -126777,7 +126843,7 @@ static PyASCIIObject _ascii; uint8_t _data[35]; } -site_toplevel_consts_8_consts_10 = { +site_toplevel_consts_8_consts_14 = { ._ascii = { .ob_base = { .ob_refcnt = 999999999, @@ -126799,7 +126865,7 @@ static PyASCIIObject _ascii; uint8_t _data[3]; } -site_toplevel_consts_8_consts_14 = { +site_toplevel_consts_8_consts_17 = { ._ascii = { .ob_base = { .ob_refcnt = 999999999, @@ -126821,7 +126887,7 @@ static PyASCIIObject _ascii; uint8_t _data[27]; } -site_toplevel_consts_8_consts_15 = { +site_toplevel_consts_8_consts_18 = { ._ascii = { .ob_base = { .ob_refcnt = 999999999, @@ -126843,7 +126909,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[16]; + PyObject *ob_item[19]; }_object; } site_toplevel_consts_8_consts = { @@ -126853,31 +126919,78 @@ site_toplevel_consts_8_consts = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 16, + .ob_size = 19, }, .ob_item = { & site_toplevel_consts_8_consts_0._ascii.ob_base, Py_None, Py_True, Py_False, - & site_toplevel_consts_8_consts_4._ascii.ob_base, + & const_str_st_flags._ascii.ob_base, + (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS + 0], + & const_str_st_file_attributes._ascii.ob_base, + & site_toplevel_consts_8_consts_7._ascii.ob_base, + & site_toplevel_consts_8_consts_8._ascii.ob_base, &_Py_ID(locale), & codecs_toplevel_consts_37_localsplusnames._object.ob_base.ob_base, & importlib__bootstrap_toplevel_consts_18_consts_1_0._ascii.ob_base, &_Py_STR(empty), - & site_toplevel_consts_8_consts_9._object.ob_base.ob_base, - & site_toplevel_consts_8_consts_10._ascii.ob_base, + & site_toplevel_consts_8_consts_13._object.ob_base.ob_base, + & site_toplevel_consts_8_consts_14._ascii.ob_base, (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS + 1], & importlib__bootstrap_toplevel_consts_18_consts_3._object.ob_base.ob_base, - (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS + 0], - & site_toplevel_consts_8_consts_14._ascii.ob_base, - & site_toplevel_consts_8_consts_15._ascii.ob_base, + & site_toplevel_consts_8_consts_17._ascii.ob_base, + & site_toplevel_consts_8_consts_18._ascii.ob_base, }, }, }; static struct { PyASCIIObject _ascii; + uint8_t _data[10]; + } +const_str_UF_HIDDEN = { + ._ascii = { + .ob_base = { + .ob_refcnt = 999999999, + .ob_type = &PyUnicode_Type, + }, + .length = 9, + .hash = -1, + .state = { + .kind = 1, + .compact = 1, + .ascii = 1, + .ready = 1, + }, + }, + ._data = "UF_HIDDEN", +}; +static + struct { + PyASCIIObject _ascii; + uint8_t _data[22]; + } +const_str_FILE_ATTRIBUTE_HIDDEN = { + ._ascii = { + .ob_base = { + .ob_refcnt = 999999999, + .ob_type = &PyUnicode_Type, + }, + .length = 21, + .hash = -1, + .state = { + .kind = 1, + .compact = 1, + .ascii = 1, + .ready = 1, + }, + }, + ._data = "FILE_ATTRIBUTE_HIDDEN", +}; +static + struct { + PyASCIIObject _ascii; uint8_t _data[6]; } const_str_strip = { @@ -126968,7 +127081,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[27]; + PyObject *ob_item[32]; }_object; } site_toplevel_consts_8_names = { @@ -126978,18 +127091,23 @@ site_toplevel_consts_8_names = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 27, + .ob_size = 32, }, .ob_item = { & const_str__init_pathinfo._ascii.ob_base, & const_str_os._ascii.ob_base, &_Py_ID(path), &_Py_ID(join), + & const_str_lstat._ascii.ob_base, + & const_str_OSError._ascii.ob_base, + &_Py_ID(getattr), + & const_str_stat._ascii.ob_base, + & const_str_UF_HIDDEN._ascii.ob_base, + & const_str_FILE_ATTRIBUTE_HIDDEN._ascii.ob_base, & const_str__trace._ascii.ob_base, & const_str_io._ascii.ob_base, &_Py_ID(TextIOWrapper), & const_str_open_code._ascii.ob_base, - & const_str_OSError._ascii.ob_base, & const_str_enumerate._ascii.ob_base, & const_str_startswith._ascii.ob_base, & const_str_strip._ascii.ob_base, @@ -127037,7 +127155,7 @@ static struct { PyObject_VAR_HEAD Py_hash_t ob_shash; - char ob_sval[685]; + char ob_sval[825]; } site_toplevel_consts_8_linetable = { .ob_base = { @@ -127045,16 +127163,16 @@ site_toplevel_consts_8_linetable = { .ob_refcnt = 999999999, .ob_type = &PyBytes_Type, }, - .ob_size = 684, + .ob_size = 824, }, .ob_shash = -1, - .ob_sval = "\x80\x00\xf0\x0a\x00\x08\x13\xd0\x07\x1a\xdd\x16\x24\xd1\x16\x26\xd4\x16\x26\x88\x0b\xd8\x10\x14\x88\x05\x88\x05\xe0\x10\x15\x88\x05\xdd\x0f\x11\x8c\x77\x8f\x7c\x8a\x7c\x98\x47\xa0\x54\xd1\x0f\x2a\xd4\x0f\x2a\x80\x48\xdd\x04\x0a\xd0\x0b\x30\xa0\x48\xd0\x0b\x30\xd0\x0b\x30\xd1\x04\x31\xd4\x04\x31\xd0\x04\x31\xf0\x02\x05\x05\x0f\xf5\x06\x00\x0d\x0f\xd4\x0c\x1c\x9d\x52\x9c\x5c\xa8\x28\xd1\x1d\x33\xd4\x1d\x33\xb8\x68\xd0\x0c\x47\xd1\x0c\x47\xd4\x0c\x47\x88\x01\x88\x01\xf8\xdd\x0b\x12\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xd8\x08\x0e\x88\x06\x88\x06\xf0\x03\x01\x05\x0f\xf8\xf8\xf8\xe0\x09\x0a\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xdd\x17\x20\xa0\x11\x91\x7c\x94\x7c\xf0\x00\x16\x09\x16\xf1\x00\x16\x09\x16\x89\x47\x88\x41\x88\x74\xd8\x0f\x13\x8f\x7f\x8a\x7f\x98\x73\xd1\x0f\x23\xd4\x0f\x23\xf0\x00\x01\x0d\x19\xd8\x10\x18\xd8\x0f\x13\x8f\x7a\x8a\x7a\x89\x7c\x8c\x7c\x98\x72\xd2\x0f\x21\xd0\x0f\x21\xd8\x10\x18\xf0\x02\x11\x0d\x16\xd8\x13\x17\x97\x3f\x92\x3f\xd0\x23\x3a\xd1\x13\x3b\xd4\x13\x3b\xf0\x00\x02\x11\x1d\xdd\x14\x18\x98\x14\x91\x4a\x94\x4a\x90\x4a\xd8\x14\x1c\xd8\x17\x1b\x97\x7b\x92\x7b\x91\x7d\x94\x7d\x90\x04\xdd\x1f\x27\xa8\x07\xb0\x14\xd1\x1f\x36\xd4\x1f\x36\x91\x0c\x90\x03\x90\x57\xd8\x17\x1e\xa0\x2b\xd0\x17\x2d\xd0\x17\x2d\xb5\x22\xb4\x27\xb7\x2e\xb2\x2e\xc0\x13\xd1\x32\x45\xd4\x32\x45\xd0\x17\x2d\xdd\x14\x17\x94\x48\x97\x4f\x92\x4f\xa0\x43\xd1\x14\x28\xd4\x14\x28\xd0\x14\x28\xd8\x14\x1f\x97\x4f\x92\x4f\xa0\x47\xd1\x14\x2c\xd4\x14\x2c\xd0\x14\x2c\xf8\xf8\xdd\x13\x1c\xf0\x00\x08\x0d\x16\xf0\x00\x08\x0d\x16\xf0\x00\x08\x0d\x16\xdd\x10\x15\xd0\x16\x3b\xd7\x16\x42\xd2\x16\x42\xc0\x31\xc0\x51\xc1\x33\xc8\x08\xd1\x16\x51\xd4\x16\x51\xdd\x1b\x1e\x9c\x3a\xf0\x03\x01\x11\x27\xf1\x00\x01\x11\x27\xf4\x00\x01\x11\x27\xf0\x00\x01\x11\x27\xe0\x10\x20\xd0\x10\x20\xd0\x10\x20\xd0\x10\x20\xd8\x1e\x38\x98\x69\xd4\x1e\x38\xbd\x23\xbc\x2c\xb9\x2e\xbc\x2e\xd0\x1e\x49\xf0\x00\x02\x11\x3a\xf0\x00\x02\x11\x3a\x90\x46\xd8\x20\x26\xd7\x20\x31\xd2\x20\x31\xd1\x20\x33\xd4\x20\x33\xf0\x00\x01\x15\x3a\xf0\x00\x01\x15\x3a\x98\x04\xdd\x18\x1d\x98\x64\xa0\x34\x99\x69\xad\x63\xac\x6a\xd0\x18\x39\xd1\x18\x39\xd4\x18\x39\xd0\x18\x39\xd0\x18\x39\xf0\x03\x01\x15\x3a\xe5\x10\x15\xd0\x16\x33\xbd\x23\xbc\x2a\xd0\x10\x45\xd1\x10\x45\xd4\x10\x45\xd0\x10\x45\xd8\x10\x15\x90\x05\x90\x05\xf0\x11\x08\x0d\x16\xf8\xf8\xf8\xf0\x1f\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf1\x00\x17\x05\x16\xf4\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf8\xf8\xf8\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x30\x00\x08\x0d\xf0\x00\x01\x05\x1b\xd8\x16\x1a\x88\x0b\xd8\x0b\x16\xd0\x04\x16", + .ob_sval = "\x80\x00\xf0\x0a\x00\x08\x13\xd0\x07\x1a\xdd\x16\x24\xd1\x16\x26\xd4\x16\x26\x88\x0b\xd8\x10\x14\x88\x05\x88\x05\xe0\x10\x15\x88\x05\xdd\x0f\x11\x8c\x77\x8f\x7c\x8a\x7c\x98\x47\xa0\x54\xd1\x0f\x2a\xd4\x0f\x2a\x80\x48\xf0\x02\x03\x05\x0f\xdd\x0d\x0f\x8c\x58\x90\x68\xd1\x0d\x1f\xd4\x0d\x1f\x88\x02\x88\x02\xf8\xdd\x0b\x12\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xd8\x08\x0e\x88\x06\x88\x06\xf0\x03\x01\x05\x0f\xf8\xf8\xf8\xe5\x09\x10\x90\x12\x90\x5a\xa0\x11\xd1\x09\x23\xd4\x09\x23\xa5\x64\xa4\x6e\xd1\x09\x34\xf0\x00\x03\x05\x0f\xdd\x09\x10\x90\x12\xd0\x15\x29\xa8\x31\xd1\x09\x2d\xd4\x09\x2d\xb5\x04\xd4\x30\x4a\xd1\x09\x4a\xf0\x03\x03\x05\x0f\xe5\x08\x0e\xd0\x0f\x39\xa8\x58\xd0\x0f\x39\xd0\x0f\x39\xd1\x08\x3a\xd4\x08\x3a\xd0\x08\x3a\xd8\x08\x0e\x88\x06\xdd\x04\x0a\xd0\x0b\x30\xa0\x48\xd0\x0b\x30\xd0\x0b\x30\xd1\x04\x31\xd4\x04\x31\xd0\x04\x31\xf0\x02\x05\x05\x0f\xf5\x06\x00\x0d\x0f\xd4\x0c\x1c\x9d\x52\x9c\x5c\xa8\x28\xd1\x1d\x33\xd4\x1d\x33\xb8\x68\xd0\x0c\x47\xd1\x0c\x47\xd4\x0c\x47\x88\x01\x88\x01\xf8\xdd\x0b\x12\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xd8\x08\x0e\x88\x06\x88\x06\xf0\x03\x01\x05\x0f\xf8\xf8\xf8\xe0\x09\x0a\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xdd\x17\x20\xa0\x11\x91\x7c\x94\x7c\xf0\x00\x16\x09\x16\xf1\x00\x16\x09\x16\x89\x47\x88\x41\x88\x74\xd8\x0f\x13\x8f\x7f\x8a\x7f\x98\x73\xd1\x0f\x23\xd4\x0f\x23\xf0\x00\x01\x0d\x19\xd8\x10\x18\xd8\x0f\x13\x8f\x7a\x8a\x7a\x89\x7c\x8c\x7c\x98\x72\xd2\x0f\x21\xd0\x0f\x21\xd8\x10\x18\xf0\x02\x11\x0d\x16\xd8\x13\x17\x97\x3f\x92\x3f\xd0\x23\x3a\xd1\x13\x3b\xd4\x13\x3b\xf0\x00\x02\x11\x1d\xdd\x14\x18\x98\x14\x91\x4a\x94\x4a\x90\x4a\xd8\x14\x1c\xd8\x17\x1b\x97\x7b\x92\x7b\x91\x7d\x94\x7d\x90\x04\xdd\x1f\x27\xa8\x07\xb0\x14\xd1\x1f\x36\xd4\x1f\x36\x91\x0c\x90\x03\x90\x57\xd8\x17\x1e\xa0\x2b\xd0\x17\x2d\xd0\x17\x2d\xb5\x22\xb4\x27\xb7\x2e\xb2\x2e\xc0\x13\xd1\x32\x45\xd4\x32\x45\xd0\x17\x2d\xdd\x14\x17\x94\x48\x97\x4f\x92\x4f\xa0\x43\xd1\x14\x28\xd4\x14\x28\xd0\x14\x28\xd8\x14\x1f\x97\x4f\x92\x4f\xa0\x47\xd1\x14\x2c\xd4\x14\x2c\xd0\x14\x2c\xf8\xf8\xdd\x13\x1c\xf0\x00\x08\x0d\x16\xf0\x00\x08\x0d\x16\xf0\x00\x08\x0d\x16\xdd\x10\x15\xd0\x16\x3b\xd7\x16\x42\xd2\x16\x42\xc0\x31\xc0\x51\xc1\x33\xc8\x08\xd1\x16\x51\xd4\x16\x51\xdd\x1b\x1e\x9c\x3a\xf0\x03\x01\x11\x27\xf1\x00\x01\x11\x27\xf4\x00\x01\x11\x27\xf0\x00\x01\x11\x27\xe0\x10\x20\xd0\x10\x20\xd0\x10\x20\xd0\x10\x20\xd8\x1e\x38\x98\x69\xd4\x1e\x38\xbd\x23\xbc\x2c\xb9\x2e\xbc\x2e\xd0\x1e\x49\xf0\x00\x02\x11\x3a\xf0\x00\x02\x11\x3a\x90\x46\xd8\x20\x26\xd7\x20\x31\xd2\x20\x31\xd1\x20\x33\xd4\x20\x33\xf0\x00\x01\x15\x3a\xf0\x00\x01\x15\x3a\x98\x04\xdd\x18\x1d\x98\x64\xa0\x34\x99\x69\xad\x63\xac\x6a\xd0\x18\x39\xd1\x18\x39\xd4\x18\x39\xd0\x18\x39\xd0\x18\x39\xf0\x03\x01\x15\x3a\xe5\x10\x15\xd0\x16\x33\xbd\x23\xbc\x2a\xd0\x10\x45\xd1\x10\x45\xd4\x10\x45\xd0\x10\x45\xd8\x10\x15\x90\x05\x90\x05\xf0\x11\x08\x0d\x16\xf8\xf8\xf8\xf0\x1f\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf1\x00\x17\x05\x16\xf4\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf8\xf8\xf8\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x00\x17\x05\x16\xf0\x30\x00\x08\x0d\xf0\x00\x01\x05\x1b\xd8\x16\x1a\x88\x0b\xd8\x0b\x16\xd0\x04\x16", }; static struct { PyObject_VAR_HEAD Py_hash_t ob_shash; - char ob_sval[88]; + char ob_sval[105]; } site_toplevel_consts_8_exceptiontable = { .ob_base = { @@ -127062,10 +127180,10 @@ site_toplevel_consts_8_exceptiontable = { .ob_refcnt = 999999999, .ob_type = &PyBytes_Type, }, - .ob_size = 87, + .ob_size = 104, }, .ob_shash = -1, - .ob_sval = "\xc1\x09\x28\x41\x32\x00\xc1\x32\x0a\x42\x00\x03\xc1\x3f\x01\x42\x00\x03\xc2\x05\x41\x05\x48\x30\x03\xc3\x0b\x24\x45\x2f\x04\xc3\x2f\x01\x48\x30\x03\xc3\x30\x41\x3e\x45\x2f\x04\xc5\x2e\x01\x48\x30\x03\xc5\x2f\x42\x2e\x48\x21\x07\xc8\x1d\x03\x48\x30\x03\xc8\x20\x01\x48\x21\x07\xc8\x21\x03\x48\x30\x03\xc8\x30\x04\x48\x34\x07\xc8\x37\x01\x48\x34\x07", + .ob_sval = "\xb7\x14\x41\x0c\x00\xc1\x0c\x0a\x41\x1a\x03\xc1\x19\x01\x41\x1a\x03\xc3\x00\x28\x43\x29\x00\xc3\x29\x0a\x43\x37\x03\xc3\x36\x01\x43\x37\x03\xc3\x3c\x41\x05\x4a\x27\x03\xc5\x02\x24\x47\x26\x04\xc5\x26\x01\x4a\x27\x03\xc5\x27\x41\x3e\x47\x26\x04\xc7\x25\x01\x4a\x27\x03\xc7\x26\x42\x2e\x4a\x18\x07\xca\x14\x03\x4a\x27\x03\xca\x17\x01\x4a\x18\x07\xca\x18\x03\x4a\x27\x03\xca\x27\x04\x4a\x2b\x07\xca\x2e\x01\x4a\x2b\x07", }; static struct { @@ -127116,7 +127234,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[12]; + PyObject *ob_item[13]; }_object; } site_toplevel_consts_8_localsplusnames = { @@ -127126,7 +127244,7 @@ site_toplevel_consts_8_localsplusnames = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 12, + .ob_size = 13, }, .ob_item = { & const_str_sitedir._ascii.ob_base, @@ -127134,6 +127252,7 @@ site_toplevel_consts_8_localsplusnames = { & const_str_known_paths._ascii.ob_base, &_Py_ID(reset), & const_str_fullname._ascii.ob_base, + & const_str_st._ascii.ob_base, & const_str_f._ascii.ob_base, & const_str_n._ascii.ob_base, &_Py_ID(line), @@ -127145,14 +127264,14 @@ site_toplevel_consts_8_localsplusnames = { }, }; static - struct _PyCode_DEF(1154) + struct _PyCode_DEF(1392) site_toplevel_consts_8 = { .ob_base = { .ob_base = { .ob_refcnt = 999999999, .ob_type = &PyCode_Type, }, - .ob_size = 577, + .ob_size = 696, }, .co_consts = & site_toplevel_consts_8_consts._object.ob_base.ob_base, .co_names = & site_toplevel_consts_8_names._object.ob_base.ob_base, @@ -127164,21 +127283,21 @@ site_toplevel_consts_8 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 9, - .co_firstlineno = 160, - .co_nlocalsplus = 12, - .co_nlocals = 12, + .co_firstlineno = 161, + .co_nlocalsplus = 13, + .co_nlocals = 13, .co_nplaincellvars = 0, .co_ncellvars = 0, .co_nfreevars = 0, .co_localsplusnames = & site_toplevel_consts_8_localsplusnames._object.ob_base.ob_base, - .co_localspluskinds = & importlib__bootstrap_external_toplevel_consts_36_localspluskinds.ob_base.ob_base, + .co_localspluskinds = & posixpath_toplevel_consts_32_localspluskinds.ob_base.ob_base, .co_filename = & site_toplevel_consts_3_filename._ascii.ob_base, .co_name = & const_str_addpackage._ascii.ob_base, .co_qualname = & const_str_addpackage._ascii.ob_base, .co_linetable = & site_toplevel_consts_8_linetable.ob_base.ob_base, ._co_code = NULL, ._co_linearray = NULL, - .co_code_adaptive = "\x97\x00\x7c\x02\x80\x11\x74\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x02\x64\x02\x7d\x03\x6e\x02\x64\x03\x7d\x03\x74\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x00\x7c\x01\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x04\x74\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x04\x7c\x04\x9b\x02\x9d\x02\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x09\x00\x74\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x06\x00\x00\x00\x00\x00\x00\x00\x00\x74\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x04\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x64\x05\xac\x06\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x05\x6e\x11\x23\x00\x74\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x72\x04\x01\x00\x59\x00\x64\x01\x53\x00\x77\x00\x78\x03\x59\x00\x77\x01\x7c\x05\x35\x00\x01\x00\x74\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x05\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x90\x01\x5d\x8d\x5c\x02\x00\x00\x7d\x06\x7d\x07\x7c\x07\xa0\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x07\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x01\x8c\x1c\x7c\x07\xa0\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x08\x6b\x02\x00\x00\x00\x00\x72\x01\x8c\x35\x09\x00\x7c\x07\xa0\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x09\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x10\x74\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x07\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\x5b\x7c\x07\xa0\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x07\x74\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x00\x7c\x07\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x5c\x02\x00\x00\x7d\x08\x7d\x09\x7c\x09\x7c\x02\x76\x01\x72\x53\x74\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x08\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x34\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x08\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x7c\x02\xa0\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x09\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\xda\x23\x00\x74\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x72\xa8\x01\x00\x74\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0a\xa0\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x06\x64\x0b\x7a\x00\x00\x00\x7c\x04\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x16\x00\x00\x00\x00\x00\x00\x00\x00\xac\x0c\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x0d\x64\x01\x6c\x17\x7d\x0a\x02\x00\x7c\x0a\x6a\x18\x00\x00\x00\x00\x00\x00\x00\x00\x74\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x19\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x00\x44\x00\x5d\x37\x7d\x0b\x7c\x0b\xa0\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x5d\x20\x7d\x07\x74\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0e\x7c\x07\x7a\x00\x00\x00\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x16\x00\x00\x00\x00\x00\x00\x00\x00\xac\x0c\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\x21\x8c\x38\x74\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0f\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x16\x00\x00\x00\x00\x00\x00\x00\x00\xac\x0c\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x59\x00\x01\x00\x6e\x04\x77\x00\x78\x03\x59\x00\x77\x01\x64\x01\x64\x01\x64\x01\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x6e\x0b\x23\x00\x31\x00\x73\x04\x77\x02\x78\x03\x59\x00\x77\x01\x01\x00\x59\x00\x01\x00\x01\x00\x7c\x03\x72\x02\x64\x01\x7d\x02\x7c\x02\x53\x00", + .co_code_adaptive = "\x97\x00\x7c\x02\x80\x11\x74\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x02\x64\x02\x7d\x03\x6e\x02\x64\x03\x7d\x03\x74\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x00\x7c\x01\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x04\x09\x00\x74\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x04\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x04\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x05\x6e\x11\x23\x00\x74\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x72\x04\x01\x00\x59\x00\x64\x01\x53\x00\x77\x00\x78\x03\x59\x00\x77\x01\x74\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x05\x64\x04\x64\x05\xa6\x03\x00\x00\xab\x03\x00\x00\x00\x00\x00\x00\x00\x00\x74\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x08\x00\x00\x00\x00\x00\x00\x00\x00\x7a\x01\x00\x00\x73\x1e\x74\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x05\x64\x06\x64\x05\xa6\x03\x00\x00\xab\x03\x00\x00\x00\x00\x00\x00\x00\x00\x74\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x09\x00\x00\x00\x00\x00\x00\x00\x00\x7a\x01\x00\x00\x72\x14\x74\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x07\x7c\x04\x9b\x02\x9d\x02\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x01\x53\x00\x74\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x08\x7c\x04\x9b\x02\x9d\x02\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x09\x00\x74\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x74\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x04\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x64\x09\xac\x0a\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x06\x6e\x11\x23\x00\x74\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x72\x04\x01\x00\x59\x00\x64\x01\x53\x00\x77\x00\x78\x03\x59\x00\x77\x01\x7c\x06\x35\x00\x01\x00\x74\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x06\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x90\x01\x5d\x8d\x5c\x02\x00\x00\x7d\x07\x7d\x08\x7c\x08\xa0\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0b\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x01\x8c\x1c\x7c\x08\xa0\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0c\x6b\x02\x00\x00\x00\x00\x72\x01\x8c\x35\x09\x00\x7c\x08\xa0\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0d\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x10\x74\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x08\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\x5b\x7c\x08\xa0\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x08\x74\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x00\x7c\x08\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x5c\x02\x00\x00\x7d\x09\x7d\x0a\x7c\x0a\x7c\x02\x76\x01\x72\x53\x74\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x09\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x72\x34\x74\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x09\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x7c\x02\xa0\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x0a\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\xda\x23\x00\x74\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x72\xa8\x01\x00\x74\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x0e\xa0\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x07\x64\x0f\x7a\x00\x00\x00\x7c\x04\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x74\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x1b\x00\x00\x00\x00\x00\x00\x00\x00\xac\x10\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x05\x64\x01\x6c\x1c\x7d\x0b\x02\x00\x7c\x0b\x6a\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x74\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x1e\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x00\x44\x00\x5d\x37\x7d\x0c\x7c\x0c\xa0\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x5d\x20\x7d\x08\x74\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x11\x7c\x08\x7a\x00\x00\x00\x74\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x1b\x00\x00\x00\x00\x00\x00\x00\x00\xac\x10\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8c\x21\x8c\x38\x74\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x12\x74\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x1b\x00\x00\x00\x00\x00\x00\x00\x00\xac\x10\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x59\x00\x01\x00\x6e\x04\x77\x00\x78\x03\x59\x00\x77\x01\x64\x01\x64\x01\x64\x01\xa6\x02\x00\x00\xab\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x6e\x0b\x23\x00\x31\x00\x73\x04\x77\x02\x78\x03\x59\x00\x77\x01\x01\x00\x59\x00\x01\x00\x01\x00\x7c\x03\x72\x02\x64\x01\x7d\x02\x7c\x02\x53\x00", ._co_firsttraceable = 0, }; static @@ -127252,7 +127371,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[1]; + PyObject *ob_item[2]; }_object; } site_toplevel_consts_9_consts_5_consts = { @@ -127262,10 +127381,11 @@ site_toplevel_consts_9_consts_5_consts = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 1, + .ob_size = 2, }, .ob_item = { & site_toplevel_consts_9_consts_5_consts_0._ascii.ob_base, + &_Py_STR(dot), }, }, }; @@ -127274,7 +127394,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[1]; + PyObject *ob_item[2]; }_object; } site_toplevel_consts_9_consts_5_names = { @@ -127284,10 +127404,11 @@ site_toplevel_consts_9_consts_5_names = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 1, + .ob_size = 2, }, .ob_item = { & const_str_endswith._ascii.ob_base, + & const_str_startswith._ascii.ob_base, }, }, }; @@ -127317,7 +127438,7 @@ static struct { PyObject_VAR_HEAD Py_hash_t ob_shash; - char ob_sval[42]; + char ob_sval[85]; } site_toplevel_consts_9_consts_5_linetable = { .ob_base = { @@ -127325,10 +127446,10 @@ site_toplevel_consts_9_consts_5_linetable = { .ob_refcnt = 999999999, .ob_type = &PyBytes_Type, }, - .ob_size = 41, + .ob_size = 84, }, .ob_shash = -1, - .ob_sval = "\x80\x00\xd0\x0c\x3d\xd0\x0c\x3d\xd0\x0c\x3d\x90\x64\xa0\x74\xa7\x7d\xa2\x7d\xb0\x56\xd1\x27\x3c\xd4\x27\x3c\xd0\x0c\x3d\x88\x54\xd0\x0c\x3d\xd0\x0c\x3d\xd0\x0c\x3d", + .ob_sval = "\x80\x00\xf0\x00\x01\x0d\x44\x01\xf0\x00\x01\x0d\x44\x01\xf0\x00\x01\x0d\x44\x01\x90\x64\xd8\x10\x14\x97\x0d\x92\x0d\x98\x66\xd1\x10\x25\xd4\x10\x25\xf0\x03\x01\x0d\x44\x01\xd8\x2e\x32\xaf\x6f\xaa\x6f\xb8\x63\xd1\x2e\x42\xd4\x2e\x42\xf0\x03\x01\x0d\x44\x01\x88\x54\xf0\x00\x01\x0d\x44\x01\xf0\x00\x01\x0d\x44\x01\xf0\x00\x01\x0d\x44\x01", }; static struct { @@ -127354,14 +127475,14 @@ site_toplevel_consts_9_consts_5_localsplusnames = { }, }; static - struct _PyCode_DEF(60) + struct _PyCode_DEF(102) site_toplevel_consts_9_consts_5 = { .ob_base = { .ob_base = { .ob_refcnt = 999999999, .ob_type = &PyCode_Type, }, - .ob_size = 30, + .ob_size = 51, }, .co_consts = & site_toplevel_consts_9_consts_5_consts._object.ob_base.ob_base, .co_names = & site_toplevel_consts_9_consts_5_names._object.ob_base.ob_base, @@ -127373,7 +127494,7 @@ site_toplevel_consts_9_consts_5 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 224, + .co_firstlineno = 233, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -127387,7 +127508,7 @@ site_toplevel_consts_9_consts_5 = { .co_linetable = & site_toplevel_consts_9_consts_5_linetable.ob_base.ob_base, ._co_code = NULL, ._co_linearray = NULL, - .co_code_adaptive = "\x97\x00\x67\x00\x7c\x00\x5d\x19\x7d\x01\x7c\x01\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x00\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\xaf\x17\x7c\x01\x91\x02\x8c\x1a\x53\x00", + .co_code_adaptive = "\x97\x00\x67\x00\x7c\x00\x5d\x2e\x7d\x01\x7c\x01\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x00\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\xaf\x17\x7c\x01\xa0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x01\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\xb0\x2c\x7c\x01\x91\x02\x8c\x2f\x53\x00", ._co_firsttraceable = 0, }; static @@ -127476,7 +127597,7 @@ static struct { PyObject_VAR_HEAD Py_hash_t ob_shash; - char ob_sval[260]; + char ob_sval[275]; } site_toplevel_consts_9_linetable = { .ob_base = { @@ -127484,10 +127605,10 @@ site_toplevel_consts_9_linetable = { .ob_refcnt = 999999999, .ob_type = &PyBytes_Type, }, - .ob_size = 259, + .ob_size = 274, }, .ob_shash = -1, - .ob_sval = "\x80\x00\xf5\x06\x00\x05\x0b\xd0\x0b\x2b\xa0\x07\xd0\x0b\x2b\xd0\x0b\x2b\xd1\x04\x2c\xd4\x04\x2c\xd0\x04\x2c\xd8\x07\x12\xd0\x07\x1a\xdd\x16\x24\xd1\x16\x26\xd4\x16\x26\x88\x0b\xd8\x10\x14\x88\x05\x88\x05\xe0\x10\x15\x88\x05\xdd\x1b\x23\xa0\x47\xd1\x1b\x2c\xd4\x1b\x2c\xd1\x04\x18\x80\x47\x88\x5b\xd8\x0b\x16\x98\x2b\xd0\x0b\x25\xd0\x0b\x25\xdd\x08\x0b\x8c\x08\x8f\x0f\x8a\x0f\x98\x07\xd1\x08\x20\xd4\x08\x20\xd0\x08\x20\xd8\x08\x13\x8f\x0f\x8a\x0f\x98\x0b\xd1\x08\x24\xd4\x08\x24\xd0\x08\x24\xf0\x02\x03\x05\x0f\xdd\x10\x12\x94\x0a\x98\x37\xd1\x10\x23\xd4\x10\x23\x88\x05\x88\x05\xf8\xdd\x0b\x12\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xd8\x08\x0e\x88\x06\x88\x06\xf0\x03\x01\x05\x0f\xf8\xf8\xf8\xe0\x0c\x3d\xd0\x0c\x3d\x98\x65\xd0\x0c\x3d\xd1\x0c\x3d\xd4\x0c\x3d\x80\x45\xdd\x10\x16\x90\x75\x91\x0d\x94\x0d\xf0\x00\x01\x05\x2f\xf0\x00\x01\x05\x2f\x88\x04\xdd\x08\x12\x90\x37\x98\x44\xa0\x2b\xd1\x08\x2e\xd4\x08\x2e\xd0\x08\x2e\xd0\x08\x2e\xd8\x07\x0c\xf0\x00\x01\x05\x1b\xd8\x16\x1a\x88\x0b\xd8\x0b\x16\xd0\x04\x16", + .ob_sval = "\x80\x00\xf5\x06\x00\x05\x0b\xd0\x0b\x2b\xa0\x07\xd0\x0b\x2b\xd0\x0b\x2b\xd1\x04\x2c\xd4\x04\x2c\xd0\x04\x2c\xd8\x07\x12\xd0\x07\x1a\xdd\x16\x24\xd1\x16\x26\xd4\x16\x26\x88\x0b\xd8\x10\x14\x88\x05\x88\x05\xe0\x10\x15\x88\x05\xdd\x1b\x23\xa0\x47\xd1\x1b\x2c\xd4\x1b\x2c\xd1\x04\x18\x80\x47\x88\x5b\xd8\x0b\x16\x98\x2b\xd0\x0b\x25\xd0\x0b\x25\xdd\x08\x0b\x8c\x08\x8f\x0f\x8a\x0f\x98\x07\xd1\x08\x20\xd4\x08\x20\xd0\x08\x20\xd8\x08\x13\x8f\x0f\x8a\x0f\x98\x0b\xd1\x08\x24\xd4\x08\x24\xd0\x08\x24\xf0\x02\x03\x05\x0f\xdd\x10\x12\x94\x0a\x98\x37\xd1\x10\x23\xd4\x10\x23\x88\x05\x88\x05\xf8\xdd\x0b\x12\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xf0\x00\x01\x05\x0f\xd8\x08\x0e\x88\x06\x88\x06\xf0\x03\x01\x05\x0f\xf8\xf8\xf8\xf0\x04\x01\x0d\x44\x01\xf0\x00\x01\x0d\x44\x01\x98\x65\xf0\x00\x01\x0d\x44\x01\xf1\x00\x01\x0d\x44\x01\xf4\x00\x01\x0d\x44\x01\x80\x45\xe5\x10\x16\x90\x75\x91\x0d\x94\x0d\xf0\x00\x01\x05\x2f\xf0\x00\x01\x05\x2f\x88\x04\xdd\x08\x12\x90\x37\x98\x44\xa0\x2b\xd1\x08\x2e\xd4\x08\x2e\xd0\x08\x2e\xd0\x08\x2e\xd8\x07\x0c\xf0\x00\x01\x05\x1b\xd8\x16\x1a\x88\x0b\xd8\x0b\x16\xd0\x04\x16", }; static struct { @@ -127575,7 +127696,7 @@ site_toplevel_consts_9 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 6, - .co_firstlineno = 207, + .co_firstlineno = 216, .co_nlocalsplus = 6, .co_nlocals = 6, .co_nplaincellvars = 0, @@ -127820,7 +127941,7 @@ site_toplevel_consts_10 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 232, + .co_firstlineno = 242, .co_nlocalsplus = 0, .co_nlocals = 0, .co_nplaincellvars = 0, @@ -128056,7 +128177,7 @@ site_toplevel_consts_11_consts_3 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 273, + .co_firstlineno = 283, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -128351,7 +128472,7 @@ site_toplevel_consts_11 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 9, - .co_firstlineno = 264, + .co_firstlineno = 274, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -128689,7 +128810,7 @@ site_toplevel_consts_12 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 6, - .co_firstlineno = 288, + .co_firstlineno = 298, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -128854,7 +128975,7 @@ site_toplevel_consts_13 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 2, - .co_firstlineno = 301, + .co_firstlineno = 311, .co_nlocalsplus = 0, .co_nlocals = 0, .co_nplaincellvars = 0, @@ -129067,7 +129188,7 @@ site_toplevel_consts_14 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 3, - .co_firstlineno = 314, + .co_firstlineno = 324, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -129283,7 +129404,7 @@ site_toplevel_consts_15 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 331, + .co_firstlineno = 341, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -129690,7 +129811,7 @@ site_toplevel_consts_16 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 10, - .co_firstlineno = 346, + .co_firstlineno = 356, .co_nlocalsplus = 7, .co_nlocals = 7, .co_nplaincellvars = 0, @@ -129884,7 +130005,7 @@ site_toplevel_consts_17 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 379, + .co_firstlineno = 389, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -130170,7 +130291,7 @@ site_toplevel_consts_18 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 388, + .co_firstlineno = 398, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -130586,7 +130707,7 @@ site_toplevel_consts_19 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 6, - .co_firstlineno = 404, + .co_firstlineno = 414, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -130687,7 +130808,7 @@ site_toplevel_consts_20 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 2, - .co_firstlineno = 430, + .co_firstlineno = 440, .co_nlocalsplus = 0, .co_nlocals = 0, .co_nplaincellvars = 0, @@ -131019,7 +131140,7 @@ site_toplevel_consts_21_consts_1_consts_9 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 4, - .co_firstlineno = 480, + .co_firstlineno = 490, .co_nlocalsplus = 2, .co_nlocals = 0, .co_nplaincellvars = 0, @@ -131399,7 +131520,7 @@ site_toplevel_consts_21_consts_1 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 442, + .co_firstlineno = 452, .co_nlocalsplus = 6, .co_nlocals = 4, .co_nplaincellvars = 2, @@ -131566,7 +131687,7 @@ site_toplevel_consts_21 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 2, - .co_firstlineno = 433, + .co_firstlineno = 443, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -131755,7 +131876,7 @@ site_toplevel_consts_22_consts_4 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 5, - .co_firstlineno = 504, + .co_firstlineno = 514, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -132268,7 +132389,7 @@ site_toplevel_consts_22 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 6, - .co_firstlineno = 492, + .co_firstlineno = 502, .co_nlocalsplus = 14, .co_nlocals = 14, .co_nplaincellvars = 0, @@ -132513,7 +132634,7 @@ site_toplevel_consts_23 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 8, - .co_firstlineno = 544, + .co_firstlineno = 554, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -132724,7 +132845,7 @@ site_toplevel_consts_24 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 8, - .co_firstlineno = 564, + .co_firstlineno = 574, .co_nlocalsplus = 3, .co_nlocals = 3, .co_nplaincellvars = 0, @@ -132950,7 +133071,7 @@ site_toplevel_consts_25 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 3, - .co_firstlineno = 584, + .co_firstlineno = 594, .co_nlocalsplus = 2, .co_nlocals = 2, .co_nplaincellvars = 0, @@ -133184,7 +133305,7 @@ site_toplevel_consts_26_consts_7 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 3, - .co_firstlineno = 641, + .co_firstlineno = 651, .co_nlocalsplus = 1, .co_nlocals = 1, .co_nplaincellvars = 0, @@ -133565,7 +133686,7 @@ site_toplevel_consts_26 = { .co_posonlyargcount = 0, .co_kwonlyargcount = 0, .co_stacksize = 8, - .co_firstlineno = 618, + .co_firstlineno = 628, .co_nlocalsplus = 8, .co_nlocals = 8, .co_nplaincellvars = 0, @@ -133659,7 +133780,7 @@ static PyGC_Head _gc_head; struct { PyObject_VAR_HEAD - PyObject *ob_item[39]; + PyObject *ob_item[40]; }_object; } site_toplevel_names = { @@ -133669,7 +133790,7 @@ site_toplevel_names = { .ob_refcnt = 999999999, .ob_type = &PyTuple_Type, }, - .ob_size = 39, + .ob_size = 40, }, .ob_item = { &_Py_ID(__doc__), @@ -133678,6 +133799,7 @@ site_toplevel_names = { &_Py_ID(builtins), & const_str__sitebuiltins._ascii.ob_base, & const_str_io._ascii.ob_base, + & const_str_stat._ascii.ob_base, & const_str_prefix._ascii.ob_base, & const_str_exec_prefix._ascii.ob_base, & const_str_PREFIXES._ascii.ob_base, @@ -133718,7 +133840,7 @@ static struct { PyObject_VAR_HEAD Py_hash_t ob_shash; - char ob_sval[551]; + char ob_sval[560]; } site_toplevel_linetable = { .ob_base = { @@ -133726,20 +133848,20 @@ site_toplevel_linetable = { .ob_refcnt = 999999999, .ob_type = &PyBytes_Type, }, - .ob_size = 550, + .ob_size = 559, }, .ob_shash = -1, - .ob_sval = "\xf0\x03\x01\x01\x01\xf0\x02\x45\x01\x01\x04\xf0\x00\x45\x01\x01\x04\xf0\x4e\x02\x00\x01\x0b\x80\x0a\x80\x0a\x80\x0a\xd8\x00\x09\x80\x09\x80\x09\x80\x09\xd8\x00\x0f\x80\x0f\x80\x0f\x80\x0f\xd8\x00\x14\xd0\x00\x14\xd0\x00\x14\xd0\x00\x14\xd8\x00\x09\x80\x09\x80\x09\x80\x09\xf0\x06\x00\x0d\x10\x8c\x4a\x98\x03\x9c\x0f\xd0\x0b\x28\x80\x08\xf0\x06\x00\x14\x18\xd0\x00\x10\xf0\x0a\x00\x0d\x11\x80\x09\xd8\x0c\x10\x80\x09\xf0\x06\x02\x01\x28\xf0\x00\x02\x01\x28\xf0\x00\x02\x01\x28\xf0\x0a\x06\x01\x26\xf0\x00\x06\x01\x26\xf0\x00\x06\x01\x26\xf0\x12\x14\x01\x11\xf0\x00\x14\x01\x11\xf0\x00\x14\x01\x11\xf0\x2e\x10\x01\x17\xf0\x00\x10\x01\x17\xf0\x00\x10\x01\x17\xf0\x26\x0a\x01\x0d\xf0\x00\x0a\x01\x0d\xf0\x00\x0a\x01\x0d\xf0\x1a\x2c\x01\x17\xf0\x00\x2c\x01\x17\xf0\x00\x2c\x01\x17\xf0\x5e\x01\x16\x01\x17\xf0\x00\x16\x01\x17\xf0\x00\x16\x01\x17\xf0\x00\x16\x01\x17\xf0\x32\x16\x01\x10\xf0\x00\x16\x01\x10\xf0\x00\x16\x01\x10\xf0\x40\x01\x14\x01\x23\xf0\x00\x14\x01\x23\xf0\x00\x14\x01\x23\xf0\x30\x0a\x01\x4b\x01\xf0\x00\x0a\x01\x4b\x01\xf0\x00\x0a\x01\x4b\x01\xf0\x1a\x0a\x01\x15\xf0\x00\x0a\x01\x15\xf0\x00\x0a\x01\x15\xf0\x1a\x0f\x01\x15\xf0\x00\x0f\x01\x15\xf0\x00\x0f\x01\x15\xf0\x22\x0d\x01\x17\xf0\x00\x0d\x01\x17\xf0\x00\x0d\x01\x17\xf0\x1e\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x42\x01\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x12\x0d\x01\x37\xf0\x00\x0d\x01\x37\xf0\x00\x0d\x01\x37\xf0\x20\x17\x01\x15\xf0\x00\x17\x01\x15\xf0\x00\x17\x01\x15\xf0\x34\x01\x01\x2c\xf0\x00\x01\x01\x2c\xf0\x00\x01\x01\x2c\xf0\x06\x39\x01\x30\xf0\x00\x39\x01\x30\xf0\x00\x39\x01\x30\xf0\x76\x01\x31\x01\x17\xf0\x00\x31\x01\x17\xf0\x00\x31\x01\x17\xf0\x68\x01\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x28\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x28\x1b\x01\x1c\xf0\x00\x1b\x01\x1c\xf0\x00\x1b\x01\x1c\xf0\x3e\x00\x08\x0b\x84\x79\xd4\x07\x18\xf0\x00\x01\x01\x0b\xd8\x04\x08\x80\x44\x81\x46\x84\x46\x80\x46\xf0\x04\x34\x01\x15\xf0\x00\x34\x01\x15\xf0\x00\x34\x01\x15\xf0\x6c\x01\x00\x04\x0c\x88\x7a\xd2\x03\x19\xd0\x03\x19\xd8\x04\x0b\x80\x47\x81\x49\x84\x49\x80\x49\x80\x49\x80\x49\xf0\x03\x00\x04\x1a\xd0\x03\x19", + .ob_sval = "\xf0\x03\x01\x01\x01\xf0\x02\x45\x01\x01\x04\xf0\x00\x45\x01\x01\x04\xf0\x4e\x02\x00\x01\x0b\x80\x0a\x80\x0a\x80\x0a\xd8\x00\x09\x80\x09\x80\x09\x80\x09\xd8\x00\x0f\x80\x0f\x80\x0f\x80\x0f\xd8\x00\x14\xd0\x00\x14\xd0\x00\x14\xd0\x00\x14\xd8\x00\x09\x80\x09\x80\x09\x80\x09\xd8\x00\x0b\x80\x0b\x80\x0b\x80\x0b\xf0\x06\x00\x0d\x10\x8c\x4a\x98\x03\x9c\x0f\xd0\x0b\x28\x80\x08\xf0\x06\x00\x14\x18\xd0\x00\x10\xf0\x0a\x00\x0d\x11\x80\x09\xd8\x0c\x10\x80\x09\xf0\x06\x02\x01\x28\xf0\x00\x02\x01\x28\xf0\x00\x02\x01\x28\xf0\x0a\x06\x01\x26\xf0\x00\x06\x01\x26\xf0\x00\x06\x01\x26\xf0\x12\x14\x01\x11\xf0\x00\x14\x01\x11\xf0\x00\x14\x01\x11\xf0\x2e\x10\x01\x17\xf0\x00\x10\x01\x17\xf0\x00\x10\x01\x17\xf0\x26\x0a\x01\x0d\xf0\x00\x0a\x01\x0d\xf0\x00\x0a\x01\x0d\xf0\x1a\x34\x01\x17\xf0\x00\x34\x01\x17\xf0\x00\x34\x01\x17\xf0\x6e\x01\x17\x01\x17\xf0\x00\x17\x01\x17\xf0\x00\x17\x01\x17\xf0\x00\x17\x01\x17\xf0\x34\x16\x01\x10\xf0\x00\x16\x01\x10\xf0\x00\x16\x01\x10\xf0\x40\x01\x14\x01\x23\xf0\x00\x14\x01\x23\xf0\x00\x14\x01\x23\xf0\x30\x0a\x01\x4b\x01\xf0\x00\x0a\x01\x4b\x01\xf0\x00\x0a\x01\x4b\x01\xf0\x1a\x0a\x01\x15\xf0\x00\x0a\x01\x15\xf0\x00\x0a\x01\x15\xf0\x1a\x0f\x01\x15\xf0\x00\x0f\x01\x15\xf0\x00\x0f\x01\x15\xf0\x22\x0d\x01\x17\xf0\x00\x0d\x01\x17\xf0\x00\x0d\x01\x17\xf0\x1e\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x00\x1f\x01\x18\xf0\x42\x01\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x00\x07\x01\x17\xf0\x12\x0d\x01\x37\xf0\x00\x0d\x01\x37\xf0\x00\x0d\x01\x37\xf0\x20\x17\x01\x15\xf0\x00\x17\x01\x15\xf0\x00\x17\x01\x15\xf0\x34\x01\x01\x2c\xf0\x00\x01\x01\x2c\xf0\x00\x01\x01\x2c\xf0\x06\x39\x01\x30\xf0\x00\x39\x01\x30\xf0\x00\x39\x01\x30\xf0\x76\x01\x31\x01\x17\xf0\x00\x31\x01\x17\xf0\x00\x31\x01\x17\xf0\x68\x01\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x28\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x00\x11\x01\x2f\xf0\x28\x1b\x01\x1c\xf0\x00\x1b\x01\x1c\xf0\x00\x1b\x01\x1c\xf0\x3e\x00\x08\x0b\x84\x79\xd4\x07\x18\xf0\x00\x01\x01\x0b\xd8\x04\x08\x80\x44\x81\x46\x84\x46\x80\x46\xf0\x04\x34\x01\x15\xf0\x00\x34\x01\x15\xf0\x00\x34\x01\x15\xf0\x6c\x01\x00\x04\x0c\x88\x7a\xd2\x03\x19\xd0\x03\x19\xd8\x04\x0b\x80\x47\x81\x49\x84\x49\x80\x49\x80\x49\x80\x49\xf0\x03\x00\x04\x1a\xd0\x03\x19", }; static - struct _PyCode_DEF(320) + struct _PyCode_DEF(328) site_toplevel = { .ob_base = { .ob_base = { .ob_refcnt = 999999999, .ob_type = &PyCode_Type, }, - .ob_size = 160, + .ob_size = 164, }, .co_consts = & site_toplevel_consts._object.ob_base.ob_base, .co_names = & site_toplevel_names._object.ob_base.ob_base, @@ -133765,7 +133887,7 @@ site_toplevel = { .co_linetable = & site_toplevel_linetable.ob_base.ob_base, ._co_code = NULL, ._co_linearray = NULL, - .co_code_adaptive = "\x97\x00\x64\x00\x5a\x00\x64\x01\x64\x02\x6c\x01\x5a\x01\x64\x01\x64\x02\x6c\x02\x5a\x02\x64\x01\x64\x02\x6c\x03\x5a\x03\x64\x01\x64\x02\x6c\x04\x5a\x04\x64\x01\x64\x02\x6c\x05\x5a\x05\x65\x01\x6a\x06\x00\x00\x00\x00\x00\x00\x00\x00\x65\x01\x6a\x07\x00\x00\x00\x00\x00\x00\x00\x00\x67\x02\x61\x08\x64\x02\x61\x09\x64\x02\x61\x0a\x64\x02\x61\x0b\x64\x03\x84\x00\x5a\x0c\x64\x04\x84\x00\x5a\x0d\x64\x05\x84\x00\x5a\x0e\x64\x06\x84\x00\x5a\x0f\x64\x07\x84\x00\x5a\x10\x64\x08\x84\x00\x5a\x11\x64\x1c\x64\x09\x84\x01\x5a\x12\x64\x0a\x84\x00\x5a\x13\x64\x0b\x84\x00\x5a\x14\x64\x0c\x84\x00\x5a\x15\x64\x0d\x84\x00\x5a\x16\x64\x0e\x84\x00\x5a\x17\x64\x0f\x84\x00\x5a\x18\x64\x1c\x64\x10\x84\x01\x5a\x19\x64\x1c\x64\x11\x84\x01\x5a\x1a\x64\x12\x84\x00\x5a\x1b\x64\x13\x84\x00\x5a\x1c\x64\x14\x84\x00\x5a\x1d\x64\x15\x84\x00\x5a\x1e\x64\x16\x84\x00\x5a\x1f\x64\x17\x84\x00\x5a\x20\x64\x18\x84\x00\x5a\x21\x64\x19\x84\x00\x5a\x22\x65\x01\x6a\x23\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x24\x00\x00\x00\x00\x00\x00\x00\x00\x73\x0a\x02\x00\x65\x22\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x1a\x84\x00\x5a\x25\x65\x26\x64\x1b\x6b\x02\x00\x00\x00\x00\x72\x0c\x02\x00\x65\x25\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x02\x53\x00\x64\x02\x53\x00", + .co_code_adaptive = "\x97\x00\x64\x00\x5a\x00\x64\x01\x64\x02\x6c\x01\x5a\x01\x64\x01\x64\x02\x6c\x02\x5a\x02\x64\x01\x64\x02\x6c\x03\x5a\x03\x64\x01\x64\x02\x6c\x04\x5a\x04\x64\x01\x64\x02\x6c\x05\x5a\x05\x64\x01\x64\x02\x6c\x06\x5a\x06\x65\x01\x6a\x07\x00\x00\x00\x00\x00\x00\x00\x00\x65\x01\x6a\x08\x00\x00\x00\x00\x00\x00\x00\x00\x67\x02\x61\x09\x64\x02\x61\x0a\x64\x02\x61\x0b\x64\x02\x61\x0c\x64\x03\x84\x00\x5a\x0d\x64\x04\x84\x00\x5a\x0e\x64\x05\x84\x00\x5a\x0f\x64\x06\x84\x00\x5a\x10\x64\x07\x84\x00\x5a\x11\x64\x08\x84\x00\x5a\x12\x64\x1c\x64\x09\x84\x01\x5a\x13\x64\x0a\x84\x00\x5a\x14\x64\x0b\x84\x00\x5a\x15\x64\x0c\x84\x00\x5a\x16\x64\x0d\x84\x00\x5a\x17\x64\x0e\x84\x00\x5a\x18\x64\x0f\x84\x00\x5a\x19\x64\x1c\x64\x10\x84\x01\x5a\x1a\x64\x1c\x64\x11\x84\x01\x5a\x1b\x64\x12\x84\x00\x5a\x1c\x64\x13\x84\x00\x5a\x1d\x64\x14\x84\x00\x5a\x1e\x64\x15\x84\x00\x5a\x1f\x64\x16\x84\x00\x5a\x20\x64\x17\x84\x00\x5a\x21\x64\x18\x84\x00\x5a\x22\x64\x19\x84\x00\x5a\x23\x65\x01\x6a\x24\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x25\x00\x00\x00\x00\x00\x00\x00\x00\x73\x0a\x02\x00\x65\x23\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x1a\x84\x00\x5a\x26\x65\x27\x64\x1b\x6b\x02\x00\x00\x00\x00\x72\x0c\x02\x00\x65\x26\xa6\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x64\x02\x53\x00\x64\x02\x53\x00", ._co_firsttraceable = 0, }; static void site_do_patchups(void) { @@ -137060,28 +137182,6 @@ const_str_UF_COMPRESSED = { static struct { PyASCIIObject _ascii; - uint8_t _data[10]; - } -const_str_UF_HIDDEN = { - ._ascii = { - .ob_base = { - .ob_refcnt = 999999999, - .ob_type = &PyUnicode_Type, - }, - .length = 9, - .hash = -1, - .state = { - .kind = 1, - .compact = 1, - .ascii = 1, - .ready = 1, - }, - }, - ._data = "UF_HIDDEN", -}; -static - struct { - PyASCIIObject _ascii; uint8_t _data[12]; } const_str_SF_ARCHIVED = { @@ -137302,28 +137402,6 @@ const_str_FILE_ATTRIBUTE_ENCRYPTED = { static struct { PyASCIIObject _ascii; - uint8_t _data[22]; - } -const_str_FILE_ATTRIBUTE_HIDDEN = { - ._ascii = { - .ob_base = { - .ob_refcnt = 999999999, - .ob_type = &PyUnicode_Type, - }, - .length = 21, - .hash = -1, - .state = { - .kind = 1, - .compact = 1, - .ascii = 1, - .ready = 1, - }, - }, - ._data = "FILE_ATTRIBUTE_HIDDEN", -}; -static - struct { - PyASCIIObject _ascii; uint8_t _data[32]; } const_str_FILE_ATTRIBUTE_INTEGRITY_STREAM = { @@ -151105,11 +151183,16 @@ _Py_Deepfreeze_Fini(void) { _PyStaticUnicode_Dealloc((PyObject *)&const_str_itemcase); _PyStaticCode_Dealloc((PyCodeObject *)&site_toplevel_consts_7); _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_0); - _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_4); - _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_9_1); - _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_10); + _PyStaticUnicode_Dealloc((PyObject *)&const_str_st_flags); + _PyStaticUnicode_Dealloc((PyObject *)&const_str_st_file_attributes); + _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_7); + _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_8); + _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_13_1); _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_14); - _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_15); + _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_17); + _PyStaticUnicode_Dealloc((PyObject *)&site_toplevel_consts_8_consts_18); + _PyStaticUnicode_Dealloc((PyObject *)&const_str_UF_HIDDEN); + _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_HIDDEN); _PyStaticUnicode_Dealloc((PyObject *)&const_str_strip); _PyStaticUnicode_Dealloc((PyObject *)&const_str_traceback); _PyStaticUnicode_Dealloc((PyObject *)&const_str_format_exception); @@ -151382,7 +151465,6 @@ _Py_Deepfreeze_Fini(void) { _PyStaticUnicode_Dealloc((PyObject *)&const_str_UF_OPAQUE); _PyStaticUnicode_Dealloc((PyObject *)&const_str_UF_NOUNLINK); _PyStaticUnicode_Dealloc((PyObject *)&const_str_UF_COMPRESSED); - _PyStaticUnicode_Dealloc((PyObject *)&const_str_UF_HIDDEN); _PyStaticUnicode_Dealloc((PyObject *)&const_str_SF_ARCHIVED); _PyStaticUnicode_Dealloc((PyObject *)&const_str_SF_IMMUTABLE); _PyStaticUnicode_Dealloc((PyObject *)&const_str_SF_APPEND); @@ -151393,7 +151475,6 @@ _Py_Deepfreeze_Fini(void) { _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_DEVICE); _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_DIRECTORY); _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_ENCRYPTED); - _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_HIDDEN); _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_INTEGRITY_STREAM); _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_NORMAL); _PyStaticUnicode_Dealloc((PyObject *)&const_str_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); diff --git a/contrib/tools/python3/src/Python/import.c b/contrib/tools/python3/src/Python/import.c index f1c9b478b2..2151bc09f1 100644 --- a/contrib/tools/python3/src/Python/import.c +++ b/contrib/tools/python3/src/Python/import.c @@ -2196,7 +2196,7 @@ _imp_get_frozen_object_impl(PyObject *module, PyObject *name, struct frozen_info info = {0}; Py_buffer buf = {0}; if (PyObject_CheckBuffer(dataobj)) { - if (PyObject_GetBuffer(dataobj, &buf, PyBUF_READ) != 0) { + if (PyObject_GetBuffer(dataobj, &buf, PyBUF_SIMPLE) != 0) { return NULL; } info.data = (const char *)buf.buf; diff --git a/contrib/tools/python3/src/Python/pythonrun.c b/contrib/tools/python3/src/Python/pythonrun.c index 91c2ad3a13..fca8b7ab66 100644 --- a/contrib/tools/python3/src/Python/pythonrun.c +++ b/contrib/tools/python3/src/Python/pythonrun.c @@ -1200,6 +1200,37 @@ error: } static int +get_exception_notes(struct exception_print_context *ctx, PyObject *value, PyObject **notes) { + PyObject *note = NULL; + + if (_PyObject_LookupAttr(value, &_Py_ID(__notes__), notes) < 0) { + PyObject *type, *errvalue, *tback; + PyErr_Fetch(&type, &errvalue, &tback); + PyErr_NormalizeException(&type, &errvalue, &tback); + note = PyUnicode_FromFormat("Ignored error getting __notes__: %R", errvalue); + Py_XDECREF(type); + Py_XDECREF(errvalue); + Py_XDECREF(tback); + if (!note) { + goto error; + } + *notes = PyList_New(1); + if (!*notes) { + goto error; + } + if (PyList_SetItem(*notes, 0, note) < 0) { + Py_DECREF(*notes); + goto error; + } + } + + return 0; +error: + Py_XDECREF(note); + return -1; +} + +static int print_exception(struct exception_print_context *ctx, PyObject *value) { PyObject *notes = NULL; @@ -1218,7 +1249,7 @@ print_exception(struct exception_print_context *ctx, PyObject *value) /* grab the type and notes now because value can change below */ PyObject *type = (PyObject *) Py_TYPE(value); - if (_PyObject_LookupAttr(value, &_Py_ID(__notes__), ¬es) < 0) { + if (get_exception_notes(ctx, value, ¬es) < 0) { goto error; } diff --git a/contrib/tools/python3/src/Python/specialize.c b/contrib/tools/python3/src/Python/specialize.c index 4a5213c31c..3441e844e1 100644 --- a/contrib/tools/python3/src/Python/specialize.c +++ b/contrib/tools/python3/src/Python/specialize.c @@ -481,6 +481,7 @@ miss_counter_start(void) { #define SPEC_FAIL_UNPACK_SEQUENCE_ITERATOR 8 #define SPEC_FAIL_UNPACK_SEQUENCE_SEQUENCE 9 +static uint32_t type_get_version(PyTypeObject *t, int opcode); static int specialize_module_load_attr(PyObject *owner, _Py_CODEUNIT *instr, @@ -673,6 +674,9 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) } PyObject *descr; DescriptorClassification kind = analyze_descriptor(type, name, &descr, 0); + if (type_get_version(type, LOAD_ATTR) == 0) { + goto fail; + } switch(kind) { case OVERRIDING: SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_OVERRIDING_DESCRIPTOR); @@ -766,6 +770,9 @@ _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) } PyObject *descr; DescriptorClassification kind = analyze_descriptor(type, name, &descr, 1); + if (type_get_version(type, STORE_ATTR) == 0) { + goto fail; + } switch(kind) { case OVERRIDING: SPECIALIZATION_FAIL(STORE_ATTR, SPEC_FAIL_ATTR_OVERRIDING_DESCRIPTOR); @@ -889,6 +896,9 @@ specialize_class_load_method(PyObject *owner, _Py_CODEUNIT *instr, PyObject *descr = NULL; DescriptorClassification kind = 0; kind = analyze_descriptor((PyTypeObject *)owner, name, &descr, 0); + if (type_get_version((PyTypeObject *)owner, LOAD_METHOD) == 0) { + return -1; + } switch (kind) { case METHOD: case NON_DESCRIPTOR: @@ -950,6 +960,9 @@ _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) PyObject *descr = NULL; DescriptorClassification kind = 0; kind = analyze_descriptor(owner_cls, name, &descr, 0); + if (type_get_version(owner_cls, LOAD_METHOD) == 0) { + goto fail; + } assert(descr != NULL || kind == ABSENT || kind == GETSET_OVERRIDDEN); if (kind != METHOD) { SPECIALIZATION_FAIL(LOAD_METHOD, load_method_fail_kind(kind)); @@ -1183,6 +1196,18 @@ function_kind(PyCodeObject *code) { return SIMPLE_FUNCTION; } +/* Returning 0 indicates a failure. */ +static uint32_t +type_get_version(PyTypeObject *t, int opcode) +{ + uint32_t version = t->tp_version_tag; + if (version == 0) { + SPECIALIZATION_FAIL(opcode, SPEC_FAIL_OUT_OF_VERSIONS); + return 0; + } + return version; +} + int _Py_Specialize_BinarySubscr( PyObject *container, PyObject *sub, _Py_CODEUNIT *instr) @@ -1231,6 +1256,9 @@ _Py_Specialize_BinarySubscr( SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_WRONG_NUMBER_ARGUMENTS); goto fail; } + if (type_get_version(cls, BINARY_SUBSCR) == 0) { + goto fail; + } assert(cls->tp_version_tag != 0); write_u32(cache->type_version, cls->tp_version_tag); int version = _PyFunction_GetVersionForCurrentState(func); diff --git a/contrib/tools/python3/src/Python/structmember.c b/contrib/tools/python3/src/Python/structmember.c index c7e318811d..c790656978 100644 --- a/contrib/tools/python3/src/Python/structmember.c +++ b/contrib/tools/python3/src/Python/structmember.c @@ -187,45 +187,74 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) WARN("Truncation of value to int"); break; } - case T_UINT:{ - unsigned long ulong_val = PyLong_AsUnsignedLong(v); - if ((ulong_val == (unsigned long)-1) && PyErr_Occurred()) { - /* XXX: For compatibility, accept negative int values - as well. */ - PyErr_Clear(); - ulong_val = PyLong_AsLong(v); - if ((ulong_val == (unsigned long)-1) && - PyErr_Occurred()) + case T_UINT: { + /* XXX: For compatibility, accept negative int values + as well. */ + int overflow; + long long_val = PyLong_AsLongAndOverflow(v, &overflow); + if (long_val == -1 && PyErr_Occurred()) { + return -1; + } + if (overflow < 0) { + PyErr_SetString(PyExc_OverflowError, + "Python int too large to convert to C long"); + return -1; + } + else if (!overflow) { + *(unsigned int *)addr = (unsigned int)(unsigned long)long_val; + if (long_val < 0) { + WARN("Writing negative value into unsigned field"); + } + else if ((unsigned long)long_val > UINT_MAX) { + WARN("Truncation of value to unsigned short"); + } + } + else { + unsigned long ulong_val = PyLong_AsUnsignedLong(v); + if (ulong_val == (unsigned long)-1 && PyErr_Occurred()) { return -1; - *(unsigned int *)addr = (unsigned int)ulong_val; - WARN("Writing negative value into unsigned field"); - } else - *(unsigned int *)addr = (unsigned int)ulong_val; - if (ulong_val > UINT_MAX) - WARN("Truncation of value to unsigned int"); - break; + } + *(unsigned int*)addr = (unsigned int)ulong_val; + if (ulong_val > UINT_MAX) { + WARN("Truncation of value to unsigned int"); + } } + break; + } case T_LONG:{ *(long*)addr = PyLong_AsLong(v); if ((*(long*)addr == -1) && PyErr_Occurred()) return -1; break; } - case T_ULONG:{ - *(unsigned long*)addr = PyLong_AsUnsignedLong(v); - if ((*(unsigned long*)addr == (unsigned long)-1) - && PyErr_Occurred()) { - /* XXX: For compatibility, accept negative int values - as well. */ - PyErr_Clear(); - *(unsigned long*)addr = PyLong_AsLong(v); - if ((*(unsigned long*)addr == (unsigned long)-1) - && PyErr_Occurred()) + case T_ULONG: { + /* XXX: For compatibility, accept negative int values + as well. */ + int overflow; + long long_val = PyLong_AsLongAndOverflow(v, &overflow); + if (long_val == -1 && PyErr_Occurred()) { + return -1; + } + if (overflow < 0) { + PyErr_SetString(PyExc_OverflowError, + "Python int too large to convert to C long"); + return -1; + } + else if (!overflow) { + *(unsigned long *)addr = (unsigned long)long_val; + if (long_val < 0) { + WARN("Writing negative value into unsigned field"); + } + } + else { + unsigned long ulong_val = PyLong_AsUnsignedLong(v); + if (ulong_val == (unsigned long)-1 && PyErr_Occurred()) { return -1; - WARN("Writing negative value into unsigned field"); + } + *(unsigned long*)addr = ulong_val; } break; - } + } case T_PYSSIZET:{ *(Py_ssize_t*)addr = PyLong_AsSsize_t(v); if ((*(Py_ssize_t*)addr == (Py_ssize_t)-1) diff --git a/contrib/tools/python3/src/Python/symtable.c b/contrib/tools/python3/src/Python/symtable.c index 37e5c69740..3519f62098 100644 --- a/contrib/tools/python3/src/Python/symtable.c +++ b/contrib/tools/python3/src/Python/symtable.c @@ -728,6 +728,12 @@ update_symbols(PyObject *symbols, PyObject *scopes, } Py_DECREF(name); } + + /* Check if loop ended because of exception in PyIter_Next */ + if (PyErr_Occurred()) { + goto error; + } + Py_DECREF(itr); Py_DECREF(v_free); return 1; diff --git a/contrib/tools/python3/src/Python/sysmodule.c b/contrib/tools/python3/src/Python/sysmodule.c index 25fcd4aecf..fd8819bc46 100644 --- a/contrib/tools/python3/src/Python/sysmodule.c +++ b/contrib/tools/python3/src/Python/sysmodule.c @@ -1282,7 +1282,7 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) } PyDoc_STRVAR(set_asyncgen_hooks_doc, -"set_asyncgen_hooks(* [, firstiter] [, finalizer])\n\ +"set_asyncgen_hooks([firstiter] [, finalizer])\n\ \n\ Set a finalizer for async generators objects." ); |