diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Python | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Python')
66 files changed, 32410 insertions, 32410 deletions
diff --git a/contrib/tools/python3/src/Python/Python-ast.c b/contrib/tools/python3/src/Python/Python-ast.c index 49c3805522..8b1c594a87 100644 --- a/contrib/tools/python3/src/Python/Python-ast.c +++ b/contrib/tools/python3/src/Python/Python-ast.c @@ -4,829 +4,829 @@ #include "Python.h" #include "Python-ast.h" -#include "structmember.h" // PyMemberDef - -typedef struct { - int initialized; - PyObject *AST_type; - PyObject *Add_singleton; - PyObject *Add_type; - PyObject *And_singleton; - PyObject *And_type; - PyObject *AnnAssign_type; - PyObject *Assert_type; - PyObject *Assign_type; - PyObject *AsyncFor_type; - PyObject *AsyncFunctionDef_type; - PyObject *AsyncWith_type; - PyObject *Attribute_type; - PyObject *AugAssign_type; - PyObject *Await_type; - PyObject *BinOp_type; - PyObject *BitAnd_singleton; - PyObject *BitAnd_type; - PyObject *BitOr_singleton; - PyObject *BitOr_type; - PyObject *BitXor_singleton; - PyObject *BitXor_type; - PyObject *BoolOp_type; - PyObject *Break_type; - PyObject *Call_type; - PyObject *ClassDef_type; - PyObject *Compare_type; - PyObject *Constant_type; - PyObject *Continue_type; - PyObject *Del_singleton; - PyObject *Del_type; - PyObject *Delete_type; - PyObject *DictComp_type; - PyObject *Dict_type; - PyObject *Div_singleton; - PyObject *Div_type; - PyObject *Eq_singleton; - PyObject *Eq_type; - PyObject *ExceptHandler_type; - PyObject *Expr_type; - PyObject *Expression_type; - PyObject *FloorDiv_singleton; - PyObject *FloorDiv_type; - PyObject *For_type; - PyObject *FormattedValue_type; - PyObject *FunctionDef_type; - PyObject *FunctionType_type; - PyObject *GeneratorExp_type; - PyObject *Global_type; - PyObject *GtE_singleton; - PyObject *GtE_type; - PyObject *Gt_singleton; - PyObject *Gt_type; - PyObject *IfExp_type; - PyObject *If_type; - PyObject *ImportFrom_type; - PyObject *Import_type; - PyObject *In_singleton; - PyObject *In_type; - PyObject *Interactive_type; - PyObject *Invert_singleton; - PyObject *Invert_type; - PyObject *IsNot_singleton; - PyObject *IsNot_type; - PyObject *Is_singleton; - PyObject *Is_type; - PyObject *JoinedStr_type; - PyObject *LShift_singleton; - PyObject *LShift_type; - PyObject *Lambda_type; - PyObject *ListComp_type; - PyObject *List_type; - PyObject *Load_singleton; - PyObject *Load_type; - PyObject *LtE_singleton; - PyObject *LtE_type; - PyObject *Lt_singleton; - PyObject *Lt_type; - PyObject *MatMult_singleton; - PyObject *MatMult_type; - PyObject *Mod_singleton; - PyObject *Mod_type; - PyObject *Module_type; - PyObject *Mult_singleton; - PyObject *Mult_type; - PyObject *Name_type; - PyObject *NamedExpr_type; - PyObject *Nonlocal_type; - PyObject *NotEq_singleton; - PyObject *NotEq_type; - PyObject *NotIn_singleton; - PyObject *NotIn_type; - PyObject *Not_singleton; - PyObject *Not_type; - PyObject *Or_singleton; - PyObject *Or_type; - PyObject *Pass_type; - PyObject *Pow_singleton; - PyObject *Pow_type; - PyObject *RShift_singleton; - PyObject *RShift_type; - PyObject *Raise_type; - PyObject *Return_type; - PyObject *SetComp_type; - PyObject *Set_type; - PyObject *Slice_type; - PyObject *Starred_type; - PyObject *Store_singleton; - PyObject *Store_type; - PyObject *Sub_singleton; - PyObject *Sub_type; - PyObject *Subscript_type; - PyObject *Try_type; - PyObject *Tuple_type; - PyObject *TypeIgnore_type; - PyObject *UAdd_singleton; - PyObject *UAdd_type; - PyObject *USub_singleton; - PyObject *USub_type; - PyObject *UnaryOp_type; - PyObject *While_type; - PyObject *With_type; - PyObject *YieldFrom_type; - PyObject *Yield_type; - PyObject *__dict__; - PyObject *__doc__; - PyObject *__module__; - PyObject *_attributes; - PyObject *_fields; - PyObject *alias_type; - PyObject *annotation; - PyObject *arg; - PyObject *arg_type; - PyObject *args; - PyObject *argtypes; - PyObject *arguments_type; - PyObject *asname; - PyObject *ast; - PyObject *attr; - PyObject *bases; - PyObject *body; - PyObject *boolop_type; - PyObject *cause; - PyObject *cmpop_type; - PyObject *col_offset; - PyObject *comparators; - PyObject *comprehension_type; - PyObject *context_expr; - PyObject *conversion; - PyObject *ctx; - PyObject *decorator_list; - PyObject *defaults; - PyObject *elt; - PyObject *elts; - PyObject *end_col_offset; - PyObject *end_lineno; - PyObject *exc; - PyObject *excepthandler_type; - PyObject *expr_context_type; - PyObject *expr_type; - PyObject *finalbody; - PyObject *format_spec; - PyObject *func; - PyObject *generators; - PyObject *handlers; - PyObject *id; - PyObject *ifs; - PyObject *is_async; - PyObject *items; - PyObject *iter; - PyObject *key; - PyObject *keys; - PyObject *keyword_type; - PyObject *keywords; - PyObject *kind; - PyObject *kw_defaults; - PyObject *kwarg; - PyObject *kwonlyargs; - PyObject *left; - PyObject *level; - PyObject *lineno; - PyObject *lower; - PyObject *mod_type; - PyObject *module; - PyObject *msg; - PyObject *name; - PyObject *names; - PyObject *op; - PyObject *operand; - PyObject *operator_type; - PyObject *ops; - PyObject *optional_vars; - PyObject *orelse; - PyObject *posonlyargs; - PyObject *returns; - PyObject *right; - PyObject *simple; - PyObject *slice; - PyObject *step; - PyObject *stmt_type; - PyObject *tag; - PyObject *target; - PyObject *targets; - PyObject *test; - PyObject *type; - PyObject *type_comment; - PyObject *type_ignore_type; - PyObject *type_ignores; - PyObject *unaryop_type; - PyObject *upper; - PyObject *value; - PyObject *values; - PyObject *vararg; - PyObject *withitem_type; -} astmodulestate; - - -// Forward declaration -static int init_types(astmodulestate *state); - -// bpo-41194, bpo-41261, bpo-41631: The _ast module uses a global state. -static astmodulestate global_ast_state = {0}; - -static astmodulestate* -get_global_ast_state(void) -{ - astmodulestate* state = &global_ast_state; - if (!init_types(state)) { - return NULL; - } - return state; -} - -static astmodulestate* -get_ast_state(PyObject* Py_UNUSED(module)) -{ - astmodulestate* state = get_global_ast_state(); - // get_ast_state() must only be called after _ast module is imported, - // and astmodule_exec() calls init_types() - assert(state != NULL); - return state; -} - -void _PyAST_Fini() -{ - astmodulestate* state = &global_ast_state; - Py_CLEAR(state->AST_type); - Py_CLEAR(state->Add_singleton); - Py_CLEAR(state->Add_type); - Py_CLEAR(state->And_singleton); - Py_CLEAR(state->And_type); - Py_CLEAR(state->AnnAssign_type); - Py_CLEAR(state->Assert_type); - Py_CLEAR(state->Assign_type); - Py_CLEAR(state->AsyncFor_type); - Py_CLEAR(state->AsyncFunctionDef_type); - Py_CLEAR(state->AsyncWith_type); - Py_CLEAR(state->Attribute_type); - Py_CLEAR(state->AugAssign_type); - Py_CLEAR(state->Await_type); - Py_CLEAR(state->BinOp_type); - Py_CLEAR(state->BitAnd_singleton); - Py_CLEAR(state->BitAnd_type); - Py_CLEAR(state->BitOr_singleton); - Py_CLEAR(state->BitOr_type); - Py_CLEAR(state->BitXor_singleton); - Py_CLEAR(state->BitXor_type); - Py_CLEAR(state->BoolOp_type); - Py_CLEAR(state->Break_type); - Py_CLEAR(state->Call_type); - Py_CLEAR(state->ClassDef_type); - Py_CLEAR(state->Compare_type); - Py_CLEAR(state->Constant_type); - Py_CLEAR(state->Continue_type); - Py_CLEAR(state->Del_singleton); - Py_CLEAR(state->Del_type); - Py_CLEAR(state->Delete_type); - Py_CLEAR(state->DictComp_type); - Py_CLEAR(state->Dict_type); - Py_CLEAR(state->Div_singleton); - Py_CLEAR(state->Div_type); - Py_CLEAR(state->Eq_singleton); - Py_CLEAR(state->Eq_type); - Py_CLEAR(state->ExceptHandler_type); - Py_CLEAR(state->Expr_type); - Py_CLEAR(state->Expression_type); - Py_CLEAR(state->FloorDiv_singleton); - Py_CLEAR(state->FloorDiv_type); - Py_CLEAR(state->For_type); - Py_CLEAR(state->FormattedValue_type); - Py_CLEAR(state->FunctionDef_type); - Py_CLEAR(state->FunctionType_type); - Py_CLEAR(state->GeneratorExp_type); - Py_CLEAR(state->Global_type); - Py_CLEAR(state->GtE_singleton); - Py_CLEAR(state->GtE_type); - Py_CLEAR(state->Gt_singleton); - Py_CLEAR(state->Gt_type); - Py_CLEAR(state->IfExp_type); - Py_CLEAR(state->If_type); - Py_CLEAR(state->ImportFrom_type); - Py_CLEAR(state->Import_type); - Py_CLEAR(state->In_singleton); - Py_CLEAR(state->In_type); - Py_CLEAR(state->Interactive_type); - Py_CLEAR(state->Invert_singleton); - Py_CLEAR(state->Invert_type); - Py_CLEAR(state->IsNot_singleton); - Py_CLEAR(state->IsNot_type); - Py_CLEAR(state->Is_singleton); - Py_CLEAR(state->Is_type); - Py_CLEAR(state->JoinedStr_type); - Py_CLEAR(state->LShift_singleton); - Py_CLEAR(state->LShift_type); - Py_CLEAR(state->Lambda_type); - Py_CLEAR(state->ListComp_type); - Py_CLEAR(state->List_type); - Py_CLEAR(state->Load_singleton); - Py_CLEAR(state->Load_type); - Py_CLEAR(state->LtE_singleton); - Py_CLEAR(state->LtE_type); - Py_CLEAR(state->Lt_singleton); - Py_CLEAR(state->Lt_type); - Py_CLEAR(state->MatMult_singleton); - Py_CLEAR(state->MatMult_type); - Py_CLEAR(state->Mod_singleton); - Py_CLEAR(state->Mod_type); - Py_CLEAR(state->Module_type); - Py_CLEAR(state->Mult_singleton); - Py_CLEAR(state->Mult_type); - Py_CLEAR(state->Name_type); - Py_CLEAR(state->NamedExpr_type); - Py_CLEAR(state->Nonlocal_type); - Py_CLEAR(state->NotEq_singleton); - Py_CLEAR(state->NotEq_type); - Py_CLEAR(state->NotIn_singleton); - Py_CLEAR(state->NotIn_type); - Py_CLEAR(state->Not_singleton); - Py_CLEAR(state->Not_type); - Py_CLEAR(state->Or_singleton); - Py_CLEAR(state->Or_type); - Py_CLEAR(state->Pass_type); - Py_CLEAR(state->Pow_singleton); - Py_CLEAR(state->Pow_type); - Py_CLEAR(state->RShift_singleton); - Py_CLEAR(state->RShift_type); - Py_CLEAR(state->Raise_type); - Py_CLEAR(state->Return_type); - Py_CLEAR(state->SetComp_type); - Py_CLEAR(state->Set_type); - Py_CLEAR(state->Slice_type); - Py_CLEAR(state->Starred_type); - Py_CLEAR(state->Store_singleton); - Py_CLEAR(state->Store_type); - Py_CLEAR(state->Sub_singleton); - Py_CLEAR(state->Sub_type); - Py_CLEAR(state->Subscript_type); - Py_CLEAR(state->Try_type); - Py_CLEAR(state->Tuple_type); - Py_CLEAR(state->TypeIgnore_type); - Py_CLEAR(state->UAdd_singleton); - Py_CLEAR(state->UAdd_type); - Py_CLEAR(state->USub_singleton); - Py_CLEAR(state->USub_type); - Py_CLEAR(state->UnaryOp_type); - Py_CLEAR(state->While_type); - Py_CLEAR(state->With_type); - Py_CLEAR(state->YieldFrom_type); - Py_CLEAR(state->Yield_type); - Py_CLEAR(state->__dict__); - Py_CLEAR(state->__doc__); - Py_CLEAR(state->__module__); - Py_CLEAR(state->_attributes); - Py_CLEAR(state->_fields); - Py_CLEAR(state->alias_type); - Py_CLEAR(state->annotation); - Py_CLEAR(state->arg); - Py_CLEAR(state->arg_type); - Py_CLEAR(state->args); - Py_CLEAR(state->argtypes); - Py_CLEAR(state->arguments_type); - Py_CLEAR(state->asname); - Py_CLEAR(state->ast); - Py_CLEAR(state->attr); - Py_CLEAR(state->bases); - Py_CLEAR(state->body); - Py_CLEAR(state->boolop_type); - Py_CLEAR(state->cause); - Py_CLEAR(state->cmpop_type); - Py_CLEAR(state->col_offset); - Py_CLEAR(state->comparators); - Py_CLEAR(state->comprehension_type); - Py_CLEAR(state->context_expr); - Py_CLEAR(state->conversion); - Py_CLEAR(state->ctx); - Py_CLEAR(state->decorator_list); - Py_CLEAR(state->defaults); - Py_CLEAR(state->elt); - Py_CLEAR(state->elts); - Py_CLEAR(state->end_col_offset); - Py_CLEAR(state->end_lineno); - Py_CLEAR(state->exc); - Py_CLEAR(state->excepthandler_type); - Py_CLEAR(state->expr_context_type); - Py_CLEAR(state->expr_type); - Py_CLEAR(state->finalbody); - Py_CLEAR(state->format_spec); - Py_CLEAR(state->func); - Py_CLEAR(state->generators); - Py_CLEAR(state->handlers); - Py_CLEAR(state->id); - Py_CLEAR(state->ifs); - Py_CLEAR(state->is_async); - Py_CLEAR(state->items); - Py_CLEAR(state->iter); - Py_CLEAR(state->key); - Py_CLEAR(state->keys); - Py_CLEAR(state->keyword_type); - Py_CLEAR(state->keywords); - Py_CLEAR(state->kind); - Py_CLEAR(state->kw_defaults); - Py_CLEAR(state->kwarg); - Py_CLEAR(state->kwonlyargs); - Py_CLEAR(state->left); - Py_CLEAR(state->level); - Py_CLEAR(state->lineno); - Py_CLEAR(state->lower); - Py_CLEAR(state->mod_type); - Py_CLEAR(state->module); - Py_CLEAR(state->msg); - Py_CLEAR(state->name); - Py_CLEAR(state->names); - Py_CLEAR(state->op); - Py_CLEAR(state->operand); - Py_CLEAR(state->operator_type); - Py_CLEAR(state->ops); - Py_CLEAR(state->optional_vars); - Py_CLEAR(state->orelse); - Py_CLEAR(state->posonlyargs); - Py_CLEAR(state->returns); - Py_CLEAR(state->right); - Py_CLEAR(state->simple); - Py_CLEAR(state->slice); - Py_CLEAR(state->step); - Py_CLEAR(state->stmt_type); - Py_CLEAR(state->tag); - Py_CLEAR(state->target); - Py_CLEAR(state->targets); - Py_CLEAR(state->test); - Py_CLEAR(state->type); - Py_CLEAR(state->type_comment); - Py_CLEAR(state->type_ignore_type); - Py_CLEAR(state->type_ignores); - Py_CLEAR(state->unaryop_type); - Py_CLEAR(state->upper); - Py_CLEAR(state->value); - Py_CLEAR(state->values); - Py_CLEAR(state->vararg); - Py_CLEAR(state->withitem_type); - - state->initialized = 0; -} - -static int init_identifiers(astmodulestate *state) -{ - if ((state->__dict__ = PyUnicode_InternFromString("__dict__")) == NULL) return 0; - if ((state->__doc__ = PyUnicode_InternFromString("__doc__")) == NULL) return 0; - if ((state->__module__ = PyUnicode_InternFromString("__module__")) == NULL) return 0; - if ((state->_attributes = PyUnicode_InternFromString("_attributes")) == NULL) return 0; - if ((state->_fields = PyUnicode_InternFromString("_fields")) == NULL) return 0; - if ((state->annotation = PyUnicode_InternFromString("annotation")) == NULL) return 0; - if ((state->arg = PyUnicode_InternFromString("arg")) == NULL) return 0; - if ((state->args = PyUnicode_InternFromString("args")) == NULL) return 0; - if ((state->argtypes = PyUnicode_InternFromString("argtypes")) == NULL) return 0; - if ((state->asname = PyUnicode_InternFromString("asname")) == NULL) return 0; - if ((state->ast = PyUnicode_InternFromString("ast")) == NULL) return 0; - if ((state->attr = PyUnicode_InternFromString("attr")) == NULL) return 0; - if ((state->bases = PyUnicode_InternFromString("bases")) == NULL) return 0; - if ((state->body = PyUnicode_InternFromString("body")) == NULL) return 0; - if ((state->cause = PyUnicode_InternFromString("cause")) == NULL) return 0; - if ((state->col_offset = PyUnicode_InternFromString("col_offset")) == NULL) return 0; - if ((state->comparators = PyUnicode_InternFromString("comparators")) == NULL) return 0; - if ((state->context_expr = PyUnicode_InternFromString("context_expr")) == NULL) return 0; - if ((state->conversion = PyUnicode_InternFromString("conversion")) == NULL) return 0; - if ((state->ctx = PyUnicode_InternFromString("ctx")) == NULL) return 0; - if ((state->decorator_list = PyUnicode_InternFromString("decorator_list")) == NULL) return 0; - if ((state->defaults = PyUnicode_InternFromString("defaults")) == NULL) return 0; - if ((state->elt = PyUnicode_InternFromString("elt")) == NULL) return 0; - if ((state->elts = PyUnicode_InternFromString("elts")) == NULL) return 0; - if ((state->end_col_offset = PyUnicode_InternFromString("end_col_offset")) == NULL) return 0; - if ((state->end_lineno = PyUnicode_InternFromString("end_lineno")) == NULL) return 0; - if ((state->exc = PyUnicode_InternFromString("exc")) == NULL) return 0; - if ((state->finalbody = PyUnicode_InternFromString("finalbody")) == NULL) return 0; - if ((state->format_spec = PyUnicode_InternFromString("format_spec")) == NULL) return 0; - if ((state->func = PyUnicode_InternFromString("func")) == NULL) return 0; - if ((state->generators = PyUnicode_InternFromString("generators")) == NULL) return 0; - if ((state->handlers = PyUnicode_InternFromString("handlers")) == NULL) return 0; - if ((state->id = PyUnicode_InternFromString("id")) == NULL) return 0; - if ((state->ifs = PyUnicode_InternFromString("ifs")) == NULL) return 0; - if ((state->is_async = PyUnicode_InternFromString("is_async")) == NULL) return 0; - if ((state->items = PyUnicode_InternFromString("items")) == NULL) return 0; - if ((state->iter = PyUnicode_InternFromString("iter")) == NULL) return 0; - if ((state->key = PyUnicode_InternFromString("key")) == NULL) return 0; - if ((state->keys = PyUnicode_InternFromString("keys")) == NULL) return 0; - if ((state->keywords = PyUnicode_InternFromString("keywords")) == NULL) return 0; - if ((state->kind = PyUnicode_InternFromString("kind")) == NULL) return 0; - if ((state->kw_defaults = PyUnicode_InternFromString("kw_defaults")) == NULL) return 0; - if ((state->kwarg = PyUnicode_InternFromString("kwarg")) == NULL) return 0; - if ((state->kwonlyargs = PyUnicode_InternFromString("kwonlyargs")) == NULL) return 0; - if ((state->left = PyUnicode_InternFromString("left")) == NULL) return 0; - if ((state->level = PyUnicode_InternFromString("level")) == NULL) return 0; - if ((state->lineno = PyUnicode_InternFromString("lineno")) == NULL) return 0; - if ((state->lower = PyUnicode_InternFromString("lower")) == NULL) return 0; - if ((state->module = PyUnicode_InternFromString("module")) == NULL) return 0; - if ((state->msg = PyUnicode_InternFromString("msg")) == NULL) return 0; - if ((state->name = PyUnicode_InternFromString("name")) == NULL) return 0; - if ((state->names = PyUnicode_InternFromString("names")) == NULL) return 0; - if ((state->op = PyUnicode_InternFromString("op")) == NULL) return 0; - if ((state->operand = PyUnicode_InternFromString("operand")) == NULL) return 0; - if ((state->ops = PyUnicode_InternFromString("ops")) == NULL) return 0; - if ((state->optional_vars = PyUnicode_InternFromString("optional_vars")) == NULL) return 0; - if ((state->orelse = PyUnicode_InternFromString("orelse")) == NULL) return 0; - if ((state->posonlyargs = PyUnicode_InternFromString("posonlyargs")) == NULL) return 0; - if ((state->returns = PyUnicode_InternFromString("returns")) == NULL) return 0; - if ((state->right = PyUnicode_InternFromString("right")) == NULL) return 0; - if ((state->simple = PyUnicode_InternFromString("simple")) == NULL) return 0; - if ((state->slice = PyUnicode_InternFromString("slice")) == NULL) return 0; - if ((state->step = PyUnicode_InternFromString("step")) == NULL) return 0; - if ((state->tag = PyUnicode_InternFromString("tag")) == NULL) return 0; - if ((state->target = PyUnicode_InternFromString("target")) == NULL) return 0; - if ((state->targets = PyUnicode_InternFromString("targets")) == NULL) return 0; - if ((state->test = PyUnicode_InternFromString("test")) == NULL) return 0; - if ((state->type = PyUnicode_InternFromString("type")) == NULL) return 0; - if ((state->type_comment = PyUnicode_InternFromString("type_comment")) == NULL) return 0; - if ((state->type_ignores = PyUnicode_InternFromString("type_ignores")) == NULL) return 0; - if ((state->upper = PyUnicode_InternFromString("upper")) == NULL) return 0; - if ((state->value = PyUnicode_InternFromString("value")) == NULL) return 0; - if ((state->values = PyUnicode_InternFromString("values")) == NULL) return 0; - if ((state->vararg = PyUnicode_InternFromString("vararg")) == NULL) return 0; - return 1; -}; - -static PyObject* ast2obj_mod(astmodulestate *state, void*); -static const char * const Module_fields[]={ +#include "structmember.h" // PyMemberDef + +typedef struct { + int initialized; + PyObject *AST_type; + PyObject *Add_singleton; + PyObject *Add_type; + PyObject *And_singleton; + PyObject *And_type; + PyObject *AnnAssign_type; + PyObject *Assert_type; + PyObject *Assign_type; + PyObject *AsyncFor_type; + PyObject *AsyncFunctionDef_type; + PyObject *AsyncWith_type; + PyObject *Attribute_type; + PyObject *AugAssign_type; + PyObject *Await_type; + PyObject *BinOp_type; + PyObject *BitAnd_singleton; + PyObject *BitAnd_type; + PyObject *BitOr_singleton; + PyObject *BitOr_type; + PyObject *BitXor_singleton; + PyObject *BitXor_type; + PyObject *BoolOp_type; + PyObject *Break_type; + PyObject *Call_type; + PyObject *ClassDef_type; + PyObject *Compare_type; + PyObject *Constant_type; + PyObject *Continue_type; + PyObject *Del_singleton; + PyObject *Del_type; + PyObject *Delete_type; + PyObject *DictComp_type; + PyObject *Dict_type; + PyObject *Div_singleton; + PyObject *Div_type; + PyObject *Eq_singleton; + PyObject *Eq_type; + PyObject *ExceptHandler_type; + PyObject *Expr_type; + PyObject *Expression_type; + PyObject *FloorDiv_singleton; + PyObject *FloorDiv_type; + PyObject *For_type; + PyObject *FormattedValue_type; + PyObject *FunctionDef_type; + PyObject *FunctionType_type; + PyObject *GeneratorExp_type; + PyObject *Global_type; + PyObject *GtE_singleton; + PyObject *GtE_type; + PyObject *Gt_singleton; + PyObject *Gt_type; + PyObject *IfExp_type; + PyObject *If_type; + PyObject *ImportFrom_type; + PyObject *Import_type; + PyObject *In_singleton; + PyObject *In_type; + PyObject *Interactive_type; + PyObject *Invert_singleton; + PyObject *Invert_type; + PyObject *IsNot_singleton; + PyObject *IsNot_type; + PyObject *Is_singleton; + PyObject *Is_type; + PyObject *JoinedStr_type; + PyObject *LShift_singleton; + PyObject *LShift_type; + PyObject *Lambda_type; + PyObject *ListComp_type; + PyObject *List_type; + PyObject *Load_singleton; + PyObject *Load_type; + PyObject *LtE_singleton; + PyObject *LtE_type; + PyObject *Lt_singleton; + PyObject *Lt_type; + PyObject *MatMult_singleton; + PyObject *MatMult_type; + PyObject *Mod_singleton; + PyObject *Mod_type; + PyObject *Module_type; + PyObject *Mult_singleton; + PyObject *Mult_type; + PyObject *Name_type; + PyObject *NamedExpr_type; + PyObject *Nonlocal_type; + PyObject *NotEq_singleton; + PyObject *NotEq_type; + PyObject *NotIn_singleton; + PyObject *NotIn_type; + PyObject *Not_singleton; + PyObject *Not_type; + PyObject *Or_singleton; + PyObject *Or_type; + PyObject *Pass_type; + PyObject *Pow_singleton; + PyObject *Pow_type; + PyObject *RShift_singleton; + PyObject *RShift_type; + PyObject *Raise_type; + PyObject *Return_type; + PyObject *SetComp_type; + PyObject *Set_type; + PyObject *Slice_type; + PyObject *Starred_type; + PyObject *Store_singleton; + PyObject *Store_type; + PyObject *Sub_singleton; + PyObject *Sub_type; + PyObject *Subscript_type; + PyObject *Try_type; + PyObject *Tuple_type; + PyObject *TypeIgnore_type; + PyObject *UAdd_singleton; + PyObject *UAdd_type; + PyObject *USub_singleton; + PyObject *USub_type; + PyObject *UnaryOp_type; + PyObject *While_type; + PyObject *With_type; + PyObject *YieldFrom_type; + PyObject *Yield_type; + PyObject *__dict__; + PyObject *__doc__; + PyObject *__module__; + PyObject *_attributes; + PyObject *_fields; + PyObject *alias_type; + PyObject *annotation; + PyObject *arg; + PyObject *arg_type; + PyObject *args; + PyObject *argtypes; + PyObject *arguments_type; + PyObject *asname; + PyObject *ast; + PyObject *attr; + PyObject *bases; + PyObject *body; + PyObject *boolop_type; + PyObject *cause; + PyObject *cmpop_type; + PyObject *col_offset; + PyObject *comparators; + PyObject *comprehension_type; + PyObject *context_expr; + PyObject *conversion; + PyObject *ctx; + PyObject *decorator_list; + PyObject *defaults; + PyObject *elt; + PyObject *elts; + PyObject *end_col_offset; + PyObject *end_lineno; + PyObject *exc; + PyObject *excepthandler_type; + PyObject *expr_context_type; + PyObject *expr_type; + PyObject *finalbody; + PyObject *format_spec; + PyObject *func; + PyObject *generators; + PyObject *handlers; + PyObject *id; + PyObject *ifs; + PyObject *is_async; + PyObject *items; + PyObject *iter; + PyObject *key; + PyObject *keys; + PyObject *keyword_type; + PyObject *keywords; + PyObject *kind; + PyObject *kw_defaults; + PyObject *kwarg; + PyObject *kwonlyargs; + PyObject *left; + PyObject *level; + PyObject *lineno; + PyObject *lower; + PyObject *mod_type; + PyObject *module; + PyObject *msg; + PyObject *name; + PyObject *names; + PyObject *op; + PyObject *operand; + PyObject *operator_type; + PyObject *ops; + PyObject *optional_vars; + PyObject *orelse; + PyObject *posonlyargs; + PyObject *returns; + PyObject *right; + PyObject *simple; + PyObject *slice; + PyObject *step; + PyObject *stmt_type; + PyObject *tag; + PyObject *target; + PyObject *targets; + PyObject *test; + PyObject *type; + PyObject *type_comment; + PyObject *type_ignore_type; + PyObject *type_ignores; + PyObject *unaryop_type; + PyObject *upper; + PyObject *value; + PyObject *values; + PyObject *vararg; + PyObject *withitem_type; +} astmodulestate; + + +// Forward declaration +static int init_types(astmodulestate *state); + +// bpo-41194, bpo-41261, bpo-41631: The _ast module uses a global state. +static astmodulestate global_ast_state = {0}; + +static astmodulestate* +get_global_ast_state(void) +{ + astmodulestate* state = &global_ast_state; + if (!init_types(state)) { + return NULL; + } + return state; +} + +static astmodulestate* +get_ast_state(PyObject* Py_UNUSED(module)) +{ + astmodulestate* state = get_global_ast_state(); + // get_ast_state() must only be called after _ast module is imported, + // and astmodule_exec() calls init_types() + assert(state != NULL); + return state; +} + +void _PyAST_Fini() +{ + astmodulestate* state = &global_ast_state; + Py_CLEAR(state->AST_type); + Py_CLEAR(state->Add_singleton); + Py_CLEAR(state->Add_type); + Py_CLEAR(state->And_singleton); + Py_CLEAR(state->And_type); + Py_CLEAR(state->AnnAssign_type); + Py_CLEAR(state->Assert_type); + Py_CLEAR(state->Assign_type); + Py_CLEAR(state->AsyncFor_type); + Py_CLEAR(state->AsyncFunctionDef_type); + Py_CLEAR(state->AsyncWith_type); + Py_CLEAR(state->Attribute_type); + Py_CLEAR(state->AugAssign_type); + Py_CLEAR(state->Await_type); + Py_CLEAR(state->BinOp_type); + Py_CLEAR(state->BitAnd_singleton); + Py_CLEAR(state->BitAnd_type); + Py_CLEAR(state->BitOr_singleton); + Py_CLEAR(state->BitOr_type); + Py_CLEAR(state->BitXor_singleton); + Py_CLEAR(state->BitXor_type); + Py_CLEAR(state->BoolOp_type); + Py_CLEAR(state->Break_type); + Py_CLEAR(state->Call_type); + Py_CLEAR(state->ClassDef_type); + Py_CLEAR(state->Compare_type); + Py_CLEAR(state->Constant_type); + Py_CLEAR(state->Continue_type); + Py_CLEAR(state->Del_singleton); + Py_CLEAR(state->Del_type); + Py_CLEAR(state->Delete_type); + Py_CLEAR(state->DictComp_type); + Py_CLEAR(state->Dict_type); + Py_CLEAR(state->Div_singleton); + Py_CLEAR(state->Div_type); + Py_CLEAR(state->Eq_singleton); + Py_CLEAR(state->Eq_type); + Py_CLEAR(state->ExceptHandler_type); + Py_CLEAR(state->Expr_type); + Py_CLEAR(state->Expression_type); + Py_CLEAR(state->FloorDiv_singleton); + Py_CLEAR(state->FloorDiv_type); + Py_CLEAR(state->For_type); + Py_CLEAR(state->FormattedValue_type); + Py_CLEAR(state->FunctionDef_type); + Py_CLEAR(state->FunctionType_type); + Py_CLEAR(state->GeneratorExp_type); + Py_CLEAR(state->Global_type); + Py_CLEAR(state->GtE_singleton); + Py_CLEAR(state->GtE_type); + Py_CLEAR(state->Gt_singleton); + Py_CLEAR(state->Gt_type); + Py_CLEAR(state->IfExp_type); + Py_CLEAR(state->If_type); + Py_CLEAR(state->ImportFrom_type); + Py_CLEAR(state->Import_type); + Py_CLEAR(state->In_singleton); + Py_CLEAR(state->In_type); + Py_CLEAR(state->Interactive_type); + Py_CLEAR(state->Invert_singleton); + Py_CLEAR(state->Invert_type); + Py_CLEAR(state->IsNot_singleton); + Py_CLEAR(state->IsNot_type); + Py_CLEAR(state->Is_singleton); + Py_CLEAR(state->Is_type); + Py_CLEAR(state->JoinedStr_type); + Py_CLEAR(state->LShift_singleton); + Py_CLEAR(state->LShift_type); + Py_CLEAR(state->Lambda_type); + Py_CLEAR(state->ListComp_type); + Py_CLEAR(state->List_type); + Py_CLEAR(state->Load_singleton); + Py_CLEAR(state->Load_type); + Py_CLEAR(state->LtE_singleton); + Py_CLEAR(state->LtE_type); + Py_CLEAR(state->Lt_singleton); + Py_CLEAR(state->Lt_type); + Py_CLEAR(state->MatMult_singleton); + Py_CLEAR(state->MatMult_type); + Py_CLEAR(state->Mod_singleton); + Py_CLEAR(state->Mod_type); + Py_CLEAR(state->Module_type); + Py_CLEAR(state->Mult_singleton); + Py_CLEAR(state->Mult_type); + Py_CLEAR(state->Name_type); + Py_CLEAR(state->NamedExpr_type); + Py_CLEAR(state->Nonlocal_type); + Py_CLEAR(state->NotEq_singleton); + Py_CLEAR(state->NotEq_type); + Py_CLEAR(state->NotIn_singleton); + Py_CLEAR(state->NotIn_type); + Py_CLEAR(state->Not_singleton); + Py_CLEAR(state->Not_type); + Py_CLEAR(state->Or_singleton); + Py_CLEAR(state->Or_type); + Py_CLEAR(state->Pass_type); + Py_CLEAR(state->Pow_singleton); + Py_CLEAR(state->Pow_type); + Py_CLEAR(state->RShift_singleton); + Py_CLEAR(state->RShift_type); + Py_CLEAR(state->Raise_type); + Py_CLEAR(state->Return_type); + Py_CLEAR(state->SetComp_type); + Py_CLEAR(state->Set_type); + Py_CLEAR(state->Slice_type); + Py_CLEAR(state->Starred_type); + Py_CLEAR(state->Store_singleton); + Py_CLEAR(state->Store_type); + Py_CLEAR(state->Sub_singleton); + Py_CLEAR(state->Sub_type); + Py_CLEAR(state->Subscript_type); + Py_CLEAR(state->Try_type); + Py_CLEAR(state->Tuple_type); + Py_CLEAR(state->TypeIgnore_type); + Py_CLEAR(state->UAdd_singleton); + Py_CLEAR(state->UAdd_type); + Py_CLEAR(state->USub_singleton); + Py_CLEAR(state->USub_type); + Py_CLEAR(state->UnaryOp_type); + Py_CLEAR(state->While_type); + Py_CLEAR(state->With_type); + Py_CLEAR(state->YieldFrom_type); + Py_CLEAR(state->Yield_type); + Py_CLEAR(state->__dict__); + Py_CLEAR(state->__doc__); + Py_CLEAR(state->__module__); + Py_CLEAR(state->_attributes); + Py_CLEAR(state->_fields); + Py_CLEAR(state->alias_type); + Py_CLEAR(state->annotation); + Py_CLEAR(state->arg); + Py_CLEAR(state->arg_type); + Py_CLEAR(state->args); + Py_CLEAR(state->argtypes); + Py_CLEAR(state->arguments_type); + Py_CLEAR(state->asname); + Py_CLEAR(state->ast); + Py_CLEAR(state->attr); + Py_CLEAR(state->bases); + Py_CLEAR(state->body); + Py_CLEAR(state->boolop_type); + Py_CLEAR(state->cause); + Py_CLEAR(state->cmpop_type); + Py_CLEAR(state->col_offset); + Py_CLEAR(state->comparators); + Py_CLEAR(state->comprehension_type); + Py_CLEAR(state->context_expr); + Py_CLEAR(state->conversion); + Py_CLEAR(state->ctx); + Py_CLEAR(state->decorator_list); + Py_CLEAR(state->defaults); + Py_CLEAR(state->elt); + Py_CLEAR(state->elts); + Py_CLEAR(state->end_col_offset); + Py_CLEAR(state->end_lineno); + Py_CLEAR(state->exc); + Py_CLEAR(state->excepthandler_type); + Py_CLEAR(state->expr_context_type); + Py_CLEAR(state->expr_type); + Py_CLEAR(state->finalbody); + Py_CLEAR(state->format_spec); + Py_CLEAR(state->func); + Py_CLEAR(state->generators); + Py_CLEAR(state->handlers); + Py_CLEAR(state->id); + Py_CLEAR(state->ifs); + Py_CLEAR(state->is_async); + Py_CLEAR(state->items); + Py_CLEAR(state->iter); + Py_CLEAR(state->key); + Py_CLEAR(state->keys); + Py_CLEAR(state->keyword_type); + Py_CLEAR(state->keywords); + Py_CLEAR(state->kind); + Py_CLEAR(state->kw_defaults); + Py_CLEAR(state->kwarg); + Py_CLEAR(state->kwonlyargs); + Py_CLEAR(state->left); + Py_CLEAR(state->level); + Py_CLEAR(state->lineno); + Py_CLEAR(state->lower); + Py_CLEAR(state->mod_type); + Py_CLEAR(state->module); + Py_CLEAR(state->msg); + Py_CLEAR(state->name); + Py_CLEAR(state->names); + Py_CLEAR(state->op); + Py_CLEAR(state->operand); + Py_CLEAR(state->operator_type); + Py_CLEAR(state->ops); + Py_CLEAR(state->optional_vars); + Py_CLEAR(state->orelse); + Py_CLEAR(state->posonlyargs); + Py_CLEAR(state->returns); + Py_CLEAR(state->right); + Py_CLEAR(state->simple); + Py_CLEAR(state->slice); + Py_CLEAR(state->step); + Py_CLEAR(state->stmt_type); + Py_CLEAR(state->tag); + Py_CLEAR(state->target); + Py_CLEAR(state->targets); + Py_CLEAR(state->test); + Py_CLEAR(state->type); + Py_CLEAR(state->type_comment); + Py_CLEAR(state->type_ignore_type); + Py_CLEAR(state->type_ignores); + Py_CLEAR(state->unaryop_type); + Py_CLEAR(state->upper); + Py_CLEAR(state->value); + Py_CLEAR(state->values); + Py_CLEAR(state->vararg); + Py_CLEAR(state->withitem_type); + + state->initialized = 0; +} + +static int init_identifiers(astmodulestate *state) +{ + if ((state->__dict__ = PyUnicode_InternFromString("__dict__")) == NULL) return 0; + if ((state->__doc__ = PyUnicode_InternFromString("__doc__")) == NULL) return 0; + if ((state->__module__ = PyUnicode_InternFromString("__module__")) == NULL) return 0; + if ((state->_attributes = PyUnicode_InternFromString("_attributes")) == NULL) return 0; + if ((state->_fields = PyUnicode_InternFromString("_fields")) == NULL) return 0; + if ((state->annotation = PyUnicode_InternFromString("annotation")) == NULL) return 0; + if ((state->arg = PyUnicode_InternFromString("arg")) == NULL) return 0; + if ((state->args = PyUnicode_InternFromString("args")) == NULL) return 0; + if ((state->argtypes = PyUnicode_InternFromString("argtypes")) == NULL) return 0; + if ((state->asname = PyUnicode_InternFromString("asname")) == NULL) return 0; + if ((state->ast = PyUnicode_InternFromString("ast")) == NULL) return 0; + if ((state->attr = PyUnicode_InternFromString("attr")) == NULL) return 0; + if ((state->bases = PyUnicode_InternFromString("bases")) == NULL) return 0; + if ((state->body = PyUnicode_InternFromString("body")) == NULL) return 0; + if ((state->cause = PyUnicode_InternFromString("cause")) == NULL) return 0; + if ((state->col_offset = PyUnicode_InternFromString("col_offset")) == NULL) return 0; + if ((state->comparators = PyUnicode_InternFromString("comparators")) == NULL) return 0; + if ((state->context_expr = PyUnicode_InternFromString("context_expr")) == NULL) return 0; + if ((state->conversion = PyUnicode_InternFromString("conversion")) == NULL) return 0; + if ((state->ctx = PyUnicode_InternFromString("ctx")) == NULL) return 0; + if ((state->decorator_list = PyUnicode_InternFromString("decorator_list")) == NULL) return 0; + if ((state->defaults = PyUnicode_InternFromString("defaults")) == NULL) return 0; + if ((state->elt = PyUnicode_InternFromString("elt")) == NULL) return 0; + if ((state->elts = PyUnicode_InternFromString("elts")) == NULL) return 0; + if ((state->end_col_offset = PyUnicode_InternFromString("end_col_offset")) == NULL) return 0; + if ((state->end_lineno = PyUnicode_InternFromString("end_lineno")) == NULL) return 0; + if ((state->exc = PyUnicode_InternFromString("exc")) == NULL) return 0; + if ((state->finalbody = PyUnicode_InternFromString("finalbody")) == NULL) return 0; + if ((state->format_spec = PyUnicode_InternFromString("format_spec")) == NULL) return 0; + if ((state->func = PyUnicode_InternFromString("func")) == NULL) return 0; + if ((state->generators = PyUnicode_InternFromString("generators")) == NULL) return 0; + if ((state->handlers = PyUnicode_InternFromString("handlers")) == NULL) return 0; + if ((state->id = PyUnicode_InternFromString("id")) == NULL) return 0; + if ((state->ifs = PyUnicode_InternFromString("ifs")) == NULL) return 0; + if ((state->is_async = PyUnicode_InternFromString("is_async")) == NULL) return 0; + if ((state->items = PyUnicode_InternFromString("items")) == NULL) return 0; + if ((state->iter = PyUnicode_InternFromString("iter")) == NULL) return 0; + if ((state->key = PyUnicode_InternFromString("key")) == NULL) return 0; + if ((state->keys = PyUnicode_InternFromString("keys")) == NULL) return 0; + if ((state->keywords = PyUnicode_InternFromString("keywords")) == NULL) return 0; + if ((state->kind = PyUnicode_InternFromString("kind")) == NULL) return 0; + if ((state->kw_defaults = PyUnicode_InternFromString("kw_defaults")) == NULL) return 0; + if ((state->kwarg = PyUnicode_InternFromString("kwarg")) == NULL) return 0; + if ((state->kwonlyargs = PyUnicode_InternFromString("kwonlyargs")) == NULL) return 0; + if ((state->left = PyUnicode_InternFromString("left")) == NULL) return 0; + if ((state->level = PyUnicode_InternFromString("level")) == NULL) return 0; + if ((state->lineno = PyUnicode_InternFromString("lineno")) == NULL) return 0; + if ((state->lower = PyUnicode_InternFromString("lower")) == NULL) return 0; + if ((state->module = PyUnicode_InternFromString("module")) == NULL) return 0; + if ((state->msg = PyUnicode_InternFromString("msg")) == NULL) return 0; + if ((state->name = PyUnicode_InternFromString("name")) == NULL) return 0; + if ((state->names = PyUnicode_InternFromString("names")) == NULL) return 0; + if ((state->op = PyUnicode_InternFromString("op")) == NULL) return 0; + if ((state->operand = PyUnicode_InternFromString("operand")) == NULL) return 0; + if ((state->ops = PyUnicode_InternFromString("ops")) == NULL) return 0; + if ((state->optional_vars = PyUnicode_InternFromString("optional_vars")) == NULL) return 0; + if ((state->orelse = PyUnicode_InternFromString("orelse")) == NULL) return 0; + if ((state->posonlyargs = PyUnicode_InternFromString("posonlyargs")) == NULL) return 0; + if ((state->returns = PyUnicode_InternFromString("returns")) == NULL) return 0; + if ((state->right = PyUnicode_InternFromString("right")) == NULL) return 0; + if ((state->simple = PyUnicode_InternFromString("simple")) == NULL) return 0; + if ((state->slice = PyUnicode_InternFromString("slice")) == NULL) return 0; + if ((state->step = PyUnicode_InternFromString("step")) == NULL) return 0; + if ((state->tag = PyUnicode_InternFromString("tag")) == NULL) return 0; + if ((state->target = PyUnicode_InternFromString("target")) == NULL) return 0; + if ((state->targets = PyUnicode_InternFromString("targets")) == NULL) return 0; + if ((state->test = PyUnicode_InternFromString("test")) == NULL) return 0; + if ((state->type = PyUnicode_InternFromString("type")) == NULL) return 0; + if ((state->type_comment = PyUnicode_InternFromString("type_comment")) == NULL) return 0; + if ((state->type_ignores = PyUnicode_InternFromString("type_ignores")) == NULL) return 0; + if ((state->upper = PyUnicode_InternFromString("upper")) == NULL) return 0; + if ((state->value = PyUnicode_InternFromString("value")) == NULL) return 0; + if ((state->values = PyUnicode_InternFromString("values")) == NULL) return 0; + if ((state->vararg = PyUnicode_InternFromString("vararg")) == NULL) return 0; + return 1; +}; + +static PyObject* ast2obj_mod(astmodulestate *state, void*); +static const char * const Module_fields[]={ "body", - "type_ignores", + "type_ignores", }; -static const char * const Interactive_fields[]={ +static const char * const Interactive_fields[]={ "body", }; -static const char * const Expression_fields[]={ +static const char * const Expression_fields[]={ "body", }; -static const char * const FunctionType_fields[]={ - "argtypes", - "returns", -}; -static const char * const stmt_attributes[] = { +static const char * const FunctionType_fields[]={ + "argtypes", + "returns", +}; +static const char * const stmt_attributes[] = { "lineno", "col_offset", - "end_lineno", - "end_col_offset", + "end_lineno", + "end_col_offset", }; -static PyObject* ast2obj_stmt(astmodulestate *state, void*); -static const char * const FunctionDef_fields[]={ +static PyObject* ast2obj_stmt(astmodulestate *state, void*); +static const char * const FunctionDef_fields[]={ "name", "args", "body", "decorator_list", "returns", - "type_comment", + "type_comment", }; -static const char * const AsyncFunctionDef_fields[]={ +static const char * const AsyncFunctionDef_fields[]={ "name", "args", "body", "decorator_list", "returns", - "type_comment", + "type_comment", }; -static const char * const ClassDef_fields[]={ +static const char * const ClassDef_fields[]={ "name", "bases", "keywords", "body", "decorator_list", }; -static const char * const Return_fields[]={ +static const char * const Return_fields[]={ "value", }; -static const char * const Delete_fields[]={ +static const char * const Delete_fields[]={ "targets", }; -static const char * const Assign_fields[]={ +static const char * const Assign_fields[]={ "targets", "value", - "type_comment", + "type_comment", }; -static const char * const AugAssign_fields[]={ +static const char * const AugAssign_fields[]={ "target", "op", "value", }; -static const char * const AnnAssign_fields[]={ +static const char * const AnnAssign_fields[]={ "target", "annotation", "value", "simple", }; -static const char * const For_fields[]={ +static const char * const For_fields[]={ "target", "iter", "body", "orelse", - "type_comment", + "type_comment", }; -static const char * const AsyncFor_fields[]={ +static const char * const AsyncFor_fields[]={ "target", "iter", "body", "orelse", - "type_comment", + "type_comment", }; -static const char * const While_fields[]={ +static const char * const While_fields[]={ "test", "body", "orelse", }; -static const char * const If_fields[]={ +static const char * const If_fields[]={ "test", "body", "orelse", }; -static const char * const With_fields[]={ +static const char * const With_fields[]={ "items", "body", - "type_comment", + "type_comment", }; -static const char * const AsyncWith_fields[]={ +static const char * const AsyncWith_fields[]={ "items", "body", - "type_comment", + "type_comment", }; -static const char * const Raise_fields[]={ +static const char * const Raise_fields[]={ "exc", "cause", }; -static const char * const Try_fields[]={ +static const char * const Try_fields[]={ "body", "handlers", "orelse", "finalbody", }; -static const char * const Assert_fields[]={ +static const char * const Assert_fields[]={ "test", "msg", }; -static const char * const Import_fields[]={ +static const char * const Import_fields[]={ "names", }; -static const char * const ImportFrom_fields[]={ +static const char * const ImportFrom_fields[]={ "module", "names", "level", }; -static const char * const Global_fields[]={ +static const char * const Global_fields[]={ "names", }; -static const char * const Nonlocal_fields[]={ +static const char * const Nonlocal_fields[]={ "names", }; -static const char * const Expr_fields[]={ +static const char * const Expr_fields[]={ "value", }; -static const char * const expr_attributes[] = { +static const char * const expr_attributes[] = { "lineno", "col_offset", - "end_lineno", - "end_col_offset", + "end_lineno", + "end_col_offset", }; -static PyObject* ast2obj_expr(astmodulestate *state, void*); -static const char * const BoolOp_fields[]={ +static PyObject* ast2obj_expr(astmodulestate *state, void*); +static const char * const BoolOp_fields[]={ "op", "values", }; -static const char * const NamedExpr_fields[]={ - "target", - "value", -}; -static const char * const BinOp_fields[]={ +static const char * const NamedExpr_fields[]={ + "target", + "value", +}; +static const char * const BinOp_fields[]={ "left", "op", "right", }; -static const char * const UnaryOp_fields[]={ +static const char * const UnaryOp_fields[]={ "op", "operand", }; -static const char * const Lambda_fields[]={ +static const char * const Lambda_fields[]={ "args", "body", }; -static const char * const IfExp_fields[]={ +static const char * const IfExp_fields[]={ "test", "body", "orelse", }; -static const char * const Dict_fields[]={ +static const char * const Dict_fields[]={ "keys", "values", }; -static const char * const Set_fields[]={ +static const char * const Set_fields[]={ "elts", }; -static const char * const ListComp_fields[]={ +static const char * const ListComp_fields[]={ "elt", "generators", }; -static const char * const SetComp_fields[]={ +static const char * const SetComp_fields[]={ "elt", "generators", }; -static const char * const DictComp_fields[]={ +static const char * const DictComp_fields[]={ "key", "value", "generators", }; -static const char * const GeneratorExp_fields[]={ +static const char * const GeneratorExp_fields[]={ "elt", "generators", }; -static const char * const Await_fields[]={ +static const char * const Await_fields[]={ "value", }; -static const char * const Yield_fields[]={ +static const char * const Yield_fields[]={ "value", }; -static const char * const YieldFrom_fields[]={ +static const char * const YieldFrom_fields[]={ "value", }; -static const char * const Compare_fields[]={ +static const char * const Compare_fields[]={ "left", "ops", "comparators", }; -static const char * const Call_fields[]={ +static const char * const Call_fields[]={ "func", "args", "keywords", }; -static const char * const FormattedValue_fields[]={ +static const char * const FormattedValue_fields[]={ "value", "conversion", "format_spec", }; -static const char * const JoinedStr_fields[]={ +static const char * const JoinedStr_fields[]={ "values", }; -static const char * const Constant_fields[]={ +static const char * const Constant_fields[]={ "value", - "kind", + "kind", }; -static const char * const Attribute_fields[]={ +static const char * const Attribute_fields[]={ "value", "attr", "ctx", }; -static const char * const Subscript_fields[]={ +static const char * const Subscript_fields[]={ "value", "slice", "ctx", }; -static const char * const Starred_fields[]={ +static const char * const Starred_fields[]={ "value", "ctx", }; -static const char * const Name_fields[]={ +static const char * const Name_fields[]={ "id", "ctx", }; -static const char * const List_fields[]={ +static const char * const List_fields[]={ "elts", "ctx", }; -static const char * const Tuple_fields[]={ +static const char * const Tuple_fields[]={ "elts", "ctx", }; -static const char * const Slice_fields[]={ +static const char * const Slice_fields[]={ "lower", "upper", "step", }; -static PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty); -static PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty); -static PyObject* ast2obj_operator(astmodulestate *state, operator_ty); -static PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty); -static PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty); -static PyObject* ast2obj_comprehension(astmodulestate *state, void*); -static const char * const comprehension_fields[]={ +static PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty); +static PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty); +static PyObject* ast2obj_operator(astmodulestate *state, operator_ty); +static PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty); +static PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty); +static PyObject* ast2obj_comprehension(astmodulestate *state, void*); +static const char * const comprehension_fields[]={ "target", "iter", "ifs", "is_async", }; -static const char * const excepthandler_attributes[] = { +static const char * const excepthandler_attributes[] = { "lineno", "col_offset", - "end_lineno", - "end_col_offset", + "end_lineno", + "end_col_offset", }; -static PyObject* ast2obj_excepthandler(astmodulestate *state, void*); -static const char * const ExceptHandler_fields[]={ +static PyObject* ast2obj_excepthandler(astmodulestate *state, void*); +static const char * const ExceptHandler_fields[]={ "type", "name", "body", }; -static PyObject* ast2obj_arguments(astmodulestate *state, void*); -static const char * const arguments_fields[]={ - "posonlyargs", +static PyObject* ast2obj_arguments(astmodulestate *state, void*); +static const char * const arguments_fields[]={ + "posonlyargs", "args", "vararg", "kwonlyargs", @@ -834,44 +834,44 @@ static const char * const arguments_fields[]={ "kwarg", "defaults", }; -static PyObject* ast2obj_arg(astmodulestate *state, void*); -static const char * const arg_attributes[] = { +static PyObject* ast2obj_arg(astmodulestate *state, void*); +static const char * const arg_attributes[] = { "lineno", "col_offset", - "end_lineno", - "end_col_offset", + "end_lineno", + "end_col_offset", }; -static const char * const arg_fields[]={ +static const char * const arg_fields[]={ "arg", "annotation", - "type_comment", + "type_comment", +}; +static PyObject* ast2obj_keyword(astmodulestate *state, void*); +static const char * const keyword_attributes[] = { + "lineno", + "col_offset", + "end_lineno", + "end_col_offset", }; -static PyObject* ast2obj_keyword(astmodulestate *state, void*); -static const char * const keyword_attributes[] = { - "lineno", - "col_offset", - "end_lineno", - "end_col_offset", -}; -static const char * const keyword_fields[]={ +static const char * const keyword_fields[]={ "arg", "value", }; -static PyObject* ast2obj_alias(astmodulestate *state, void*); -static const char * const alias_fields[]={ +static PyObject* ast2obj_alias(astmodulestate *state, void*); +static const char * const alias_fields[]={ "name", "asname", }; -static PyObject* ast2obj_withitem(astmodulestate *state, void*); -static const char * const withitem_fields[]={ +static PyObject* ast2obj_withitem(astmodulestate *state, void*); +static const char * const withitem_fields[]={ "context_expr", "optional_vars", }; -static PyObject* ast2obj_type_ignore(astmodulestate *state, void*); -static const char * const TypeIgnore_fields[]={ - "lineno", - "tag", -}; +static PyObject* ast2obj_type_ignore(astmodulestate *state, void*); +static const char * const TypeIgnore_fields[]={ + "lineno", + "tag", +}; @@ -884,19 +884,19 @@ static void ast_dealloc(AST_object *self) { /* bpo-31095: UnTrack is needed before calling any callbacks */ - PyTypeObject *tp = Py_TYPE(self); + PyTypeObject *tp = Py_TYPE(self); PyObject_GC_UnTrack(self); Py_CLEAR(self->dict); - freefunc free_func = PyType_GetSlot(tp, Py_tp_free); - assert(free_func != NULL); - free_func(self); - Py_DECREF(tp); + freefunc free_func = PyType_GetSlot(tp, Py_tp_free); + assert(free_func != NULL); + free_func(self); + Py_DECREF(tp); } static int ast_traverse(AST_object *self, visitproc visit, void *arg) { - Py_VISIT(Py_TYPE(self)); + Py_VISIT(Py_TYPE(self)); Py_VISIT(self->dict); return 0; } @@ -911,29 +911,29 @@ ast_clear(AST_object *self) static int ast_type_init(PyObject *self, PyObject *args, PyObject *kw) { - astmodulestate *state = get_global_ast_state(); - if (state == NULL) { - return -1; - } - + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + return -1; + } + Py_ssize_t i, numfields = 0; int res = -1; PyObject *key, *value, *fields; - if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { + if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } if (fields) { numfields = PySequence_Size(fields); - if (numfields == -1) { + if (numfields == -1) { goto cleanup; - } + } } res = 0; /* if no error occurs, this stays 0 to the end */ if (numfields < PyTuple_GET_SIZE(args)) { PyErr_Format(PyExc_TypeError, "%.400s constructor takes at most " "%zd positional argument%s", - _PyType_Name(Py_TYPE(self)), + _PyType_Name(Py_TYPE(self)), numfields, numfields == 1 ? "" : "s"); res = -1; goto cleanup; @@ -947,35 +947,35 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) } res = PyObject_SetAttr(self, name, PyTuple_GET_ITEM(args, i)); Py_DECREF(name); - if (res < 0) { + if (res < 0) { goto cleanup; - } + } } if (kw) { i = 0; /* needed by PyDict_Next */ while (PyDict_Next(kw, &i, &key, &value)) { - int contains = PySequence_Contains(fields, key); - if (contains == -1) { - res = -1; - goto cleanup; - } else if (contains == 1) { - Py_ssize_t p = PySequence_Index(fields, key); - if (p == -1) { - res = -1; - goto cleanup; - } - if (p < PyTuple_GET_SIZE(args)) { - PyErr_Format(PyExc_TypeError, - "%.400s got multiple values for argument '%U'", - Py_TYPE(self)->tp_name, key); - res = -1; - goto cleanup; - } - } + int contains = PySequence_Contains(fields, key); + if (contains == -1) { + res = -1; + goto cleanup; + } else if (contains == 1) { + Py_ssize_t p = PySequence_Index(fields, key); + if (p == -1) { + res = -1; + goto cleanup; + } + if (p < PyTuple_GET_SIZE(args)) { + PyErr_Format(PyExc_TypeError, + "%.400s got multiple values for argument '%U'", + Py_TYPE(self)->tp_name, key); + res = -1; + goto cleanup; + } + } res = PyObject_SetAttr(self, key, value); - if (res < 0) { + if (res < 0) { goto cleanup; - } + } } } cleanup: @@ -987,13 +987,13 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { - astmodulestate *state = get_global_ast_state(); - if (state == NULL) { - return NULL; - } - + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + return NULL; + } + PyObject *dict; - if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { + if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; } if (dict) { @@ -1002,11 +1002,11 @@ ast_type_reduce(PyObject *self, PyObject *unused) return Py_BuildValue("O()", Py_TYPE(self)); } -static PyMemberDef ast_type_members[] = { - {"__dictoffset__", T_PYSSIZET, offsetof(AST_object, dict), READONLY}, - {NULL} /* Sentinel */ -}; - +static PyMemberDef ast_type_members[] = { + {"__dictoffset__", T_PYSSIZET, offsetof(AST_object, dict), READONLY}, + {NULL} /* Sentinel */ +}; + static PyMethodDef ast_type_methods[] = { {"__reduce__", ast_type_reduce, METH_NOARGS, NULL}, {NULL} @@ -1017,79 +1017,79 @@ static PyGetSetDef ast_type_getsets[] = { {NULL} }; -static PyType_Slot AST_type_slots[] = { - {Py_tp_dealloc, ast_dealloc}, - {Py_tp_getattro, PyObject_GenericGetAttr}, - {Py_tp_setattro, PyObject_GenericSetAttr}, - {Py_tp_traverse, ast_traverse}, - {Py_tp_clear, ast_clear}, - {Py_tp_members, ast_type_members}, - {Py_tp_methods, ast_type_methods}, - {Py_tp_getset, ast_type_getsets}, - {Py_tp_init, ast_type_init}, - {Py_tp_alloc, PyType_GenericAlloc}, - {Py_tp_new, PyType_GenericNew}, - {Py_tp_free, PyObject_GC_Del}, - {0, 0}, -}; - -static PyType_Spec AST_type_spec = { - "ast.AST", +static PyType_Slot AST_type_slots[] = { + {Py_tp_dealloc, ast_dealloc}, + {Py_tp_getattro, PyObject_GenericGetAttr}, + {Py_tp_setattro, PyObject_GenericSetAttr}, + {Py_tp_traverse, ast_traverse}, + {Py_tp_clear, ast_clear}, + {Py_tp_members, ast_type_members}, + {Py_tp_methods, ast_type_methods}, + {Py_tp_getset, ast_type_getsets}, + {Py_tp_init, ast_type_init}, + {Py_tp_alloc, PyType_GenericAlloc}, + {Py_tp_new, PyType_GenericNew}, + {Py_tp_free, PyObject_GC_Del}, + {0, 0}, +}; + +static PyType_Spec AST_type_spec = { + "ast.AST", sizeof(AST_object), 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, - AST_type_slots + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + AST_type_slots }; -static PyObject * -make_type(astmodulestate *state, const char *type, PyObject* base, - const char* const* fields, int num_fields, const char *doc) +static PyObject * +make_type(astmodulestate *state, const char *type, PyObject* base, + const char* const* fields, int num_fields, const char *doc) { PyObject *fnames, *result; int i; fnames = PyTuple_New(num_fields); if (!fnames) return NULL; for (i = 0; i < num_fields; i++) { - PyObject *field = PyUnicode_InternFromString(fields[i]); + PyObject *field = PyUnicode_InternFromString(fields[i]); if (!field) { Py_DECREF(fnames); return NULL; } PyTuple_SET_ITEM(fnames, i, field); } - result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOOOs}", + result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOOOs}", type, base, - state->_fields, fnames, - state->__module__, - state->ast, - state->__doc__, doc); + state->_fields, fnames, + state->__module__, + state->ast, + state->__doc__, doc); Py_DECREF(fnames); - return result; + return result; } -static int -add_attributes(astmodulestate *state, PyObject *type, const char * const *attrs, int num_fields) +static int +add_attributes(astmodulestate *state, PyObject *type, const char * const *attrs, int num_fields) { int i, result; PyObject *s, *l = PyTuple_New(num_fields); if (!l) return 0; for (i = 0; i < num_fields; i++) { - s = PyUnicode_InternFromString(attrs[i]); + s = PyUnicode_InternFromString(attrs[i]); if (!s) { Py_DECREF(l); return 0; } PyTuple_SET_ITEM(l, i, s); } - result = PyObject_SetAttr(type, state->_attributes, l) >= 0; + result = PyObject_SetAttr(type, state->_attributes, l) >= 0; Py_DECREF(l); return result; } /* Conversion AST -> Python */ -static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (*func)(astmodulestate *state, void*)) +static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (*func)(astmodulestate *state, void*)) { Py_ssize_t i, n = asdl_seq_LEN(seq); PyObject *result = PyList_New(n); @@ -1097,7 +1097,7 @@ static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (* if (!result) return NULL; for (i = 0; i < n; i++) { - value = func(state, asdl_seq_GET(seq, i)); + value = func(state, asdl_seq_GET(seq, i)); if (!value) { Py_DECREF(result); return NULL; @@ -1107,7 +1107,7 @@ static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (* return result; } -static PyObject* ast2obj_object(astmodulestate *Py_UNUSED(state), void *o) +static PyObject* ast2obj_object(astmodulestate *Py_UNUSED(state), void *o) { if (!o) o = Py_None; @@ -1118,14 +1118,14 @@ static PyObject* ast2obj_object(astmodulestate *Py_UNUSED(state), void *o) #define ast2obj_identifier ast2obj_object #define ast2obj_string ast2obj_object -static PyObject* ast2obj_int(astmodulestate *Py_UNUSED(state), long b) +static PyObject* ast2obj_int(astmodulestate *Py_UNUSED(state), long b) { return PyLong_FromLong(b); } /* Conversion Python -> AST */ -static int obj2ast_object(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_object(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { if (obj == Py_None) obj = NULL; @@ -1140,36 +1140,36 @@ static int obj2ast_object(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObj return 0; } -static int obj2ast_constant(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_constant(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { - if (PyArena_AddPyObject(arena, obj) < 0) { - *out = NULL; - return -1; + if (PyArena_AddPyObject(arena, obj) < 0) { + *out = NULL; + return -1; } - Py_INCREF(obj); + Py_INCREF(obj); *out = obj; return 0; } -static int obj2ast_identifier(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_identifier(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && obj != Py_None) { PyErr_SetString(PyExc_TypeError, "AST identifier must be of type str"); return 1; } - return obj2ast_object(state, obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_string(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_string(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) { PyErr_SetString(PyExc_TypeError, "AST string must be of type str"); return 1; } - return obj2ast_object(state, obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_int(astmodulestate* Py_UNUSED(state), PyObject* obj, int* out, PyArena* arena) +static int obj2ast_int(astmodulestate* Py_UNUSED(state), PyObject* obj, int* out, PyArena* arena) { int i; if (!PyLong_Check(obj)) { @@ -1184,13 +1184,13 @@ static int obj2ast_int(astmodulestate* Py_UNUSED(state), PyObject* obj, int* out return 0; } -static int add_ast_fields(astmodulestate *state) +static int add_ast_fields(astmodulestate *state) { - PyObject *empty_tuple; + PyObject *empty_tuple; empty_tuple = PyTuple_New(0); if (!empty_tuple || - PyObject_SetAttrString(state->AST_type, "_fields", empty_tuple) < 0 || - PyObject_SetAttrString(state->AST_type, "_attributes", empty_tuple) < 0) { + PyObject_SetAttrString(state->AST_type, "_fields", empty_tuple) < 0 || + PyObject_SetAttrString(state->AST_type, "_attributes", empty_tuple) < 0) { Py_XDECREF(empty_tuple); return -1; } @@ -1199,720 +1199,720 @@ static int add_ast_fields(astmodulestate *state) } -static int init_types(astmodulestate *state) +static int init_types(astmodulestate *state) { - if (state->initialized) return 1; - if (init_identifiers(state) < 0) return 0; - state->AST_type = PyType_FromSpec(&AST_type_spec); - if (!state->AST_type) return 0; - if (add_ast_fields(state) < 0) return 0; - state->mod_type = make_type(state, "mod", state->AST_type, NULL, 0, - "mod = Module(stmt* body, type_ignore* type_ignores)\n" - " | Interactive(stmt* body)\n" - " | Expression(expr body)\n" - " | FunctionType(expr* argtypes, expr returns)"); - if (!state->mod_type) return 0; - if (!add_attributes(state, state->mod_type, NULL, 0)) return 0; - state->Module_type = make_type(state, "Module", state->mod_type, - Module_fields, 2, - "Module(stmt* body, type_ignore* type_ignores)"); - if (!state->Module_type) return 0; - state->Interactive_type = make_type(state, "Interactive", state->mod_type, - Interactive_fields, 1, - "Interactive(stmt* body)"); - if (!state->Interactive_type) return 0; - state->Expression_type = make_type(state, "Expression", state->mod_type, - Expression_fields, 1, - "Expression(expr body)"); - if (!state->Expression_type) return 0; - state->FunctionType_type = make_type(state, "FunctionType", - state->mod_type, FunctionType_fields, - 2, - "FunctionType(expr* argtypes, expr returns)"); - if (!state->FunctionType_type) return 0; - state->stmt_type = make_type(state, "stmt", state->AST_type, NULL, 0, - "stmt = FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" - " | AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" - " | ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)\n" - " | Return(expr? value)\n" - " | Delete(expr* targets)\n" - " | Assign(expr* targets, expr value, string? type_comment)\n" - " | AugAssign(expr target, operator op, expr value)\n" - " | AnnAssign(expr target, expr annotation, expr? value, int simple)\n" - " | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" - " | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" - " | While(expr test, stmt* body, stmt* orelse)\n" - " | If(expr test, stmt* body, stmt* orelse)\n" - " | With(withitem* items, stmt* body, string? type_comment)\n" - " | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" - " | Raise(expr? exc, expr? cause)\n" - " | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)\n" - " | Assert(expr test, expr? msg)\n" - " | Import(alias* names)\n" - " | ImportFrom(identifier? module, alias* names, int? level)\n" - " | Global(identifier* names)\n" - " | Nonlocal(identifier* names)\n" - " | Expr(expr value)\n" - " | Pass\n" - " | Break\n" - " | Continue"); - if (!state->stmt_type) return 0; - if (!add_attributes(state, state->stmt_type, stmt_attributes, 4)) return 0; - if (PyObject_SetAttr(state->stmt_type, state->end_lineno, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->stmt_type, state->end_col_offset, Py_None) == - -1) - return 0; - state->FunctionDef_type = make_type(state, "FunctionDef", state->stmt_type, - FunctionDef_fields, 6, - "FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); - if (!state->FunctionDef_type) return 0; - if (PyObject_SetAttr(state->FunctionDef_type, state->returns, Py_None) == - -1) - return 0; - if (PyObject_SetAttr(state->FunctionDef_type, state->type_comment, Py_None) - == -1) - return 0; - state->AsyncFunctionDef_type = make_type(state, "AsyncFunctionDef", - state->stmt_type, - AsyncFunctionDef_fields, 6, - "AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); - if (!state->AsyncFunctionDef_type) return 0; - if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->returns, Py_None) - == -1) - return 0; - if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->type_comment, - Py_None) == -1) - return 0; - state->ClassDef_type = make_type(state, "ClassDef", state->stmt_type, - ClassDef_fields, 5, - "ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)"); - if (!state->ClassDef_type) return 0; - state->Return_type = make_type(state, "Return", state->stmt_type, - Return_fields, 1, - "Return(expr? value)"); - if (!state->Return_type) return 0; - if (PyObject_SetAttr(state->Return_type, state->value, Py_None) == -1) - return 0; - state->Delete_type = make_type(state, "Delete", state->stmt_type, - Delete_fields, 1, - "Delete(expr* targets)"); - if (!state->Delete_type) return 0; - state->Assign_type = make_type(state, "Assign", state->stmt_type, - Assign_fields, 3, - "Assign(expr* targets, expr value, string? type_comment)"); - if (!state->Assign_type) return 0; - if (PyObject_SetAttr(state->Assign_type, state->type_comment, Py_None) == - -1) - return 0; - state->AugAssign_type = make_type(state, "AugAssign", state->stmt_type, - AugAssign_fields, 3, - "AugAssign(expr target, operator op, expr value)"); - if (!state->AugAssign_type) return 0; - state->AnnAssign_type = make_type(state, "AnnAssign", state->stmt_type, - AnnAssign_fields, 4, - "AnnAssign(expr target, expr annotation, expr? value, int simple)"); - if (!state->AnnAssign_type) return 0; - if (PyObject_SetAttr(state->AnnAssign_type, state->value, Py_None) == -1) - return 0; - state->For_type = make_type(state, "For", state->stmt_type, For_fields, 5, - "For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); - if (!state->For_type) return 0; - if (PyObject_SetAttr(state->For_type, state->type_comment, Py_None) == -1) - return 0; - state->AsyncFor_type = make_type(state, "AsyncFor", state->stmt_type, - AsyncFor_fields, 5, - "AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); - if (!state->AsyncFor_type) return 0; - if (PyObject_SetAttr(state->AsyncFor_type, state->type_comment, Py_None) == - -1) - return 0; - state->While_type = make_type(state, "While", state->stmt_type, - While_fields, 3, - "While(expr test, stmt* body, stmt* orelse)"); - if (!state->While_type) return 0; - state->If_type = make_type(state, "If", state->stmt_type, If_fields, 3, - "If(expr test, stmt* body, stmt* orelse)"); - if (!state->If_type) return 0; - state->With_type = make_type(state, "With", state->stmt_type, With_fields, - 3, - "With(withitem* items, stmt* body, string? type_comment)"); - if (!state->With_type) return 0; - if (PyObject_SetAttr(state->With_type, state->type_comment, Py_None) == -1) - return 0; - state->AsyncWith_type = make_type(state, "AsyncWith", state->stmt_type, - AsyncWith_fields, 3, - "AsyncWith(withitem* items, stmt* body, string? type_comment)"); - if (!state->AsyncWith_type) return 0; - if (PyObject_SetAttr(state->AsyncWith_type, state->type_comment, Py_None) - == -1) - return 0; - state->Raise_type = make_type(state, "Raise", state->stmt_type, - Raise_fields, 2, - "Raise(expr? exc, expr? cause)"); - if (!state->Raise_type) return 0; - if (PyObject_SetAttr(state->Raise_type, state->exc, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->Raise_type, state->cause, Py_None) == -1) - return 0; - state->Try_type = make_type(state, "Try", state->stmt_type, Try_fields, 4, - "Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)"); - if (!state->Try_type) return 0; - state->Assert_type = make_type(state, "Assert", state->stmt_type, - Assert_fields, 2, - "Assert(expr test, expr? msg)"); - if (!state->Assert_type) return 0; - if (PyObject_SetAttr(state->Assert_type, state->msg, Py_None) == -1) - return 0; - state->Import_type = make_type(state, "Import", state->stmt_type, - Import_fields, 1, - "Import(alias* names)"); - if (!state->Import_type) return 0; - state->ImportFrom_type = make_type(state, "ImportFrom", state->stmt_type, - ImportFrom_fields, 3, - "ImportFrom(identifier? module, alias* names, int? level)"); - if (!state->ImportFrom_type) return 0; - if (PyObject_SetAttr(state->ImportFrom_type, state->module, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->ImportFrom_type, state->level, Py_None) == -1) - return 0; - state->Global_type = make_type(state, "Global", state->stmt_type, - Global_fields, 1, - "Global(identifier* names)"); - if (!state->Global_type) return 0; - state->Nonlocal_type = make_type(state, "Nonlocal", state->stmt_type, - Nonlocal_fields, 1, - "Nonlocal(identifier* names)"); - if (!state->Nonlocal_type) return 0; - state->Expr_type = make_type(state, "Expr", state->stmt_type, Expr_fields, - 1, - "Expr(expr value)"); - if (!state->Expr_type) return 0; - state->Pass_type = make_type(state, "Pass", state->stmt_type, NULL, 0, - "Pass"); - if (!state->Pass_type) return 0; - state->Break_type = make_type(state, "Break", state->stmt_type, NULL, 0, - "Break"); - if (!state->Break_type) return 0; - state->Continue_type = make_type(state, "Continue", state->stmt_type, NULL, - 0, - "Continue"); - if (!state->Continue_type) return 0; - state->expr_type = make_type(state, "expr", state->AST_type, NULL, 0, - "expr = BoolOp(boolop op, expr* values)\n" - " | NamedExpr(expr target, expr value)\n" - " | BinOp(expr left, operator op, expr right)\n" - " | UnaryOp(unaryop op, expr operand)\n" - " | Lambda(arguments args, expr body)\n" - " | IfExp(expr test, expr body, expr orelse)\n" - " | Dict(expr* keys, expr* values)\n" - " | Set(expr* elts)\n" - " | ListComp(expr elt, comprehension* generators)\n" - " | SetComp(expr elt, comprehension* generators)\n" - " | DictComp(expr key, expr value, comprehension* generators)\n" - " | GeneratorExp(expr elt, comprehension* generators)\n" - " | Await(expr value)\n" - " | Yield(expr? value)\n" - " | YieldFrom(expr value)\n" - " | Compare(expr left, cmpop* ops, expr* comparators)\n" - " | Call(expr func, expr* args, keyword* keywords)\n" - " | FormattedValue(expr value, int? conversion, expr? format_spec)\n" - " | JoinedStr(expr* values)\n" - " | Constant(constant value, string? kind)\n" - " | Attribute(expr value, identifier attr, expr_context ctx)\n" - " | Subscript(expr value, expr slice, expr_context ctx)\n" - " | Starred(expr value, expr_context ctx)\n" - " | Name(identifier id, expr_context ctx)\n" - " | List(expr* elts, expr_context ctx)\n" - " | Tuple(expr* elts, expr_context ctx)\n" - " | Slice(expr? lower, expr? upper, expr? step)"); - if (!state->expr_type) return 0; - if (!add_attributes(state, state->expr_type, expr_attributes, 4)) return 0; - if (PyObject_SetAttr(state->expr_type, state->end_lineno, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->expr_type, state->end_col_offset, Py_None) == - -1) - return 0; - state->BoolOp_type = make_type(state, "BoolOp", state->expr_type, - BoolOp_fields, 2, - "BoolOp(boolop op, expr* values)"); - if (!state->BoolOp_type) return 0; - state->NamedExpr_type = make_type(state, "NamedExpr", state->expr_type, - NamedExpr_fields, 2, - "NamedExpr(expr target, expr value)"); - if (!state->NamedExpr_type) return 0; - state->BinOp_type = make_type(state, "BinOp", state->expr_type, - BinOp_fields, 3, - "BinOp(expr left, operator op, expr right)"); - if (!state->BinOp_type) return 0; - state->UnaryOp_type = make_type(state, "UnaryOp", state->expr_type, - UnaryOp_fields, 2, - "UnaryOp(unaryop op, expr operand)"); - if (!state->UnaryOp_type) return 0; - state->Lambda_type = make_type(state, "Lambda", state->expr_type, - Lambda_fields, 2, - "Lambda(arguments args, expr body)"); - if (!state->Lambda_type) return 0; - state->IfExp_type = make_type(state, "IfExp", state->expr_type, - IfExp_fields, 3, - "IfExp(expr test, expr body, expr orelse)"); - if (!state->IfExp_type) return 0; - state->Dict_type = make_type(state, "Dict", state->expr_type, Dict_fields, - 2, - "Dict(expr* keys, expr* values)"); - if (!state->Dict_type) return 0; - state->Set_type = make_type(state, "Set", state->expr_type, Set_fields, 1, - "Set(expr* elts)"); - if (!state->Set_type) return 0; - state->ListComp_type = make_type(state, "ListComp", state->expr_type, - ListComp_fields, 2, - "ListComp(expr elt, comprehension* generators)"); - if (!state->ListComp_type) return 0; - state->SetComp_type = make_type(state, "SetComp", state->expr_type, - SetComp_fields, 2, - "SetComp(expr elt, comprehension* generators)"); - if (!state->SetComp_type) return 0; - state->DictComp_type = make_type(state, "DictComp", state->expr_type, - DictComp_fields, 3, - "DictComp(expr key, expr value, comprehension* generators)"); - if (!state->DictComp_type) return 0; - state->GeneratorExp_type = make_type(state, "GeneratorExp", - state->expr_type, GeneratorExp_fields, - 2, - "GeneratorExp(expr elt, comprehension* generators)"); - if (!state->GeneratorExp_type) return 0; - state->Await_type = make_type(state, "Await", state->expr_type, - Await_fields, 1, - "Await(expr value)"); - if (!state->Await_type) return 0; - state->Yield_type = make_type(state, "Yield", state->expr_type, - Yield_fields, 1, - "Yield(expr? value)"); - if (!state->Yield_type) return 0; - if (PyObject_SetAttr(state->Yield_type, state->value, Py_None) == -1) - return 0; - state->YieldFrom_type = make_type(state, "YieldFrom", state->expr_type, - YieldFrom_fields, 1, - "YieldFrom(expr value)"); - if (!state->YieldFrom_type) return 0; - state->Compare_type = make_type(state, "Compare", state->expr_type, - Compare_fields, 3, - "Compare(expr left, cmpop* ops, expr* comparators)"); - if (!state->Compare_type) return 0; - state->Call_type = make_type(state, "Call", state->expr_type, Call_fields, - 3, - "Call(expr func, expr* args, keyword* keywords)"); - if (!state->Call_type) return 0; - state->FormattedValue_type = make_type(state, "FormattedValue", - state->expr_type, - FormattedValue_fields, 3, - "FormattedValue(expr value, int? conversion, expr? format_spec)"); - if (!state->FormattedValue_type) return 0; - if (PyObject_SetAttr(state->FormattedValue_type, state->conversion, - Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->FormattedValue_type, state->format_spec, - Py_None) == -1) - return 0; - state->JoinedStr_type = make_type(state, "JoinedStr", state->expr_type, - JoinedStr_fields, 1, - "JoinedStr(expr* values)"); - if (!state->JoinedStr_type) return 0; - state->Constant_type = make_type(state, "Constant", state->expr_type, - Constant_fields, 2, - "Constant(constant value, string? kind)"); - if (!state->Constant_type) return 0; - if (PyObject_SetAttr(state->Constant_type, state->kind, Py_None) == -1) - return 0; - state->Attribute_type = make_type(state, "Attribute", state->expr_type, - Attribute_fields, 3, - "Attribute(expr value, identifier attr, expr_context ctx)"); - if (!state->Attribute_type) return 0; - state->Subscript_type = make_type(state, "Subscript", state->expr_type, - Subscript_fields, 3, - "Subscript(expr value, expr slice, expr_context ctx)"); - if (!state->Subscript_type) return 0; - state->Starred_type = make_type(state, "Starred", state->expr_type, - Starred_fields, 2, - "Starred(expr value, expr_context ctx)"); - if (!state->Starred_type) return 0; - state->Name_type = make_type(state, "Name", state->expr_type, Name_fields, - 2, - "Name(identifier id, expr_context ctx)"); - if (!state->Name_type) return 0; - state->List_type = make_type(state, "List", state->expr_type, List_fields, - 2, - "List(expr* elts, expr_context ctx)"); - if (!state->List_type) return 0; - state->Tuple_type = make_type(state, "Tuple", state->expr_type, - Tuple_fields, 2, - "Tuple(expr* elts, expr_context ctx)"); - if (!state->Tuple_type) return 0; - state->Slice_type = make_type(state, "Slice", state->expr_type, - Slice_fields, 3, - "Slice(expr? lower, expr? upper, expr? step)"); - if (!state->Slice_type) return 0; - if (PyObject_SetAttr(state->Slice_type, state->lower, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->Slice_type, state->upper, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->Slice_type, state->step, Py_None) == -1) - return 0; - state->expr_context_type = make_type(state, "expr_context", - state->AST_type, NULL, 0, - "expr_context = Load | Store | Del"); - if (!state->expr_context_type) return 0; - if (!add_attributes(state, state->expr_context_type, NULL, 0)) return 0; - state->Load_type = make_type(state, "Load", state->expr_context_type, NULL, - 0, - "Load"); - if (!state->Load_type) return 0; - state->Load_singleton = PyType_GenericNew((PyTypeObject *)state->Load_type, - NULL, NULL); - if (!state->Load_singleton) return 0; - state->Store_type = make_type(state, "Store", state->expr_context_type, - NULL, 0, - "Store"); - if (!state->Store_type) return 0; - state->Store_singleton = PyType_GenericNew((PyTypeObject - *)state->Store_type, NULL, NULL); - if (!state->Store_singleton) return 0; - state->Del_type = make_type(state, "Del", state->expr_context_type, NULL, 0, - "Del"); - if (!state->Del_type) return 0; - state->Del_singleton = PyType_GenericNew((PyTypeObject *)state->Del_type, - NULL, NULL); - if (!state->Del_singleton) return 0; - state->boolop_type = make_type(state, "boolop", state->AST_type, NULL, 0, - "boolop = And | Or"); - if (!state->boolop_type) return 0; - if (!add_attributes(state, state->boolop_type, NULL, 0)) return 0; - state->And_type = make_type(state, "And", state->boolop_type, NULL, 0, - "And"); - if (!state->And_type) return 0; - state->And_singleton = PyType_GenericNew((PyTypeObject *)state->And_type, - NULL, NULL); - if (!state->And_singleton) return 0; - state->Or_type = make_type(state, "Or", state->boolop_type, NULL, 0, - "Or"); - if (!state->Or_type) return 0; - state->Or_singleton = PyType_GenericNew((PyTypeObject *)state->Or_type, - NULL, NULL); - if (!state->Or_singleton) return 0; - state->operator_type = make_type(state, "operator", state->AST_type, NULL, - 0, - "operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift | RShift | BitOr | BitXor | BitAnd | FloorDiv"); - if (!state->operator_type) return 0; - if (!add_attributes(state, state->operator_type, NULL, 0)) return 0; - state->Add_type = make_type(state, "Add", state->operator_type, NULL, 0, - "Add"); - if (!state->Add_type) return 0; - state->Add_singleton = PyType_GenericNew((PyTypeObject *)state->Add_type, - NULL, NULL); - if (!state->Add_singleton) return 0; - state->Sub_type = make_type(state, "Sub", state->operator_type, NULL, 0, - "Sub"); - if (!state->Sub_type) return 0; - state->Sub_singleton = PyType_GenericNew((PyTypeObject *)state->Sub_type, - NULL, NULL); - if (!state->Sub_singleton) return 0; - state->Mult_type = make_type(state, "Mult", state->operator_type, NULL, 0, - "Mult"); - if (!state->Mult_type) return 0; - state->Mult_singleton = PyType_GenericNew((PyTypeObject *)state->Mult_type, - NULL, NULL); - if (!state->Mult_singleton) return 0; - state->MatMult_type = make_type(state, "MatMult", state->operator_type, - NULL, 0, - "MatMult"); - if (!state->MatMult_type) return 0; - state->MatMult_singleton = PyType_GenericNew((PyTypeObject - *)state->MatMult_type, NULL, - NULL); - if (!state->MatMult_singleton) return 0; - state->Div_type = make_type(state, "Div", state->operator_type, NULL, 0, - "Div"); - if (!state->Div_type) return 0; - state->Div_singleton = PyType_GenericNew((PyTypeObject *)state->Div_type, - NULL, NULL); - if (!state->Div_singleton) return 0; - state->Mod_type = make_type(state, "Mod", state->operator_type, NULL, 0, - "Mod"); - if (!state->Mod_type) return 0; - state->Mod_singleton = PyType_GenericNew((PyTypeObject *)state->Mod_type, - NULL, NULL); - if (!state->Mod_singleton) return 0; - state->Pow_type = make_type(state, "Pow", state->operator_type, NULL, 0, - "Pow"); - if (!state->Pow_type) return 0; - state->Pow_singleton = PyType_GenericNew((PyTypeObject *)state->Pow_type, - NULL, NULL); - if (!state->Pow_singleton) return 0; - state->LShift_type = make_type(state, "LShift", state->operator_type, NULL, - 0, - "LShift"); - if (!state->LShift_type) return 0; - state->LShift_singleton = PyType_GenericNew((PyTypeObject - *)state->LShift_type, NULL, - NULL); - if (!state->LShift_singleton) return 0; - state->RShift_type = make_type(state, "RShift", state->operator_type, NULL, - 0, - "RShift"); - if (!state->RShift_type) return 0; - state->RShift_singleton = PyType_GenericNew((PyTypeObject - *)state->RShift_type, NULL, - NULL); - if (!state->RShift_singleton) return 0; - state->BitOr_type = make_type(state, "BitOr", state->operator_type, NULL, 0, - "BitOr"); - if (!state->BitOr_type) return 0; - state->BitOr_singleton = PyType_GenericNew((PyTypeObject - *)state->BitOr_type, NULL, NULL); - if (!state->BitOr_singleton) return 0; - state->BitXor_type = make_type(state, "BitXor", state->operator_type, NULL, - 0, - "BitXor"); - if (!state->BitXor_type) return 0; - state->BitXor_singleton = PyType_GenericNew((PyTypeObject - *)state->BitXor_type, NULL, - NULL); - if (!state->BitXor_singleton) return 0; - state->BitAnd_type = make_type(state, "BitAnd", state->operator_type, NULL, - 0, - "BitAnd"); - if (!state->BitAnd_type) return 0; - state->BitAnd_singleton = PyType_GenericNew((PyTypeObject - *)state->BitAnd_type, NULL, - NULL); - if (!state->BitAnd_singleton) return 0; - state->FloorDiv_type = make_type(state, "FloorDiv", state->operator_type, - NULL, 0, - "FloorDiv"); - if (!state->FloorDiv_type) return 0; - state->FloorDiv_singleton = PyType_GenericNew((PyTypeObject - *)state->FloorDiv_type, NULL, - NULL); - if (!state->FloorDiv_singleton) return 0; - state->unaryop_type = make_type(state, "unaryop", state->AST_type, NULL, 0, - "unaryop = Invert | Not | UAdd | USub"); - if (!state->unaryop_type) return 0; - if (!add_attributes(state, state->unaryop_type, NULL, 0)) return 0; - state->Invert_type = make_type(state, "Invert", state->unaryop_type, NULL, - 0, - "Invert"); - if (!state->Invert_type) return 0; - state->Invert_singleton = PyType_GenericNew((PyTypeObject - *)state->Invert_type, NULL, - NULL); - if (!state->Invert_singleton) return 0; - state->Not_type = make_type(state, "Not", state->unaryop_type, NULL, 0, - "Not"); - if (!state->Not_type) return 0; - state->Not_singleton = PyType_GenericNew((PyTypeObject *)state->Not_type, - NULL, NULL); - if (!state->Not_singleton) return 0; - state->UAdd_type = make_type(state, "UAdd", state->unaryop_type, NULL, 0, - "UAdd"); - if (!state->UAdd_type) return 0; - state->UAdd_singleton = PyType_GenericNew((PyTypeObject *)state->UAdd_type, - NULL, NULL); - if (!state->UAdd_singleton) return 0; - state->USub_type = make_type(state, "USub", state->unaryop_type, NULL, 0, - "USub"); - if (!state->USub_type) return 0; - state->USub_singleton = PyType_GenericNew((PyTypeObject *)state->USub_type, - NULL, NULL); - if (!state->USub_singleton) return 0; - state->cmpop_type = make_type(state, "cmpop", state->AST_type, NULL, 0, - "cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn"); - if (!state->cmpop_type) return 0; - if (!add_attributes(state, state->cmpop_type, NULL, 0)) return 0; - state->Eq_type = make_type(state, "Eq", state->cmpop_type, NULL, 0, - "Eq"); - if (!state->Eq_type) return 0; - state->Eq_singleton = PyType_GenericNew((PyTypeObject *)state->Eq_type, - NULL, NULL); - if (!state->Eq_singleton) return 0; - state->NotEq_type = make_type(state, "NotEq", state->cmpop_type, NULL, 0, - "NotEq"); - if (!state->NotEq_type) return 0; - state->NotEq_singleton = PyType_GenericNew((PyTypeObject - *)state->NotEq_type, NULL, NULL); - if (!state->NotEq_singleton) return 0; - state->Lt_type = make_type(state, "Lt", state->cmpop_type, NULL, 0, - "Lt"); - if (!state->Lt_type) return 0; - state->Lt_singleton = PyType_GenericNew((PyTypeObject *)state->Lt_type, - NULL, NULL); - if (!state->Lt_singleton) return 0; - state->LtE_type = make_type(state, "LtE", state->cmpop_type, NULL, 0, - "LtE"); - if (!state->LtE_type) return 0; - state->LtE_singleton = PyType_GenericNew((PyTypeObject *)state->LtE_type, - NULL, NULL); - if (!state->LtE_singleton) return 0; - state->Gt_type = make_type(state, "Gt", state->cmpop_type, NULL, 0, - "Gt"); - if (!state->Gt_type) return 0; - state->Gt_singleton = PyType_GenericNew((PyTypeObject *)state->Gt_type, - NULL, NULL); - if (!state->Gt_singleton) return 0; - state->GtE_type = make_type(state, "GtE", state->cmpop_type, NULL, 0, - "GtE"); - if (!state->GtE_type) return 0; - state->GtE_singleton = PyType_GenericNew((PyTypeObject *)state->GtE_type, - NULL, NULL); - if (!state->GtE_singleton) return 0; - state->Is_type = make_type(state, "Is", state->cmpop_type, NULL, 0, - "Is"); - if (!state->Is_type) return 0; - state->Is_singleton = PyType_GenericNew((PyTypeObject *)state->Is_type, - NULL, NULL); - if (!state->Is_singleton) return 0; - state->IsNot_type = make_type(state, "IsNot", state->cmpop_type, NULL, 0, - "IsNot"); - if (!state->IsNot_type) return 0; - state->IsNot_singleton = PyType_GenericNew((PyTypeObject - *)state->IsNot_type, NULL, NULL); - if (!state->IsNot_singleton) return 0; - state->In_type = make_type(state, "In", state->cmpop_type, NULL, 0, - "In"); - if (!state->In_type) return 0; - state->In_singleton = PyType_GenericNew((PyTypeObject *)state->In_type, - NULL, NULL); - if (!state->In_singleton) return 0; - state->NotIn_type = make_type(state, "NotIn", state->cmpop_type, NULL, 0, - "NotIn"); - if (!state->NotIn_type) return 0; - state->NotIn_singleton = PyType_GenericNew((PyTypeObject - *)state->NotIn_type, NULL, NULL); - if (!state->NotIn_singleton) return 0; - state->comprehension_type = make_type(state, "comprehension", - state->AST_type, - comprehension_fields, 4, - "comprehension(expr target, expr iter, expr* ifs, int is_async)"); - if (!state->comprehension_type) return 0; - if (!add_attributes(state, state->comprehension_type, NULL, 0)) return 0; - state->excepthandler_type = make_type(state, "excepthandler", - state->AST_type, NULL, 0, - "excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)"); - if (!state->excepthandler_type) return 0; - if (!add_attributes(state, state->excepthandler_type, - excepthandler_attributes, 4)) return 0; - if (PyObject_SetAttr(state->excepthandler_type, state->end_lineno, Py_None) - == -1) - return 0; - if (PyObject_SetAttr(state->excepthandler_type, state->end_col_offset, - Py_None) == -1) - return 0; - state->ExceptHandler_type = make_type(state, "ExceptHandler", - state->excepthandler_type, - ExceptHandler_fields, 3, - "ExceptHandler(expr? type, identifier? name, stmt* body)"); - if (!state->ExceptHandler_type) return 0; - if (PyObject_SetAttr(state->ExceptHandler_type, state->type, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->ExceptHandler_type, state->name, Py_None) == -1) - return 0; - state->arguments_type = make_type(state, "arguments", state->AST_type, - arguments_fields, 7, - "arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)"); - if (!state->arguments_type) return 0; - if (!add_attributes(state, state->arguments_type, NULL, 0)) return 0; - if (PyObject_SetAttr(state->arguments_type, state->vararg, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->arguments_type, state->kwarg, Py_None) == -1) - return 0; - state->arg_type = make_type(state, "arg", state->AST_type, arg_fields, 3, - "arg(identifier arg, expr? annotation, string? type_comment)"); - if (!state->arg_type) return 0; - if (!add_attributes(state, state->arg_type, arg_attributes, 4)) return 0; - if (PyObject_SetAttr(state->arg_type, state->annotation, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->arg_type, state->type_comment, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->arg_type, state->end_lineno, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->arg_type, state->end_col_offset, Py_None) == -1) - return 0; - state->keyword_type = make_type(state, "keyword", state->AST_type, - keyword_fields, 2, - "keyword(identifier? arg, expr value)"); - if (!state->keyword_type) return 0; - if (!add_attributes(state, state->keyword_type, keyword_attributes, 4)) - return 0; - if (PyObject_SetAttr(state->keyword_type, state->arg, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->keyword_type, state->end_lineno, Py_None) == -1) - return 0; - if (PyObject_SetAttr(state->keyword_type, state->end_col_offset, Py_None) - == -1) - return 0; - state->alias_type = make_type(state, "alias", state->AST_type, - alias_fields, 2, - "alias(identifier name, identifier? asname)"); - if (!state->alias_type) return 0; - if (!add_attributes(state, state->alias_type, NULL, 0)) return 0; - if (PyObject_SetAttr(state->alias_type, state->asname, Py_None) == -1) - return 0; - state->withitem_type = make_type(state, "withitem", state->AST_type, - withitem_fields, 2, - "withitem(expr context_expr, expr? optional_vars)"); - if (!state->withitem_type) return 0; - if (!add_attributes(state, state->withitem_type, NULL, 0)) return 0; - if (PyObject_SetAttr(state->withitem_type, state->optional_vars, Py_None) - == -1) - return 0; - state->type_ignore_type = make_type(state, "type_ignore", state->AST_type, - NULL, 0, - "type_ignore = TypeIgnore(int lineno, string tag)"); - if (!state->type_ignore_type) return 0; - if (!add_attributes(state, state->type_ignore_type, NULL, 0)) return 0; - state->TypeIgnore_type = make_type(state, "TypeIgnore", - state->type_ignore_type, - TypeIgnore_fields, 2, - "TypeIgnore(int lineno, string tag)"); - if (!state->TypeIgnore_type) return 0; - state->initialized = 1; + if (state->initialized) return 1; + if (init_identifiers(state) < 0) return 0; + state->AST_type = PyType_FromSpec(&AST_type_spec); + if (!state->AST_type) return 0; + if (add_ast_fields(state) < 0) return 0; + state->mod_type = make_type(state, "mod", state->AST_type, NULL, 0, + "mod = Module(stmt* body, type_ignore* type_ignores)\n" + " | Interactive(stmt* body)\n" + " | Expression(expr body)\n" + " | FunctionType(expr* argtypes, expr returns)"); + if (!state->mod_type) return 0; + if (!add_attributes(state, state->mod_type, NULL, 0)) return 0; + state->Module_type = make_type(state, "Module", state->mod_type, + Module_fields, 2, + "Module(stmt* body, type_ignore* type_ignores)"); + if (!state->Module_type) return 0; + state->Interactive_type = make_type(state, "Interactive", state->mod_type, + Interactive_fields, 1, + "Interactive(stmt* body)"); + if (!state->Interactive_type) return 0; + state->Expression_type = make_type(state, "Expression", state->mod_type, + Expression_fields, 1, + "Expression(expr body)"); + if (!state->Expression_type) return 0; + state->FunctionType_type = make_type(state, "FunctionType", + state->mod_type, FunctionType_fields, + 2, + "FunctionType(expr* argtypes, expr returns)"); + if (!state->FunctionType_type) return 0; + state->stmt_type = make_type(state, "stmt", state->AST_type, NULL, 0, + "stmt = FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" + " | AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" + " | ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)\n" + " | Return(expr? value)\n" + " | Delete(expr* targets)\n" + " | Assign(expr* targets, expr value, string? type_comment)\n" + " | AugAssign(expr target, operator op, expr value)\n" + " | AnnAssign(expr target, expr annotation, expr? value, int simple)\n" + " | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" + " | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" + " | While(expr test, stmt* body, stmt* orelse)\n" + " | If(expr test, stmt* body, stmt* orelse)\n" + " | With(withitem* items, stmt* body, string? type_comment)\n" + " | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" + " | Raise(expr? exc, expr? cause)\n" + " | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)\n" + " | Assert(expr test, expr? msg)\n" + " | Import(alias* names)\n" + " | ImportFrom(identifier? module, alias* names, int? level)\n" + " | Global(identifier* names)\n" + " | Nonlocal(identifier* names)\n" + " | Expr(expr value)\n" + " | Pass\n" + " | Break\n" + " | Continue"); + if (!state->stmt_type) return 0; + if (!add_attributes(state, state->stmt_type, stmt_attributes, 4)) return 0; + if (PyObject_SetAttr(state->stmt_type, state->end_lineno, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->stmt_type, state->end_col_offset, Py_None) == + -1) + return 0; + state->FunctionDef_type = make_type(state, "FunctionDef", state->stmt_type, + FunctionDef_fields, 6, + "FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); + if (!state->FunctionDef_type) return 0; + if (PyObject_SetAttr(state->FunctionDef_type, state->returns, Py_None) == + -1) + return 0; + if (PyObject_SetAttr(state->FunctionDef_type, state->type_comment, Py_None) + == -1) + return 0; + state->AsyncFunctionDef_type = make_type(state, "AsyncFunctionDef", + state->stmt_type, + AsyncFunctionDef_fields, 6, + "AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); + if (!state->AsyncFunctionDef_type) return 0; + if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->returns, Py_None) + == -1) + return 0; + if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->type_comment, + Py_None) == -1) + return 0; + state->ClassDef_type = make_type(state, "ClassDef", state->stmt_type, + ClassDef_fields, 5, + "ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)"); + if (!state->ClassDef_type) return 0; + state->Return_type = make_type(state, "Return", state->stmt_type, + Return_fields, 1, + "Return(expr? value)"); + if (!state->Return_type) return 0; + if (PyObject_SetAttr(state->Return_type, state->value, Py_None) == -1) + return 0; + state->Delete_type = make_type(state, "Delete", state->stmt_type, + Delete_fields, 1, + "Delete(expr* targets)"); + if (!state->Delete_type) return 0; + state->Assign_type = make_type(state, "Assign", state->stmt_type, + Assign_fields, 3, + "Assign(expr* targets, expr value, string? type_comment)"); + if (!state->Assign_type) return 0; + if (PyObject_SetAttr(state->Assign_type, state->type_comment, Py_None) == + -1) + return 0; + state->AugAssign_type = make_type(state, "AugAssign", state->stmt_type, + AugAssign_fields, 3, + "AugAssign(expr target, operator op, expr value)"); + if (!state->AugAssign_type) return 0; + state->AnnAssign_type = make_type(state, "AnnAssign", state->stmt_type, + AnnAssign_fields, 4, + "AnnAssign(expr target, expr annotation, expr? value, int simple)"); + if (!state->AnnAssign_type) return 0; + if (PyObject_SetAttr(state->AnnAssign_type, state->value, Py_None) == -1) + return 0; + state->For_type = make_type(state, "For", state->stmt_type, For_fields, 5, + "For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); + if (!state->For_type) return 0; + if (PyObject_SetAttr(state->For_type, state->type_comment, Py_None) == -1) + return 0; + state->AsyncFor_type = make_type(state, "AsyncFor", state->stmt_type, + AsyncFor_fields, 5, + "AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); + if (!state->AsyncFor_type) return 0; + if (PyObject_SetAttr(state->AsyncFor_type, state->type_comment, Py_None) == + -1) + return 0; + state->While_type = make_type(state, "While", state->stmt_type, + While_fields, 3, + "While(expr test, stmt* body, stmt* orelse)"); + if (!state->While_type) return 0; + state->If_type = make_type(state, "If", state->stmt_type, If_fields, 3, + "If(expr test, stmt* body, stmt* orelse)"); + if (!state->If_type) return 0; + state->With_type = make_type(state, "With", state->stmt_type, With_fields, + 3, + "With(withitem* items, stmt* body, string? type_comment)"); + if (!state->With_type) return 0; + if (PyObject_SetAttr(state->With_type, state->type_comment, Py_None) == -1) + return 0; + state->AsyncWith_type = make_type(state, "AsyncWith", state->stmt_type, + AsyncWith_fields, 3, + "AsyncWith(withitem* items, stmt* body, string? type_comment)"); + if (!state->AsyncWith_type) return 0; + if (PyObject_SetAttr(state->AsyncWith_type, state->type_comment, Py_None) + == -1) + return 0; + state->Raise_type = make_type(state, "Raise", state->stmt_type, + Raise_fields, 2, + "Raise(expr? exc, expr? cause)"); + if (!state->Raise_type) return 0; + if (PyObject_SetAttr(state->Raise_type, state->exc, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->Raise_type, state->cause, Py_None) == -1) + return 0; + state->Try_type = make_type(state, "Try", state->stmt_type, Try_fields, 4, + "Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)"); + if (!state->Try_type) return 0; + state->Assert_type = make_type(state, "Assert", state->stmt_type, + Assert_fields, 2, + "Assert(expr test, expr? msg)"); + if (!state->Assert_type) return 0; + if (PyObject_SetAttr(state->Assert_type, state->msg, Py_None) == -1) + return 0; + state->Import_type = make_type(state, "Import", state->stmt_type, + Import_fields, 1, + "Import(alias* names)"); + if (!state->Import_type) return 0; + state->ImportFrom_type = make_type(state, "ImportFrom", state->stmt_type, + ImportFrom_fields, 3, + "ImportFrom(identifier? module, alias* names, int? level)"); + if (!state->ImportFrom_type) return 0; + if (PyObject_SetAttr(state->ImportFrom_type, state->module, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->ImportFrom_type, state->level, Py_None) == -1) + return 0; + state->Global_type = make_type(state, "Global", state->stmt_type, + Global_fields, 1, + "Global(identifier* names)"); + if (!state->Global_type) return 0; + state->Nonlocal_type = make_type(state, "Nonlocal", state->stmt_type, + Nonlocal_fields, 1, + "Nonlocal(identifier* names)"); + if (!state->Nonlocal_type) return 0; + state->Expr_type = make_type(state, "Expr", state->stmt_type, Expr_fields, + 1, + "Expr(expr value)"); + if (!state->Expr_type) return 0; + state->Pass_type = make_type(state, "Pass", state->stmt_type, NULL, 0, + "Pass"); + if (!state->Pass_type) return 0; + state->Break_type = make_type(state, "Break", state->stmt_type, NULL, 0, + "Break"); + if (!state->Break_type) return 0; + state->Continue_type = make_type(state, "Continue", state->stmt_type, NULL, + 0, + "Continue"); + if (!state->Continue_type) return 0; + state->expr_type = make_type(state, "expr", state->AST_type, NULL, 0, + "expr = BoolOp(boolop op, expr* values)\n" + " | NamedExpr(expr target, expr value)\n" + " | BinOp(expr left, operator op, expr right)\n" + " | UnaryOp(unaryop op, expr operand)\n" + " | Lambda(arguments args, expr body)\n" + " | IfExp(expr test, expr body, expr orelse)\n" + " | Dict(expr* keys, expr* values)\n" + " | Set(expr* elts)\n" + " | ListComp(expr elt, comprehension* generators)\n" + " | SetComp(expr elt, comprehension* generators)\n" + " | DictComp(expr key, expr value, comprehension* generators)\n" + " | GeneratorExp(expr elt, comprehension* generators)\n" + " | Await(expr value)\n" + " | Yield(expr? value)\n" + " | YieldFrom(expr value)\n" + " | Compare(expr left, cmpop* ops, expr* comparators)\n" + " | Call(expr func, expr* args, keyword* keywords)\n" + " | FormattedValue(expr value, int? conversion, expr? format_spec)\n" + " | JoinedStr(expr* values)\n" + " | Constant(constant value, string? kind)\n" + " | Attribute(expr value, identifier attr, expr_context ctx)\n" + " | Subscript(expr value, expr slice, expr_context ctx)\n" + " | Starred(expr value, expr_context ctx)\n" + " | Name(identifier id, expr_context ctx)\n" + " | List(expr* elts, expr_context ctx)\n" + " | Tuple(expr* elts, expr_context ctx)\n" + " | Slice(expr? lower, expr? upper, expr? step)"); + if (!state->expr_type) return 0; + if (!add_attributes(state, state->expr_type, expr_attributes, 4)) return 0; + if (PyObject_SetAttr(state->expr_type, state->end_lineno, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->expr_type, state->end_col_offset, Py_None) == + -1) + return 0; + state->BoolOp_type = make_type(state, "BoolOp", state->expr_type, + BoolOp_fields, 2, + "BoolOp(boolop op, expr* values)"); + if (!state->BoolOp_type) return 0; + state->NamedExpr_type = make_type(state, "NamedExpr", state->expr_type, + NamedExpr_fields, 2, + "NamedExpr(expr target, expr value)"); + if (!state->NamedExpr_type) return 0; + state->BinOp_type = make_type(state, "BinOp", state->expr_type, + BinOp_fields, 3, + "BinOp(expr left, operator op, expr right)"); + if (!state->BinOp_type) return 0; + state->UnaryOp_type = make_type(state, "UnaryOp", state->expr_type, + UnaryOp_fields, 2, + "UnaryOp(unaryop op, expr operand)"); + if (!state->UnaryOp_type) return 0; + state->Lambda_type = make_type(state, "Lambda", state->expr_type, + Lambda_fields, 2, + "Lambda(arguments args, expr body)"); + if (!state->Lambda_type) return 0; + state->IfExp_type = make_type(state, "IfExp", state->expr_type, + IfExp_fields, 3, + "IfExp(expr test, expr body, expr orelse)"); + if (!state->IfExp_type) return 0; + state->Dict_type = make_type(state, "Dict", state->expr_type, Dict_fields, + 2, + "Dict(expr* keys, expr* values)"); + if (!state->Dict_type) return 0; + state->Set_type = make_type(state, "Set", state->expr_type, Set_fields, 1, + "Set(expr* elts)"); + if (!state->Set_type) return 0; + state->ListComp_type = make_type(state, "ListComp", state->expr_type, + ListComp_fields, 2, + "ListComp(expr elt, comprehension* generators)"); + if (!state->ListComp_type) return 0; + state->SetComp_type = make_type(state, "SetComp", state->expr_type, + SetComp_fields, 2, + "SetComp(expr elt, comprehension* generators)"); + if (!state->SetComp_type) return 0; + state->DictComp_type = make_type(state, "DictComp", state->expr_type, + DictComp_fields, 3, + "DictComp(expr key, expr value, comprehension* generators)"); + if (!state->DictComp_type) return 0; + state->GeneratorExp_type = make_type(state, "GeneratorExp", + state->expr_type, GeneratorExp_fields, + 2, + "GeneratorExp(expr elt, comprehension* generators)"); + if (!state->GeneratorExp_type) return 0; + state->Await_type = make_type(state, "Await", state->expr_type, + Await_fields, 1, + "Await(expr value)"); + if (!state->Await_type) return 0; + state->Yield_type = make_type(state, "Yield", state->expr_type, + Yield_fields, 1, + "Yield(expr? value)"); + if (!state->Yield_type) return 0; + if (PyObject_SetAttr(state->Yield_type, state->value, Py_None) == -1) + return 0; + state->YieldFrom_type = make_type(state, "YieldFrom", state->expr_type, + YieldFrom_fields, 1, + "YieldFrom(expr value)"); + if (!state->YieldFrom_type) return 0; + state->Compare_type = make_type(state, "Compare", state->expr_type, + Compare_fields, 3, + "Compare(expr left, cmpop* ops, expr* comparators)"); + if (!state->Compare_type) return 0; + state->Call_type = make_type(state, "Call", state->expr_type, Call_fields, + 3, + "Call(expr func, expr* args, keyword* keywords)"); + if (!state->Call_type) return 0; + state->FormattedValue_type = make_type(state, "FormattedValue", + state->expr_type, + FormattedValue_fields, 3, + "FormattedValue(expr value, int? conversion, expr? format_spec)"); + if (!state->FormattedValue_type) return 0; + if (PyObject_SetAttr(state->FormattedValue_type, state->conversion, + Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->FormattedValue_type, state->format_spec, + Py_None) == -1) + return 0; + state->JoinedStr_type = make_type(state, "JoinedStr", state->expr_type, + JoinedStr_fields, 1, + "JoinedStr(expr* values)"); + if (!state->JoinedStr_type) return 0; + state->Constant_type = make_type(state, "Constant", state->expr_type, + Constant_fields, 2, + "Constant(constant value, string? kind)"); + if (!state->Constant_type) return 0; + if (PyObject_SetAttr(state->Constant_type, state->kind, Py_None) == -1) + return 0; + state->Attribute_type = make_type(state, "Attribute", state->expr_type, + Attribute_fields, 3, + "Attribute(expr value, identifier attr, expr_context ctx)"); + if (!state->Attribute_type) return 0; + state->Subscript_type = make_type(state, "Subscript", state->expr_type, + Subscript_fields, 3, + "Subscript(expr value, expr slice, expr_context ctx)"); + if (!state->Subscript_type) return 0; + state->Starred_type = make_type(state, "Starred", state->expr_type, + Starred_fields, 2, + "Starred(expr value, expr_context ctx)"); + if (!state->Starred_type) return 0; + state->Name_type = make_type(state, "Name", state->expr_type, Name_fields, + 2, + "Name(identifier id, expr_context ctx)"); + if (!state->Name_type) return 0; + state->List_type = make_type(state, "List", state->expr_type, List_fields, + 2, + "List(expr* elts, expr_context ctx)"); + if (!state->List_type) return 0; + state->Tuple_type = make_type(state, "Tuple", state->expr_type, + Tuple_fields, 2, + "Tuple(expr* elts, expr_context ctx)"); + if (!state->Tuple_type) return 0; + state->Slice_type = make_type(state, "Slice", state->expr_type, + Slice_fields, 3, + "Slice(expr? lower, expr? upper, expr? step)"); + if (!state->Slice_type) return 0; + if (PyObject_SetAttr(state->Slice_type, state->lower, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->Slice_type, state->upper, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->Slice_type, state->step, Py_None) == -1) + return 0; + state->expr_context_type = make_type(state, "expr_context", + state->AST_type, NULL, 0, + "expr_context = Load | Store | Del"); + if (!state->expr_context_type) return 0; + if (!add_attributes(state, state->expr_context_type, NULL, 0)) return 0; + state->Load_type = make_type(state, "Load", state->expr_context_type, NULL, + 0, + "Load"); + if (!state->Load_type) return 0; + state->Load_singleton = PyType_GenericNew((PyTypeObject *)state->Load_type, + NULL, NULL); + if (!state->Load_singleton) return 0; + state->Store_type = make_type(state, "Store", state->expr_context_type, + NULL, 0, + "Store"); + if (!state->Store_type) return 0; + state->Store_singleton = PyType_GenericNew((PyTypeObject + *)state->Store_type, NULL, NULL); + if (!state->Store_singleton) return 0; + state->Del_type = make_type(state, "Del", state->expr_context_type, NULL, 0, + "Del"); + if (!state->Del_type) return 0; + state->Del_singleton = PyType_GenericNew((PyTypeObject *)state->Del_type, + NULL, NULL); + if (!state->Del_singleton) return 0; + state->boolop_type = make_type(state, "boolop", state->AST_type, NULL, 0, + "boolop = And | Or"); + if (!state->boolop_type) return 0; + if (!add_attributes(state, state->boolop_type, NULL, 0)) return 0; + state->And_type = make_type(state, "And", state->boolop_type, NULL, 0, + "And"); + if (!state->And_type) return 0; + state->And_singleton = PyType_GenericNew((PyTypeObject *)state->And_type, + NULL, NULL); + if (!state->And_singleton) return 0; + state->Or_type = make_type(state, "Or", state->boolop_type, NULL, 0, + "Or"); + if (!state->Or_type) return 0; + state->Or_singleton = PyType_GenericNew((PyTypeObject *)state->Or_type, + NULL, NULL); + if (!state->Or_singleton) return 0; + state->operator_type = make_type(state, "operator", state->AST_type, NULL, + 0, + "operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift | RShift | BitOr | BitXor | BitAnd | FloorDiv"); + if (!state->operator_type) return 0; + if (!add_attributes(state, state->operator_type, NULL, 0)) return 0; + state->Add_type = make_type(state, "Add", state->operator_type, NULL, 0, + "Add"); + if (!state->Add_type) return 0; + state->Add_singleton = PyType_GenericNew((PyTypeObject *)state->Add_type, + NULL, NULL); + if (!state->Add_singleton) return 0; + state->Sub_type = make_type(state, "Sub", state->operator_type, NULL, 0, + "Sub"); + if (!state->Sub_type) return 0; + state->Sub_singleton = PyType_GenericNew((PyTypeObject *)state->Sub_type, + NULL, NULL); + if (!state->Sub_singleton) return 0; + state->Mult_type = make_type(state, "Mult", state->operator_type, NULL, 0, + "Mult"); + if (!state->Mult_type) return 0; + state->Mult_singleton = PyType_GenericNew((PyTypeObject *)state->Mult_type, + NULL, NULL); + if (!state->Mult_singleton) return 0; + state->MatMult_type = make_type(state, "MatMult", state->operator_type, + NULL, 0, + "MatMult"); + if (!state->MatMult_type) return 0; + state->MatMult_singleton = PyType_GenericNew((PyTypeObject + *)state->MatMult_type, NULL, + NULL); + if (!state->MatMult_singleton) return 0; + state->Div_type = make_type(state, "Div", state->operator_type, NULL, 0, + "Div"); + if (!state->Div_type) return 0; + state->Div_singleton = PyType_GenericNew((PyTypeObject *)state->Div_type, + NULL, NULL); + if (!state->Div_singleton) return 0; + state->Mod_type = make_type(state, "Mod", state->operator_type, NULL, 0, + "Mod"); + if (!state->Mod_type) return 0; + state->Mod_singleton = PyType_GenericNew((PyTypeObject *)state->Mod_type, + NULL, NULL); + if (!state->Mod_singleton) return 0; + state->Pow_type = make_type(state, "Pow", state->operator_type, NULL, 0, + "Pow"); + if (!state->Pow_type) return 0; + state->Pow_singleton = PyType_GenericNew((PyTypeObject *)state->Pow_type, + NULL, NULL); + if (!state->Pow_singleton) return 0; + state->LShift_type = make_type(state, "LShift", state->operator_type, NULL, + 0, + "LShift"); + if (!state->LShift_type) return 0; + state->LShift_singleton = PyType_GenericNew((PyTypeObject + *)state->LShift_type, NULL, + NULL); + if (!state->LShift_singleton) return 0; + state->RShift_type = make_type(state, "RShift", state->operator_type, NULL, + 0, + "RShift"); + if (!state->RShift_type) return 0; + state->RShift_singleton = PyType_GenericNew((PyTypeObject + *)state->RShift_type, NULL, + NULL); + if (!state->RShift_singleton) return 0; + state->BitOr_type = make_type(state, "BitOr", state->operator_type, NULL, 0, + "BitOr"); + if (!state->BitOr_type) return 0; + state->BitOr_singleton = PyType_GenericNew((PyTypeObject + *)state->BitOr_type, NULL, NULL); + if (!state->BitOr_singleton) return 0; + state->BitXor_type = make_type(state, "BitXor", state->operator_type, NULL, + 0, + "BitXor"); + if (!state->BitXor_type) return 0; + state->BitXor_singleton = PyType_GenericNew((PyTypeObject + *)state->BitXor_type, NULL, + NULL); + if (!state->BitXor_singleton) return 0; + state->BitAnd_type = make_type(state, "BitAnd", state->operator_type, NULL, + 0, + "BitAnd"); + if (!state->BitAnd_type) return 0; + state->BitAnd_singleton = PyType_GenericNew((PyTypeObject + *)state->BitAnd_type, NULL, + NULL); + if (!state->BitAnd_singleton) return 0; + state->FloorDiv_type = make_type(state, "FloorDiv", state->operator_type, + NULL, 0, + "FloorDiv"); + if (!state->FloorDiv_type) return 0; + state->FloorDiv_singleton = PyType_GenericNew((PyTypeObject + *)state->FloorDiv_type, NULL, + NULL); + if (!state->FloorDiv_singleton) return 0; + state->unaryop_type = make_type(state, "unaryop", state->AST_type, NULL, 0, + "unaryop = Invert | Not | UAdd | USub"); + if (!state->unaryop_type) return 0; + if (!add_attributes(state, state->unaryop_type, NULL, 0)) return 0; + state->Invert_type = make_type(state, "Invert", state->unaryop_type, NULL, + 0, + "Invert"); + if (!state->Invert_type) return 0; + state->Invert_singleton = PyType_GenericNew((PyTypeObject + *)state->Invert_type, NULL, + NULL); + if (!state->Invert_singleton) return 0; + state->Not_type = make_type(state, "Not", state->unaryop_type, NULL, 0, + "Not"); + if (!state->Not_type) return 0; + state->Not_singleton = PyType_GenericNew((PyTypeObject *)state->Not_type, + NULL, NULL); + if (!state->Not_singleton) return 0; + state->UAdd_type = make_type(state, "UAdd", state->unaryop_type, NULL, 0, + "UAdd"); + if (!state->UAdd_type) return 0; + state->UAdd_singleton = PyType_GenericNew((PyTypeObject *)state->UAdd_type, + NULL, NULL); + if (!state->UAdd_singleton) return 0; + state->USub_type = make_type(state, "USub", state->unaryop_type, NULL, 0, + "USub"); + if (!state->USub_type) return 0; + state->USub_singleton = PyType_GenericNew((PyTypeObject *)state->USub_type, + NULL, NULL); + if (!state->USub_singleton) return 0; + state->cmpop_type = make_type(state, "cmpop", state->AST_type, NULL, 0, + "cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn"); + if (!state->cmpop_type) return 0; + if (!add_attributes(state, state->cmpop_type, NULL, 0)) return 0; + state->Eq_type = make_type(state, "Eq", state->cmpop_type, NULL, 0, + "Eq"); + if (!state->Eq_type) return 0; + state->Eq_singleton = PyType_GenericNew((PyTypeObject *)state->Eq_type, + NULL, NULL); + if (!state->Eq_singleton) return 0; + state->NotEq_type = make_type(state, "NotEq", state->cmpop_type, NULL, 0, + "NotEq"); + if (!state->NotEq_type) return 0; + state->NotEq_singleton = PyType_GenericNew((PyTypeObject + *)state->NotEq_type, NULL, NULL); + if (!state->NotEq_singleton) return 0; + state->Lt_type = make_type(state, "Lt", state->cmpop_type, NULL, 0, + "Lt"); + if (!state->Lt_type) return 0; + state->Lt_singleton = PyType_GenericNew((PyTypeObject *)state->Lt_type, + NULL, NULL); + if (!state->Lt_singleton) return 0; + state->LtE_type = make_type(state, "LtE", state->cmpop_type, NULL, 0, + "LtE"); + if (!state->LtE_type) return 0; + state->LtE_singleton = PyType_GenericNew((PyTypeObject *)state->LtE_type, + NULL, NULL); + if (!state->LtE_singleton) return 0; + state->Gt_type = make_type(state, "Gt", state->cmpop_type, NULL, 0, + "Gt"); + if (!state->Gt_type) return 0; + state->Gt_singleton = PyType_GenericNew((PyTypeObject *)state->Gt_type, + NULL, NULL); + if (!state->Gt_singleton) return 0; + state->GtE_type = make_type(state, "GtE", state->cmpop_type, NULL, 0, + "GtE"); + if (!state->GtE_type) return 0; + state->GtE_singleton = PyType_GenericNew((PyTypeObject *)state->GtE_type, + NULL, NULL); + if (!state->GtE_singleton) return 0; + state->Is_type = make_type(state, "Is", state->cmpop_type, NULL, 0, + "Is"); + if (!state->Is_type) return 0; + state->Is_singleton = PyType_GenericNew((PyTypeObject *)state->Is_type, + NULL, NULL); + if (!state->Is_singleton) return 0; + state->IsNot_type = make_type(state, "IsNot", state->cmpop_type, NULL, 0, + "IsNot"); + if (!state->IsNot_type) return 0; + state->IsNot_singleton = PyType_GenericNew((PyTypeObject + *)state->IsNot_type, NULL, NULL); + if (!state->IsNot_singleton) return 0; + state->In_type = make_type(state, "In", state->cmpop_type, NULL, 0, + "In"); + if (!state->In_type) return 0; + state->In_singleton = PyType_GenericNew((PyTypeObject *)state->In_type, + NULL, NULL); + if (!state->In_singleton) return 0; + state->NotIn_type = make_type(state, "NotIn", state->cmpop_type, NULL, 0, + "NotIn"); + if (!state->NotIn_type) return 0; + state->NotIn_singleton = PyType_GenericNew((PyTypeObject + *)state->NotIn_type, NULL, NULL); + if (!state->NotIn_singleton) return 0; + state->comprehension_type = make_type(state, "comprehension", + state->AST_type, + comprehension_fields, 4, + "comprehension(expr target, expr iter, expr* ifs, int is_async)"); + if (!state->comprehension_type) return 0; + if (!add_attributes(state, state->comprehension_type, NULL, 0)) return 0; + state->excepthandler_type = make_type(state, "excepthandler", + state->AST_type, NULL, 0, + "excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)"); + if (!state->excepthandler_type) return 0; + if (!add_attributes(state, state->excepthandler_type, + excepthandler_attributes, 4)) return 0; + if (PyObject_SetAttr(state->excepthandler_type, state->end_lineno, Py_None) + == -1) + return 0; + if (PyObject_SetAttr(state->excepthandler_type, state->end_col_offset, + Py_None) == -1) + return 0; + state->ExceptHandler_type = make_type(state, "ExceptHandler", + state->excepthandler_type, + ExceptHandler_fields, 3, + "ExceptHandler(expr? type, identifier? name, stmt* body)"); + if (!state->ExceptHandler_type) return 0; + if (PyObject_SetAttr(state->ExceptHandler_type, state->type, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->ExceptHandler_type, state->name, Py_None) == -1) + return 0; + state->arguments_type = make_type(state, "arguments", state->AST_type, + arguments_fields, 7, + "arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)"); + if (!state->arguments_type) return 0; + if (!add_attributes(state, state->arguments_type, NULL, 0)) return 0; + if (PyObject_SetAttr(state->arguments_type, state->vararg, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->arguments_type, state->kwarg, Py_None) == -1) + return 0; + state->arg_type = make_type(state, "arg", state->AST_type, arg_fields, 3, + "arg(identifier arg, expr? annotation, string? type_comment)"); + if (!state->arg_type) return 0; + if (!add_attributes(state, state->arg_type, arg_attributes, 4)) return 0; + if (PyObject_SetAttr(state->arg_type, state->annotation, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->arg_type, state->type_comment, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->arg_type, state->end_lineno, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->arg_type, state->end_col_offset, Py_None) == -1) + return 0; + state->keyword_type = make_type(state, "keyword", state->AST_type, + keyword_fields, 2, + "keyword(identifier? arg, expr value)"); + if (!state->keyword_type) return 0; + if (!add_attributes(state, state->keyword_type, keyword_attributes, 4)) + return 0; + if (PyObject_SetAttr(state->keyword_type, state->arg, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->keyword_type, state->end_lineno, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->keyword_type, state->end_col_offset, Py_None) + == -1) + return 0; + state->alias_type = make_type(state, "alias", state->AST_type, + alias_fields, 2, + "alias(identifier name, identifier? asname)"); + if (!state->alias_type) return 0; + if (!add_attributes(state, state->alias_type, NULL, 0)) return 0; + if (PyObject_SetAttr(state->alias_type, state->asname, Py_None) == -1) + return 0; + state->withitem_type = make_type(state, "withitem", state->AST_type, + withitem_fields, 2, + "withitem(expr context_expr, expr? optional_vars)"); + if (!state->withitem_type) return 0; + if (!add_attributes(state, state->withitem_type, NULL, 0)) return 0; + if (PyObject_SetAttr(state->withitem_type, state->optional_vars, Py_None) + == -1) + return 0; + state->type_ignore_type = make_type(state, "type_ignore", state->AST_type, + NULL, 0, + "type_ignore = TypeIgnore(int lineno, string tag)"); + if (!state->type_ignore_type) return 0; + if (!add_attributes(state, state->type_ignore_type, NULL, 0)) return 0; + state->TypeIgnore_type = make_type(state, "TypeIgnore", + state->type_ignore_type, + TypeIgnore_fields, 2, + "TypeIgnore(int lineno, string tag)"); + if (!state->TypeIgnore_type) return 0; + state->initialized = 1; return 1; } -static int obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, - PyArena* arena); -static int obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, - PyArena* arena); -static int obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, - PyArena* arena); -static int obj2ast_expr_context(astmodulestate *state, PyObject* obj, - expr_context_ty* out, PyArena* arena); -static int obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, - PyArena* arena); -static int obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* - out, PyArena* arena); -static int obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* - out, PyArena* arena); -static int obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, - PyArena* arena); -static int obj2ast_comprehension(astmodulestate *state, PyObject* obj, - comprehension_ty* out, PyArena* arena); -static int obj2ast_excepthandler(astmodulestate *state, PyObject* obj, - excepthandler_ty* out, PyArena* arena); -static int obj2ast_arguments(astmodulestate *state, PyObject* obj, - arguments_ty* out, PyArena* arena); -static int obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, - PyArena* arena); -static int obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* - out, PyArena* arena); -static int obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, - PyArena* arena); -static int obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* - out, PyArena* arena); -static int obj2ast_type_ignore(astmodulestate *state, PyObject* obj, - type_ignore_ty* out, PyArena* arena); +static int obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, + PyArena* arena); +static int obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, + PyArena* arena); +static int obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, + PyArena* arena); +static int obj2ast_expr_context(astmodulestate *state, PyObject* obj, + expr_context_ty* out, PyArena* arena); +static int obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, + PyArena* arena); +static int obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* + out, PyArena* arena); +static int obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* + out, PyArena* arena); +static int obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, + PyArena* arena); +static int obj2ast_comprehension(astmodulestate *state, PyObject* obj, + comprehension_ty* out, PyArena* arena); +static int obj2ast_excepthandler(astmodulestate *state, PyObject* obj, + excepthandler_ty* out, PyArena* arena); +static int obj2ast_arguments(astmodulestate *state, PyObject* obj, + arguments_ty* out, PyArena* arena); +static int obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, + PyArena* arena); +static int obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* + out, PyArena* arena); +static int obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, + PyArena* arena); +static int obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* + out, PyArena* arena); +static int obj2ast_type_ignore(astmodulestate *state, PyObject* obj, + type_ignore_ty* out, PyArena* arena); mod_ty -Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena) +Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena) { mod_ty p; p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -1920,7 +1920,7 @@ Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena) return NULL; p->kind = Module_kind; p->v.Module.body = body; - p->v.Module.type_ignores = type_ignores; + p->v.Module.type_ignores = type_ignores; return p; } @@ -1942,7 +1942,7 @@ Expression(expr_ty body, PyArena *arena) mod_ty p; if (!body) { PyErr_SetString(PyExc_ValueError, - "field 'body' is required for Expression"); + "field 'body' is required for Expression"); return NULL; } p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -1954,37 +1954,37 @@ Expression(expr_ty body, PyArena *arena) } mod_ty -FunctionType(asdl_seq * argtypes, expr_ty returns, PyArena *arena) -{ - mod_ty p; - if (!returns) { - PyErr_SetString(PyExc_ValueError, - "field 'returns' is required for FunctionType"); - return NULL; - } - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); - if (!p) - return NULL; - p->kind = FunctionType_kind; - p->v.FunctionType.argtypes = argtypes; - p->v.FunctionType.returns = returns; - return p; -} - +FunctionType(asdl_seq * argtypes, expr_ty returns, PyArena *arena) +{ + mod_ty p; + if (!returns) { + PyErr_SetString(PyExc_ValueError, + "field 'returns' is required for FunctionType"); + return NULL; + } + p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + if (!p) + return NULL; + p->kind = FunctionType_kind; + p->v.FunctionType.argtypes = argtypes; + p->v.FunctionType.returns = returns; + return p; +} + stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * - decorator_list, expr_ty returns, string type_comment, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) + decorator_list, expr_ty returns, string type_comment, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!name) { PyErr_SetString(PyExc_ValueError, - "field 'name' is required for FunctionDef"); + "field 'name' is required for FunctionDef"); return NULL; } if (!args) { PyErr_SetString(PyExc_ValueError, - "field 'args' is required for FunctionDef"); + "field 'args' is required for FunctionDef"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -1996,29 +1996,29 @@ FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * p->v.FunctionDef.body = body; p->v.FunctionDef.decorator_list = decorator_list; p->v.FunctionDef.returns = returns; - p->v.FunctionDef.type_comment = type_comment; + p->v.FunctionDef.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq - * decorator_list, expr_ty returns, string type_comment, int - lineno, int col_offset, int end_lineno, int end_col_offset, + * decorator_list, expr_ty returns, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!name) { PyErr_SetString(PyExc_ValueError, - "field 'name' is required for AsyncFunctionDef"); + "field 'name' is required for AsyncFunctionDef"); return NULL; } if (!args) { PyErr_SetString(PyExc_ValueError, - "field 'args' is required for AsyncFunctionDef"); + "field 'args' is required for AsyncFunctionDef"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2030,23 +2030,23 @@ AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq p->v.AsyncFunctionDef.body = body; p->v.AsyncFunctionDef.decorator_list = decorator_list; p->v.AsyncFunctionDef.returns = returns; - p->v.AsyncFunctionDef.type_comment = type_comment; + p->v.AsyncFunctionDef.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, asdl_seq * - body, asdl_seq * decorator_list, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) + body, asdl_seq * decorator_list, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!name) { PyErr_SetString(PyExc_ValueError, - "field 'name' is required for ClassDef"); + "field 'name' is required for ClassDef"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2060,14 +2060,14 @@ ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, asdl_seq * p->v.ClassDef.decorator_list = decorator_list; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Return(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Return(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2077,14 +2077,14 @@ Return(expr_ty value, int lineno, int col_offset, int end_lineno, int p->v.Return.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Delete(asdl_seq * targets, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Delete(asdl_seq * targets, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2094,19 +2094,19 @@ Delete(asdl_seq * targets, int lineno, int col_offset, int end_lineno, int p->v.Delete.targets = targets; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Assign(asdl_seq * targets, expr_ty value, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +Assign(asdl_seq * targets, expr_ty value, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Assign"); + "field 'value' is required for Assign"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2115,32 +2115,32 @@ Assign(asdl_seq * targets, expr_ty value, string type_comment, int lineno, int p->kind = Assign_kind; p->v.Assign.targets = targets; p->v.Assign.value = value; - p->v.Assign.type_comment = type_comment; + p->v.Assign.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { PyErr_SetString(PyExc_ValueError, - "field 'target' is required for AugAssign"); + "field 'target' is required for AugAssign"); return NULL; } if (!op) { PyErr_SetString(PyExc_ValueError, - "field 'op' is required for AugAssign"); + "field 'op' is required for AugAssign"); return NULL; } if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for AugAssign"); + "field 'value' is required for AugAssign"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2152,25 +2152,25 @@ AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int p->v.AugAssign.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) + lineno, int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { stmt_ty p; if (!target) { PyErr_SetString(PyExc_ValueError, - "field 'target' is required for AnnAssign"); + "field 'target' is required for AnnAssign"); return NULL; } if (!annotation) { PyErr_SetString(PyExc_ValueError, - "field 'annotation' is required for AnnAssign"); + "field 'annotation' is required for AnnAssign"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2183,25 +2183,25 @@ AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, int p->v.AnnAssign.simple = simple; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, string - type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, string + type_comment, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { PyErr_SetString(PyExc_ValueError, - "field 'target' is required for For"); + "field 'target' is required for For"); return NULL; } if (!iter) { PyErr_SetString(PyExc_ValueError, - "field 'iter' is required for For"); + "field 'iter' is required for For"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2212,28 +2212,28 @@ For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, string p->v.For.iter = iter; p->v.For.body = body; p->v.For.orelse = orelse; - p->v.For.type_comment = type_comment; + p->v.For.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, - string type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, + string type_comment, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { PyErr_SetString(PyExc_ValueError, - "field 'target' is required for AsyncFor"); + "field 'target' is required for AsyncFor"); return NULL; } if (!iter) { PyErr_SetString(PyExc_ValueError, - "field 'iter' is required for AsyncFor"); + "field 'iter' is required for AsyncFor"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2244,22 +2244,22 @@ AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, p->v.AsyncFor.iter = iter; p->v.AsyncFor.body = body; p->v.AsyncFor.orelse = orelse; - p->v.AsyncFor.type_comment = type_comment; + p->v.AsyncFor.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!test) { PyErr_SetString(PyExc_ValueError, - "field 'test' is required for While"); + "field 'test' is required for While"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2271,19 +2271,19 @@ While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int p->v.While.orelse = orelse; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!test) { PyErr_SetString(PyExc_ValueError, - "field 'test' is required for If"); + "field 'test' is required for If"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2295,14 +2295,14 @@ If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int p->v.If.orelse = orelse; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -With(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +With(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2311,17 +2311,17 @@ With(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, int p->kind = With_kind; p->v.With.items = items; p->v.With.body = body; - p->v.With.type_comment = type_comment; + p->v.With.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -AsyncWith(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +AsyncWith(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2330,17 +2330,17 @@ AsyncWith(asdl_seq * items, asdl_seq * body, string type_comment, int lineno, p->kind = AsyncWith_kind; p->v.AsyncWith.items = items; p->v.AsyncWith.body = body; - p->v.AsyncWith.type_comment = type_comment; + p->v.AsyncWith.type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2351,15 +2351,15 @@ Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int end_lineno, p->v.Raise.cause = cause; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty Try(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, asdl_seq * - finalbody, int lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena) + finalbody, int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2372,19 +2372,19 @@ Try(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, asdl_seq * p->v.Try.finalbody = finalbody; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena) { stmt_ty p; if (!test) { PyErr_SetString(PyExc_ValueError, - "field 'test' is required for Assert"); + "field 'test' is required for Assert"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2395,14 +2395,14 @@ Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int end_lineno, p->v.Assert.msg = msg; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Import(asdl_seq * names, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Import(asdl_seq * names, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2412,14 +2412,14 @@ Import(asdl_seq * names, int lineno, int col_offset, int end_lineno, int p->v.Import.names = names; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty ImportFrom(identifier module, asdl_seq * names, int level, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2431,14 +2431,14 @@ ImportFrom(identifier module, asdl_seq * names, int level, int lineno, int p->v.ImportFrom.level = level; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Global(asdl_seq * names, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Global(asdl_seq * names, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2448,14 +2448,14 @@ Global(asdl_seq * names, int lineno, int col_offset, int end_lineno, int p->v.Global.names = names; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Nonlocal(asdl_seq * names, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Nonlocal(asdl_seq * names, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2465,19 +2465,19 @@ Nonlocal(asdl_seq * names, int lineno, int col_offset, int end_lineno, int p->v.Nonlocal.names = names; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Expr"); + "field 'value' is required for Expr"); return NULL; } p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2487,14 +2487,14 @@ Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int p->v.Expr.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2503,14 +2503,14 @@ Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena p->kind = Pass_kind; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Break(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +Break(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2519,14 +2519,14 @@ Break(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena p->kind = Break_kind; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } stmt_ty -Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena) +Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2535,19 +2535,19 @@ Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, p->kind = Continue_kind; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!op) { PyErr_SetString(PyExc_ValueError, - "field 'op' is required for BoolOp"); + "field 'op' is required for BoolOp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2558,57 +2558,57 @@ BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, int p->v.BoolOp.values = values; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; + return p; +} + +expr_ty +NamedExpr(expr_ty target, expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) +{ + expr_ty p; + if (!target) { + PyErr_SetString(PyExc_ValueError, + "field 'target' is required for NamedExpr"); + return NULL; + } + if (!value) { + PyErr_SetString(PyExc_ValueError, + "field 'value' is required for NamedExpr"); + return NULL; + } + p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + if (!p) + return NULL; + p->kind = NamedExpr_kind; + p->v.NamedExpr.target = target; + p->v.NamedExpr.value = value; + p->lineno = lineno; + p->col_offset = col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -NamedExpr(expr_ty target, expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) -{ - expr_ty p; - if (!target) { - PyErr_SetString(PyExc_ValueError, - "field 'target' is required for NamedExpr"); - return NULL; - } - if (!value) { - PyErr_SetString(PyExc_ValueError, - "field 'value' is required for NamedExpr"); - return NULL; - } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); - if (!p) - return NULL; - p->kind = NamedExpr_kind; - p->v.NamedExpr.target = target; - p->v.NamedExpr.value = value; - p->lineno = lineno; - p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; - return p; -} - -expr_ty BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!left) { PyErr_SetString(PyExc_ValueError, - "field 'left' is required for BinOp"); + "field 'left' is required for BinOp"); return NULL; } if (!op) { PyErr_SetString(PyExc_ValueError, - "field 'op' is required for BinOp"); + "field 'op' is required for BinOp"); return NULL; } if (!right) { PyErr_SetString(PyExc_ValueError, - "field 'right' is required for BinOp"); + "field 'right' is required for BinOp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2620,24 +2620,24 @@ BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int col_offset, p->v.BinOp.right = right; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!op) { PyErr_SetString(PyExc_ValueError, - "field 'op' is required for UnaryOp"); + "field 'op' is required for UnaryOp"); return NULL; } if (!operand) { PyErr_SetString(PyExc_ValueError, - "field 'operand' is required for UnaryOp"); + "field 'operand' is required for UnaryOp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2648,24 +2648,24 @@ UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int p->v.UnaryOp.operand = operand; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!args) { PyErr_SetString(PyExc_ValueError, - "field 'args' is required for Lambda"); + "field 'args' is required for Lambda"); return NULL; } if (!body) { PyErr_SetString(PyExc_ValueError, - "field 'body' is required for Lambda"); + "field 'body' is required for Lambda"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2676,29 +2676,29 @@ Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int p->v.Lambda.body = body; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!test) { PyErr_SetString(PyExc_ValueError, - "field 'test' is required for IfExp"); + "field 'test' is required for IfExp"); return NULL; } if (!body) { PyErr_SetString(PyExc_ValueError, - "field 'body' is required for IfExp"); + "field 'body' is required for IfExp"); return NULL; } if (!orelse) { PyErr_SetString(PyExc_ValueError, - "field 'orelse' is required for IfExp"); + "field 'orelse' is required for IfExp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2710,14 +2710,14 @@ IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, p->v.IfExp.orelse = orelse; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2728,14 +2728,14 @@ Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, int p->v.Dict.values = values; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Set(asdl_seq * elts, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Set(asdl_seq * elts, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2745,19 +2745,19 @@ Set(asdl_seq * elts, int lineno, int col_offset, int end_lineno, int p->v.Set.elts = elts; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!elt) { PyErr_SetString(PyExc_ValueError, - "field 'elt' is required for ListComp"); + "field 'elt' is required for ListComp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2768,19 +2768,19 @@ ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int p->v.ListComp.generators = generators; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -SetComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +SetComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!elt) { PyErr_SetString(PyExc_ValueError, - "field 'elt' is required for SetComp"); + "field 'elt' is required for SetComp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2791,24 +2791,24 @@ SetComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, int p->v.SetComp.generators = generators; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!key) { PyErr_SetString(PyExc_ValueError, - "field 'key' is required for DictComp"); + "field 'key' is required for DictComp"); return NULL; } if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for DictComp"); + "field 'value' is required for DictComp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2820,19 +2820,19 @@ DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int lineno, int p->v.DictComp.generators = generators; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!elt) { PyErr_SetString(PyExc_ValueError, - "field 'elt' is required for GeneratorExp"); + "field 'elt' is required for GeneratorExp"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2843,19 +2843,19 @@ GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, p->v.GeneratorExp.generators = generators; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Await(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Await(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Await"); + "field 'value' is required for Await"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2865,14 +2865,14 @@ Await(expr_ty value, int lineno, int col_offset, int end_lineno, int p->v.Await.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2882,19 +2882,19 @@ Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int p->v.Yield.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for YieldFrom"); + "field 'value' is required for YieldFrom"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2904,19 +2904,19 @@ YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int p->v.YieldFrom.value = value; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) + int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!left) { PyErr_SetString(PyExc_ValueError, - "field 'left' is required for Compare"); + "field 'left' is required for Compare"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2928,19 +2928,19 @@ Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, int lineno, p->v.Compare.comparators = comparators; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!func) { PyErr_SetString(PyExc_ValueError, - "field 'func' is required for Call"); + "field 'func' is required for Call"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2952,20 +2952,20 @@ Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int lineno, int p->v.Call.keywords = keywords; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for FormattedValue"); + "field 'value' is required for FormattedValue"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2977,14 +2977,14 @@ FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int lineno, p->v.FormattedValue.format_spec = format_spec; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -JoinedStr(asdl_seq * values, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +JoinedStr(asdl_seq * values, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -2994,19 +2994,19 @@ JoinedStr(asdl_seq * values, int lineno, int col_offset, int end_lineno, int p->v.JoinedStr.values = values; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Constant(constant value, string kind, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Constant(constant value, string kind, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Constant"); + "field 'value' is required for Constant"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3014,32 +3014,32 @@ Constant(constant value, string kind, int lineno, int col_offset, int return NULL; p->kind = Constant_kind; p->v.Constant.value = value; - p->v.Constant.kind = kind; + p->v.Constant.kind = kind; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Attribute"); + "field 'value' is required for Attribute"); return NULL; } if (!attr) { PyErr_SetString(PyExc_ValueError, - "field 'attr' is required for Attribute"); + "field 'attr' is required for Attribute"); return NULL; } if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for Attribute"); + "field 'ctx' is required for Attribute"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3051,29 +3051,29 @@ Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno, int p->v.Attribute.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Subscript"); + "field 'value' is required for Subscript"); return NULL; } if (!slice) { PyErr_SetString(PyExc_ValueError, - "field 'slice' is required for Subscript"); + "field 'slice' is required for Subscript"); return NULL; } if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for Subscript"); + "field 'ctx' is required for Subscript"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3085,24 +3085,24 @@ Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, int p->v.Subscript.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for Starred"); + "field 'value' is required for Starred"); return NULL; } if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for Starred"); + "field 'ctx' is required for Starred"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3113,24 +3113,24 @@ Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, int p->v.Starred.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!id) { PyErr_SetString(PyExc_ValueError, - "field 'id' is required for Name"); + "field 'id' is required for Name"); return NULL; } if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for Name"); + "field 'ctx' is required for Name"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3141,19 +3141,19 @@ Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int p->v.Name.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -List(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +List(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for List"); + "field 'ctx' is required for List"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3164,19 +3164,19 @@ List(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int p->v.List.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } expr_ty -Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!ctx) { PyErr_SetString(PyExc_ValueError, - "field 'ctx' is required for Tuple"); + "field 'ctx' is required for Tuple"); return NULL; } p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3187,27 +3187,27 @@ Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int p->v.Tuple.ctx = ctx; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } -expr_ty -Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +expr_ty +Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena) { - expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + expr_ty p; + p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Slice_kind; p->v.Slice.lower = lower; p->v.Slice.upper = upper; p->v.Slice.step = step; - p->lineno = lineno; - p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->lineno = lineno; + p->col_offset = col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } @@ -3218,12 +3218,12 @@ comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, int is_async, comprehension_ty p; if (!target) { PyErr_SetString(PyExc_ValueError, - "field 'target' is required for comprehension"); + "field 'target' is required for comprehension"); return NULL; } if (!iter) { PyErr_SetString(PyExc_ValueError, - "field 'iter' is required for comprehension"); + "field 'iter' is required for comprehension"); return NULL; } p = (comprehension_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3238,7 +3238,7 @@ comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, int is_async, excepthandler_ty ExceptHandler(expr_ty type, identifier name, asdl_seq * body, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { excepthandler_ty p; p = (excepthandler_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3250,21 +3250,21 @@ ExceptHandler(expr_ty type, identifier name, asdl_seq * body, int lineno, int p->v.ExceptHandler.body = body; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } arguments_ty -arguments(asdl_seq * posonlyargs, asdl_seq * args, arg_ty vararg, asdl_seq * - kwonlyargs, asdl_seq * kw_defaults, arg_ty kwarg, asdl_seq * - defaults, PyArena *arena) +arguments(asdl_seq * posonlyargs, asdl_seq * args, arg_ty vararg, asdl_seq * + kwonlyargs, asdl_seq * kw_defaults, arg_ty kwarg, asdl_seq * + defaults, PyArena *arena) { arguments_ty p; p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; - p->posonlyargs = posonlyargs; + p->posonlyargs = posonlyargs; p->args = args; p->vararg = vararg; p->kwonlyargs = kwonlyargs; @@ -3275,13 +3275,13 @@ arguments(asdl_seq * posonlyargs, asdl_seq * args, arg_ty vararg, asdl_seq * } arg_ty -arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { arg_ty p; if (!arg) { PyErr_SetString(PyExc_ValueError, - "field 'arg' is required for arg"); + "field 'arg' is required for arg"); return NULL; } p = (arg_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3289,22 +3289,22 @@ arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int return NULL; p->arg = arg; p->annotation = annotation; - p->type_comment = type_comment; + p->type_comment = type_comment; p->lineno = lineno; p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } keyword_ty -keyword(identifier arg, expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +keyword(identifier arg, expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { keyword_ty p; if (!value) { PyErr_SetString(PyExc_ValueError, - "field 'value' is required for keyword"); + "field 'value' is required for keyword"); return NULL; } p = (keyword_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3312,10 +3312,10 @@ keyword(identifier arg, expr_ty value, int lineno, int col_offset, int return NULL; p->arg = arg; p->value = value; - p->lineno = lineno; - p->col_offset = col_offset; - p->end_lineno = end_lineno; - p->end_col_offset = end_col_offset; + p->lineno = lineno; + p->col_offset = col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } @@ -3325,7 +3325,7 @@ alias(identifier name, identifier asname, PyArena *arena) alias_ty p; if (!name) { PyErr_SetString(PyExc_ValueError, - "field 'name' is required for alias"); + "field 'name' is required for alias"); return NULL; } p = (alias_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3342,7 +3342,7 @@ withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena) withitem_ty p; if (!context_expr) { PyErr_SetString(PyExc_ValueError, - "field 'context_expr' is required for withitem"); + "field 'context_expr' is required for withitem"); return NULL; } p = (withitem_ty)PyArena_Malloc(arena, sizeof(*p)); @@ -3353,86 +3353,86 @@ withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena) return p; } -type_ignore_ty -TypeIgnore(int lineno, string tag, PyArena *arena) -{ - type_ignore_ty p; - if (!tag) { - PyErr_SetString(PyExc_ValueError, - "field 'tag' is required for TypeIgnore"); - return NULL; - } - p = (type_ignore_ty)PyArena_Malloc(arena, sizeof(*p)); - if (!p) - return NULL; - p->kind = TypeIgnore_kind; - p->v.TypeIgnore.lineno = lineno; - p->v.TypeIgnore.tag = tag; - return p; -} - - +type_ignore_ty +TypeIgnore(int lineno, string tag, PyArena *arena) +{ + type_ignore_ty p; + if (!tag) { + PyErr_SetString(PyExc_ValueError, + "field 'tag' is required for TypeIgnore"); + return NULL; + } + p = (type_ignore_ty)PyArena_Malloc(arena, sizeof(*p)); + if (!p) + return NULL; + p->kind = TypeIgnore_kind; + p->v.TypeIgnore.lineno = lineno; + p->v.TypeIgnore.tag = tag; + return p; +} + + PyObject* -ast2obj_mod(astmodulestate *state, void* _o) +ast2obj_mod(astmodulestate *state, void* _o) { mod_ty o = (mod_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } switch (o->kind) { case Module_kind: - tp = (PyTypeObject *)state->Module_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Module_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Module.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Module.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_list(state, o->v.Module.type_ignores, + ast2obj_type_ignore); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->type_ignores, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Module.type_ignores, - ast2obj_type_ignore); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_ignores, value) == -1) - goto failed; - Py_DECREF(value); break; case Interactive_kind: - tp = (PyTypeObject *)state->Interactive_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Interactive_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Interactive.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Interactive.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; case Expression_kind: - tp = (PyTypeObject *)state->Expression_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Expression.body); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->body, value) == -1) + goto failed; + Py_DECREF(value); + break; + case FunctionType_kind: + tp = (PyTypeObject *)state->FunctionType_type; + result = PyType_GenericNew(tp, NULL, NULL); + if (!result) goto failed; + value = ast2obj_list(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); break; - case FunctionType_kind: - tp = (PyTypeObject *)state->FunctionType_type; - result = PyType_GenericNew(tp, NULL, NULL); - if (!result) goto failed; - value = ast2obj_list(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->returns, value) == -1) - goto failed; - Py_DECREF(value); - break; } return result; failed: @@ -3442,493 +3442,493 @@ failed: } PyObject* -ast2obj_stmt(astmodulestate *state, void* _o) +ast2obj_stmt(astmodulestate *state, void* _o) { stmt_ty o = (stmt_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } switch (o->kind) { case FunctionDef_kind: - tp = (PyTypeObject *)state->FunctionDef_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.FunctionDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, state->name, value) == -1) + 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, o->v.FunctionDef.args); if (!value) goto failed; - if (PyObject_SetAttr(result, state->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.FunctionDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.FunctionDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.FunctionDef.decorator_list, - ast2obj_expr); + value = ast2obj_list(state, o->v.FunctionDef.decorator_list, + ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->decorator_list, value) == -1) + 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, o->v.FunctionDef.returns); if (!value) goto failed; - if (PyObject_SetAttr(result, state->returns, value) == -1) + if (PyObject_SetAttr(result, state->returns, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, o->v.FunctionDef.type_comment); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.FunctionDef.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case AsyncFunctionDef_kind: - tp = (PyTypeObject *)state->AsyncFunctionDef_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.AsyncFunctionDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, state->name, value) == -1) + 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, o->v.AsyncFunctionDef.args); if (!value) goto failed; - if (PyObject_SetAttr(result, state->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.AsyncFunctionDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncFunctionDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.AsyncFunctionDef.decorator_list, + value = ast2obj_list(state, o->v.AsyncFunctionDef.decorator_list, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->decorator_list, value) == -1) + if (PyObject_SetAttr(result, state->decorator_list, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_expr(state, o->v.AsyncFunctionDef.returns); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AsyncFunctionDef.returns); + value = ast2obj_string(state, o->v.AsyncFunctionDef.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, state->returns, value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncFunctionDef.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case ClassDef_kind: - tp = (PyTypeObject *)state->ClassDef_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.ClassDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, state->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ClassDef.bases, ast2obj_expr); + value = ast2obj_list(state, o->v.ClassDef.bases, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->bases, value) == -1) + if (PyObject_SetAttr(result, state->bases, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ClassDef.keywords, ast2obj_keyword); + value = ast2obj_list(state, o->v.ClassDef.keywords, ast2obj_keyword); if (!value) goto failed; - if (PyObject_SetAttr(result, state->keywords, value) == -1) + if (PyObject_SetAttr(result, state->keywords, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ClassDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.ClassDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ClassDef.decorator_list, ast2obj_expr); + value = ast2obj_list(state, o->v.ClassDef.decorator_list, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->decorator_list, value) == -1) + if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); break; case Return_kind: - tp = (PyTypeObject *)state->Return_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Return.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Delete_kind: - tp = (PyTypeObject *)state->Delete_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Delete_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Delete.targets, ast2obj_expr); + value = ast2obj_list(state, o->v.Delete.targets, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->targets, value) == -1) + if (PyObject_SetAttr(result, state->targets, value) == -1) goto failed; Py_DECREF(value); break; case Assign_kind: - tp = (PyTypeObject *)state->Assign_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Assign_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Assign.targets, ast2obj_expr); + value = ast2obj_list(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->targets, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.Assign.value); + value = ast2obj_string(state, o->v.Assign.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.Assign.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case AugAssign_kind: - tp = (PyTypeObject *)state->AugAssign_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.AugAssign.target); if (!value) goto failed; - if (PyObject_SetAttr(result, state->target, value) == -1) + 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, o->v.AugAssign.op); if (!value) goto failed; - if (PyObject_SetAttr(result, state->op, value) == -1) + 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, o->v.AugAssign.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case AnnAssign_kind: - tp = (PyTypeObject *)state->AnnAssign_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.AnnAssign.target); if (!value) goto failed; - if (PyObject_SetAttr(result, state->target, value) == -1) + 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, o->v.AnnAssign.annotation); if (!value) goto failed; - if (PyObject_SetAttr(result, state->annotation, value) == -1) + 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, o->v.AnnAssign.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + 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, o->v.AnnAssign.simple); if (!value) goto failed; - if (PyObject_SetAttr(result, state->simple, value) == -1) + if (PyObject_SetAttr(result, state->simple, value) == -1) goto failed; Py_DECREF(value); break; case For_kind: - tp = (PyTypeObject *)state->For_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.For.target); if (!value) goto failed; - if (PyObject_SetAttr(result, state->target, value) == -1) + 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, o->v.For.iter); if (!value) goto failed; - if (PyObject_SetAttr(result, state->iter, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.For.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.For.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.For.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.For.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, o->v.For.type_comment); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.For.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case AsyncFor_kind: - tp = (PyTypeObject *)state->AsyncFor_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->target, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->v.AsyncFor.iter); + value = ast2obj_list(state, o->v.AsyncFor.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->iter, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.AsyncFor.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncFor.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.AsyncFor.orelse, ast2obj_stmt); + value = ast2obj_string(state, o->v.AsyncFor.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncFor.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case While_kind: - tp = (PyTypeObject *)state->While_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.While.test); if (!value) goto failed; - if (PyObject_SetAttr(result, state->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.While.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.While.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.While.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.While.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case If_kind: - tp = (PyTypeObject *)state->If_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.If.test); if (!value) goto failed; - if (PyObject_SetAttr(result, state->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.If.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.If.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.If.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.If.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case With_kind: - tp = (PyTypeObject *)state->With_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->With_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.With.items, ast2obj_withitem); + value = ast2obj_list(state, o->v.With.items, ast2obj_withitem); if (!value) goto failed; - if (PyObject_SetAttr(result, state->items, value) == -1) + if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.With.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.With.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, o->v.With.type_comment); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.With.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case AsyncWith_kind: - tp = (PyTypeObject *)state->AsyncWith_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->AsyncWith_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.AsyncWith.items, ast2obj_withitem); + value = ast2obj_list(state, o->v.AsyncWith.items, ast2obj_withitem); if (!value) goto failed; - if (PyObject_SetAttr(result, state->items, value) == -1) + if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.AsyncWith.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncWith.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, o->v.AsyncWith.type_comment); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.AsyncWith.type_comment); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->type_comment, value) == -1) - goto failed; - Py_DECREF(value); break; case Raise_kind: - tp = (PyTypeObject *)state->Raise_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Raise.exc); if (!value) goto failed; - if (PyObject_SetAttr(result, state->exc, value) == -1) + 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, o->v.Raise.cause); if (!value) goto failed; - if (PyObject_SetAttr(result, state->cause, value) == -1) + if (PyObject_SetAttr(result, state->cause, value) == -1) goto failed; Py_DECREF(value); break; case Try_kind: - tp = (PyTypeObject *)state->Try_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Try_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Try.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Try.handlers, ast2obj_excepthandler); + value = ast2obj_list(state, o->v.Try.handlers, ast2obj_excepthandler); if (!value) goto failed; - if (PyObject_SetAttr(result, state->handlers, value) == -1) + if (PyObject_SetAttr(result, state->handlers, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Try.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Try.finalbody, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.finalbody, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->finalbody, value) == -1) + if (PyObject_SetAttr(result, state->finalbody, value) == -1) goto failed; Py_DECREF(value); break; case Assert_kind: - tp = (PyTypeObject *)state->Assert_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Assert.test); if (!value) goto failed; - if (PyObject_SetAttr(result, state->test, value) == -1) + 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, o->v.Assert.msg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->msg, value) == -1) + if (PyObject_SetAttr(result, state->msg, value) == -1) goto failed; Py_DECREF(value); break; case Import_kind: - tp = (PyTypeObject *)state->Import_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Import_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Import.names, ast2obj_alias); + value = ast2obj_list(state, o->v.Import.names, ast2obj_alias); if (!value) goto failed; - if (PyObject_SetAttr(result, state->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case ImportFrom_kind: - tp = (PyTypeObject *)state->ImportFrom_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.ImportFrom.module); if (!value) goto failed; - if (PyObject_SetAttr(result, state->module, value) == -1) + if (PyObject_SetAttr(result, state->module, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ImportFrom.names, ast2obj_alias); + value = ast2obj_list(state, o->v.ImportFrom.names, ast2obj_alias); if (!value) goto failed; - if (PyObject_SetAttr(result, state->names, value) == -1) + 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, o->v.ImportFrom.level); if (!value) goto failed; - if (PyObject_SetAttr(result, state->level, value) == -1) + if (PyObject_SetAttr(result, state->level, value) == -1) goto failed; Py_DECREF(value); break; case Global_kind: - tp = (PyTypeObject *)state->Global_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Global_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Global.names, ast2obj_identifier); + value = ast2obj_list(state, o->v.Global.names, ast2obj_identifier); if (!value) goto failed; - if (PyObject_SetAttr(result, state->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case Nonlocal_kind: - tp = (PyTypeObject *)state->Nonlocal_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Nonlocal_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Nonlocal.names, ast2obj_identifier); + value = ast2obj_list(state, o->v.Nonlocal.names, ast2obj_identifier); if (!value) goto failed; - if (PyObject_SetAttr(result, state->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case Expr_kind: - tp = (PyTypeObject *)state->Expr_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Expr.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Pass_kind: - tp = (PyTypeObject *)state->Pass_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Pass_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; case Break_kind: - tp = (PyTypeObject *)state->Break_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Break_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; case Continue_kind: - tp = (PyTypeObject *)state->Continue_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Continue_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->lineno, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, state->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->end_col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) - goto failed; - Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -3937,246 +3937,246 @@ failed: } PyObject* -ast2obj_expr(astmodulestate *state, void* _o) +ast2obj_expr(astmodulestate *state, void* _o) { expr_ty o = (expr_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } switch (o->kind) { case BoolOp_kind: - tp = (PyTypeObject *)state->BoolOp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.BoolOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, state->op, value) == -1) + if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.BoolOp.values, ast2obj_expr); + value = ast2obj_list(state, o->v.BoolOp.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->values, value) == -1) + if (PyObject_SetAttr(result, state->values, value) == -1) + goto failed; + Py_DECREF(value); + break; + case NamedExpr_kind: + tp = (PyTypeObject *)state->NamedExpr_type; + result = PyType_GenericNew(tp, NULL, NULL); + if (!result) goto failed; + value = ast2obj_expr(state, 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); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; - case NamedExpr_kind: - tp = (PyTypeObject *)state->NamedExpr_type; - result = PyType_GenericNew(tp, NULL, NULL); - if (!result) goto failed; - value = ast2obj_expr(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) - goto failed; - Py_DECREF(value); - break; case BinOp_kind: - tp = (PyTypeObject *)state->BinOp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.BinOp.left); if (!value) goto failed; - if (PyObject_SetAttr(result, state->left, value) == -1) + 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, o->v.BinOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, state->op, value) == -1) + 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, o->v.BinOp.right); if (!value) goto failed; - if (PyObject_SetAttr(result, state->right, value) == -1) + if (PyObject_SetAttr(result, state->right, value) == -1) goto failed; Py_DECREF(value); break; case UnaryOp_kind: - tp = (PyTypeObject *)state->UnaryOp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.UnaryOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, state->op, value) == -1) + 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, o->v.UnaryOp.operand); if (!value) goto failed; - if (PyObject_SetAttr(result, state->operand, value) == -1) + if (PyObject_SetAttr(result, state->operand, value) == -1) goto failed; Py_DECREF(value); break; case Lambda_kind: - tp = (PyTypeObject *)state->Lambda_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Lambda.args); if (!value) goto failed; - if (PyObject_SetAttr(result, state->args, value) == -1) + 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, o->v.Lambda.body); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; case IfExp_kind: - tp = (PyTypeObject *)state->IfExp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.IfExp.test); if (!value) goto failed; - if (PyObject_SetAttr(result, state->test, value) == -1) + 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, o->v.IfExp.body); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + 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, o->v.IfExp.orelse); if (!value) goto failed; - if (PyObject_SetAttr(result, state->orelse, value) == -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case Dict_kind: - tp = (PyTypeObject *)state->Dict_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Dict_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Dict.keys, ast2obj_expr); + value = ast2obj_list(state, o->v.Dict.keys, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->keys, value) == -1) + if (PyObject_SetAttr(result, state->keys, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Dict.values, ast2obj_expr); + value = ast2obj_list(state, o->v.Dict.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->values, value) == -1) + if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; Py_DECREF(value); break; case Set_kind: - tp = (PyTypeObject *)state->Set_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Set_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Set.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.Set.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elts, value) == -1) + if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); break; case ListComp_kind: - tp = (PyTypeObject *)state->ListComp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.ListComp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ListComp.generators, - ast2obj_comprehension); + value = ast2obj_list(state, o->v.ListComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, state->generators, value) == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case SetComp_kind: - tp = (PyTypeObject *)state->SetComp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.SetComp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.SetComp.generators, - ast2obj_comprehension); + value = ast2obj_list(state, o->v.SetComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, state->generators, value) == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case DictComp_kind: - tp = (PyTypeObject *)state->DictComp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.DictComp.key); if (!value) goto failed; - if (PyObject_SetAttr(result, state->key, value) == -1) + 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, o->v.DictComp.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.DictComp.generators, - ast2obj_comprehension); + value = ast2obj_list(state, o->v.DictComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, state->generators, value) == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case GeneratorExp_kind: - tp = (PyTypeObject *)state->GeneratorExp_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.GeneratorExp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.GeneratorExp.generators, + value = ast2obj_list(state, o->v.GeneratorExp.generators, ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, state->generators, value) == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case Await_kind: - tp = (PyTypeObject *)state->Await_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Await.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Yield_kind: - tp = (PyTypeObject *)state->Yield_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Yield.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case YieldFrom_kind: - tp = (PyTypeObject *)state->YieldFrom_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.YieldFrom.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Compare_kind: - tp = (PyTypeObject *)state->Compare_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Compare.left); if (!value) goto failed; - if (PyObject_SetAttr(result, state->left, value) == -1) + if (PyObject_SetAttr(result, state->left, value) == -1) goto failed; Py_DECREF(value); { @@ -4184,224 +4184,224 @@ ast2obj_expr(astmodulestate *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, (cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i))); } if (!value) goto failed; - if (PyObject_SetAttr(result, state->ops, value) == -1) + if (PyObject_SetAttr(result, state->ops, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Compare.comparators, ast2obj_expr); + value = ast2obj_list(state, o->v.Compare.comparators, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->comparators, value) == -1) + if (PyObject_SetAttr(result, state->comparators, value) == -1) goto failed; Py_DECREF(value); break; case Call_kind: - tp = (PyTypeObject *)state->Call_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Call.func); if (!value) goto failed; - if (PyObject_SetAttr(result, state->func, value) == -1) + if (PyObject_SetAttr(result, state->func, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Call.args, ast2obj_expr); + value = ast2obj_list(state, o->v.Call.args, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.Call.keywords, ast2obj_keyword); + value = ast2obj_list(state, o->v.Call.keywords, ast2obj_keyword); if (!value) goto failed; - if (PyObject_SetAttr(result, state->keywords, value) == -1) + if (PyObject_SetAttr(result, state->keywords, value) == -1) goto failed; Py_DECREF(value); break; case FormattedValue_kind: - tp = (PyTypeObject *)state->FormattedValue_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.FormattedValue.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + 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, o->v.FormattedValue.conversion); if (!value) goto failed; - if (PyObject_SetAttr(result, state->conversion, value) == -1) + 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, o->v.FormattedValue.format_spec); if (!value) goto failed; - if (PyObject_SetAttr(result, state->format_spec, value) == -1) + if (PyObject_SetAttr(result, state->format_spec, value) == -1) goto failed; Py_DECREF(value); break; case JoinedStr_kind: - tp = (PyTypeObject *)state->JoinedStr_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->JoinedStr_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.JoinedStr.values, ast2obj_expr); + value = ast2obj_list(state, o->v.JoinedStr.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->values, value) == -1) + if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; Py_DECREF(value); break; case Constant_kind: - tp = (PyTypeObject *)state->Constant_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Constant.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, o->v.Constant.kind); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->kind, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(state, o->v.Constant.kind); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->kind, value) == -1) - goto failed; - Py_DECREF(value); break; case Attribute_kind: - tp = (PyTypeObject *)state->Attribute_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Attribute.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + 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, o->v.Attribute.attr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->attr, value) == -1) + 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, o->v.Attribute.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Subscript_kind: - tp = (PyTypeObject *)state->Subscript_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Subscript.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + 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, o->v.Subscript.slice); if (!value) goto failed; - if (PyObject_SetAttr(result, state->slice, value) == -1) + 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, o->v.Subscript.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Starred_kind: - tp = (PyTypeObject *)state->Starred_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Starred.value); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + 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, o->v.Starred.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Name_kind: - tp = (PyTypeObject *)state->Name_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.Name.id); if (!value) goto failed; - if (PyObject_SetAttr(result, state->id, value) == -1) + 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, o->v.Name.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case List_kind: - tp = (PyTypeObject *)state->List_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->List_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.List.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.List.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elts, value) == -1) + 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, o->v.List.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Tuple_kind: - tp = (PyTypeObject *)state->Tuple_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->Tuple_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(state, o->v.Tuple.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.Tuple.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->elts, value) == -1) + 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, o->v.Tuple.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; - case Slice_kind: - tp = (PyTypeObject *)state->Slice_type; - result = PyType_GenericNew(tp, NULL, NULL); - if (!result) goto failed; - value = ast2obj_expr(state, 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); - 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->step, value) == -1) - goto failed; - Py_DECREF(value); - break; - } - value = ast2obj_int(state, o->lineno); + case Slice_kind: + tp = (PyTypeObject *)state->Slice_type; + result = PyType_GenericNew(tp, NULL, NULL); + if (!result) goto failed; + value = ast2obj_expr(state, 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); + 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); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->step, value) == -1) + goto failed; + Py_DECREF(value); + break; + } + value = ast2obj_int(state, 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); + 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, state->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) - goto failed; - Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -4409,162 +4409,162 @@ failed: return NULL; } -PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty o) +PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty o) { switch(o) { case Load: - Py_INCREF(state->Load_singleton); - return state->Load_singleton; + Py_INCREF(state->Load_singleton); + return state->Load_singleton; case Store: - Py_INCREF(state->Store_singleton); - return state->Store_singleton; + Py_INCREF(state->Store_singleton); + return state->Store_singleton; case Del: - Py_INCREF(state->Del_singleton); - return state->Del_singleton; + Py_INCREF(state->Del_singleton); + return state->Del_singleton; } - Py_UNREACHABLE(); + Py_UNREACHABLE(); } -PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty o) +PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty o) { switch(o) { case And: - Py_INCREF(state->And_singleton); - return state->And_singleton; + Py_INCREF(state->And_singleton); + return state->And_singleton; case Or: - Py_INCREF(state->Or_singleton); - return state->Or_singleton; + Py_INCREF(state->Or_singleton); + return state->Or_singleton; } - Py_UNREACHABLE(); + Py_UNREACHABLE(); } -PyObject* ast2obj_operator(astmodulestate *state, operator_ty o) +PyObject* ast2obj_operator(astmodulestate *state, operator_ty o) { switch(o) { case Add: - Py_INCREF(state->Add_singleton); - return state->Add_singleton; + Py_INCREF(state->Add_singleton); + return state->Add_singleton; case Sub: - Py_INCREF(state->Sub_singleton); - return state->Sub_singleton; + Py_INCREF(state->Sub_singleton); + return state->Sub_singleton; case Mult: - Py_INCREF(state->Mult_singleton); - return state->Mult_singleton; + Py_INCREF(state->Mult_singleton); + return state->Mult_singleton; case MatMult: - Py_INCREF(state->MatMult_singleton); - return state->MatMult_singleton; + Py_INCREF(state->MatMult_singleton); + return state->MatMult_singleton; case Div: - Py_INCREF(state->Div_singleton); - return state->Div_singleton; + Py_INCREF(state->Div_singleton); + return state->Div_singleton; case Mod: - Py_INCREF(state->Mod_singleton); - return state->Mod_singleton; + Py_INCREF(state->Mod_singleton); + return state->Mod_singleton; case Pow: - Py_INCREF(state->Pow_singleton); - return state->Pow_singleton; + Py_INCREF(state->Pow_singleton); + return state->Pow_singleton; case LShift: - Py_INCREF(state->LShift_singleton); - return state->LShift_singleton; + Py_INCREF(state->LShift_singleton); + return state->LShift_singleton; case RShift: - Py_INCREF(state->RShift_singleton); - return state->RShift_singleton; + Py_INCREF(state->RShift_singleton); + return state->RShift_singleton; case BitOr: - Py_INCREF(state->BitOr_singleton); - return state->BitOr_singleton; + Py_INCREF(state->BitOr_singleton); + return state->BitOr_singleton; case BitXor: - Py_INCREF(state->BitXor_singleton); - return state->BitXor_singleton; + Py_INCREF(state->BitXor_singleton); + return state->BitXor_singleton; case BitAnd: - Py_INCREF(state->BitAnd_singleton); - return state->BitAnd_singleton; + Py_INCREF(state->BitAnd_singleton); + return state->BitAnd_singleton; case FloorDiv: - Py_INCREF(state->FloorDiv_singleton); - return state->FloorDiv_singleton; + Py_INCREF(state->FloorDiv_singleton); + return state->FloorDiv_singleton; } - Py_UNREACHABLE(); + Py_UNREACHABLE(); } -PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty o) +PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty o) { switch(o) { case Invert: - Py_INCREF(state->Invert_singleton); - return state->Invert_singleton; + Py_INCREF(state->Invert_singleton); + return state->Invert_singleton; case Not: - Py_INCREF(state->Not_singleton); - return state->Not_singleton; + Py_INCREF(state->Not_singleton); + return state->Not_singleton; case UAdd: - Py_INCREF(state->UAdd_singleton); - return state->UAdd_singleton; + Py_INCREF(state->UAdd_singleton); + return state->UAdd_singleton; case USub: - Py_INCREF(state->USub_singleton); - return state->USub_singleton; + Py_INCREF(state->USub_singleton); + return state->USub_singleton; } - Py_UNREACHABLE(); + Py_UNREACHABLE(); } -PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty o) +PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty o) { switch(o) { case Eq: - Py_INCREF(state->Eq_singleton); - return state->Eq_singleton; + Py_INCREF(state->Eq_singleton); + return state->Eq_singleton; case NotEq: - Py_INCREF(state->NotEq_singleton); - return state->NotEq_singleton; + Py_INCREF(state->NotEq_singleton); + return state->NotEq_singleton; case Lt: - Py_INCREF(state->Lt_singleton); - return state->Lt_singleton; + Py_INCREF(state->Lt_singleton); + return state->Lt_singleton; case LtE: - Py_INCREF(state->LtE_singleton); - return state->LtE_singleton; + Py_INCREF(state->LtE_singleton); + return state->LtE_singleton; case Gt: - Py_INCREF(state->Gt_singleton); - return state->Gt_singleton; + Py_INCREF(state->Gt_singleton); + return state->Gt_singleton; case GtE: - Py_INCREF(state->GtE_singleton); - return state->GtE_singleton; + Py_INCREF(state->GtE_singleton); + return state->GtE_singleton; case Is: - Py_INCREF(state->Is_singleton); - return state->Is_singleton; + Py_INCREF(state->Is_singleton); + return state->Is_singleton; case IsNot: - Py_INCREF(state->IsNot_singleton); - return state->IsNot_singleton; + Py_INCREF(state->IsNot_singleton); + return state->IsNot_singleton; case In: - Py_INCREF(state->In_singleton); - return state->In_singleton; + Py_INCREF(state->In_singleton); + return state->In_singleton; case NotIn: - Py_INCREF(state->NotIn_singleton); - return state->NotIn_singleton; + Py_INCREF(state->NotIn_singleton); + return state->NotIn_singleton; } - Py_UNREACHABLE(); + Py_UNREACHABLE(); } PyObject* -ast2obj_comprehension(astmodulestate *state, void* _o) +ast2obj_comprehension(astmodulestate *state, void* _o) { comprehension_ty o = (comprehension_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->comprehension_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->target); if (!value) goto failed; - if (PyObject_SetAttr(result, state->target, value) == -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->iter); + value = ast2obj_expr(state, o->iter); if (!value) goto failed; - if (PyObject_SetAttr(result, state->iter, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->ifs, ast2obj_expr); + value = ast2obj_list(state, o->ifs, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->ifs, value) == -1) + if (PyObject_SetAttr(result, state->ifs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->is_async); + value = ast2obj_int(state, o->is_async); if (!value) goto failed; - if (PyObject_SetAttr(result, state->is_async, value) == -1) + if (PyObject_SetAttr(result, state->is_async, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4575,56 +4575,56 @@ failed: } PyObject* -ast2obj_excepthandler(astmodulestate *state, void* _o) +ast2obj_excepthandler(astmodulestate *state, void* _o) { excepthandler_ty o = (excepthandler_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } switch (o->kind) { case ExceptHandler_kind: - tp = (PyTypeObject *)state->ExceptHandler_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->v.ExceptHandler.type); if (!value) goto failed; - if (PyObject_SetAttr(result, state->type, value) == -1) + 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, o->v.ExceptHandler.name); if (!value) goto failed; - if (PyObject_SetAttr(result, state->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->v.ExceptHandler.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.ExceptHandler.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, state->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; } - value = ast2obj_int(state, o->lineno); + value = ast2obj_int(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->lineno, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, state->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->end_col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) - goto failed; - Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -4633,50 +4633,50 @@ failed: } PyObject* -ast2obj_arguments(astmodulestate *state, void* _o) +ast2obj_arguments(astmodulestate *state, void* _o) { arguments_ty o = (arguments_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->arguments_type; - result = PyType_GenericNew(tp, NULL, NULL); + tp = (PyTypeObject *)state->arguments_type; + result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_list(state, 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, o->args, ast2obj_arg); + value = ast2obj_list(state, o->posonlyargs, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->args, value) == -1) + if (PyObject_SetAttr(result, state->posonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(state, o->vararg); + value = ast2obj_list(state, o->args, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->vararg, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->kwonlyargs, ast2obj_arg); + value = ast2obj_arg(state, o->vararg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->kwonlyargs, value) == -1) + if (PyObject_SetAttr(result, state->vararg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->kw_defaults, ast2obj_expr); + value = ast2obj_list(state, o->kwonlyargs, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->kw_defaults, value) == -1) + if (PyObject_SetAttr(result, state->kwonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(state, o->kwarg); + value = ast2obj_list(state, o->kw_defaults, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->kwarg, value) == -1) + if (PyObject_SetAttr(result, state->kw_defaults, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(state, o->defaults, ast2obj_expr); + value = ast2obj_arg(state, o->kwarg); if (!value) goto failed; - if (PyObject_SetAttr(result, state->defaults, value) == -1) + if (PyObject_SetAttr(result, state->kwarg, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_list(state, o->defaults, ast2obj_expr); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->defaults, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4687,52 +4687,52 @@ failed: } PyObject* -ast2obj_arg(astmodulestate *state, void* _o) +ast2obj_arg(astmodulestate *state, void* _o) { arg_ty o = (arg_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->arg_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, 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); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->annotation, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_string(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->arg, value) == -1) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->annotation); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, state->annotation, value) == -1) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_string(state, 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, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, state->lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, o->col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, state->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) - goto failed; - Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -4741,47 +4741,47 @@ failed: } PyObject* -ast2obj_keyword(astmodulestate *state, void* _o) +ast2obj_keyword(astmodulestate *state, void* _o) { keyword_ty o = (keyword_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->keyword_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, 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); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->value, value) == -1) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, 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); if (!value) goto failed; - if (PyObject_SetAttr(result, state->arg, value) == -1) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_expr(state, o->value); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, state->value, value) == -1) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->end_col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(state, 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); - 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); - 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) - goto failed; - Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -4790,25 +4790,25 @@ failed: } PyObject* -ast2obj_alias(astmodulestate *state, void* _o) +ast2obj_alias(astmodulestate *state, void* _o) { alias_ty o = (alias_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->alias_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->name); if (!value) goto failed; - if (PyObject_SetAttr(result, state->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(state, o->asname); + value = ast2obj_identifier(state, o->asname); if (!value) goto failed; - if (PyObject_SetAttr(result, state->asname, value) == -1) + if (PyObject_SetAttr(result, state->asname, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4819,25 +4819,25 @@ failed: } PyObject* -ast2obj_withitem(astmodulestate *state, void* _o) +ast2obj_withitem(astmodulestate *state, void* _o) { withitem_ty o = (withitem_ty)_o; PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; + PyTypeObject *tp; if (!o) { Py_RETURN_NONE; } - tp = (PyTypeObject *)state->withitem_type; - result = PyType_GenericNew(tp, NULL, NULL); + 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, o->context_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, state->context_expr, value) == -1) + 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, o->optional_vars); if (!value) goto failed; - if (PyObject_SetAttr(result, state->optional_vars, value) == -1) + if (PyObject_SetAttr(result, state->optional_vars, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4847,62 +4847,62 @@ failed: return NULL; } -PyObject* -ast2obj_type_ignore(astmodulestate *state, void* _o) -{ - type_ignore_ty o = (type_ignore_ty)_o; - PyObject *result = NULL, *value = NULL; - PyTypeObject *tp; - if (!o) { - Py_RETURN_NONE; - } - switch (o->kind) { - case TypeIgnore_kind: - tp = (PyTypeObject *)state->TypeIgnore_type; - result = PyType_GenericNew(tp, NULL, NULL); - if (!result) goto failed; - value = ast2obj_int(state, 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); - if (!value) goto failed; - if (PyObject_SetAttr(result, state->tag, value) == -1) - goto failed; - Py_DECREF(value); - break; - } - return result; -failed: - Py_XDECREF(value); - Py_XDECREF(result); - return NULL; -} - - +PyObject* +ast2obj_type_ignore(astmodulestate *state, void* _o) +{ + type_ignore_ty o = (type_ignore_ty)_o; + PyObject *result = NULL, *value = NULL; + PyTypeObject *tp; + if (!o) { + Py_RETURN_NONE; + } + switch (o->kind) { + case TypeIgnore_kind: + tp = (PyTypeObject *)state->TypeIgnore_type; + result = PyType_GenericNew(tp, NULL, NULL); + if (!result) goto failed; + value = ast2obj_int(state, 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); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->tag, value) == -1) + goto failed; + Py_DECREF(value); + break; + } + return result; +failed: + Py_XDECREF(value); + Py_XDECREF(result); + return NULL; +} + + int -obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) +obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; - PyObject *tp; + PyObject *tp; if (obj == Py_None) { *out = NULL; return 0; } - tp = state->Module_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Module_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* body; - asdl_seq* type_ignores; + asdl_seq* type_ignores; - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -4914,7 +4914,7 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Module field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Module field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -4922,14 +4922,14 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Module' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Module' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Module field \"body\" changed size during iteration"); @@ -4939,56 +4939,56 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_ignores, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"type_ignores\" missing from Module"); - return 1; - } - else { - int res; - Py_ssize_t len; - Py_ssize_t i; - if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Module field \"type_ignores\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); - goto failed; - } - len = PyList_GET_SIZE(tmp); - type_ignores = _Py_asdl_seq_new(len, arena); - if (type_ignores == NULL) goto failed; - for (i = 0; i < len; i++) { - type_ignore_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Module' node")) { - goto failed; - } - res = obj2ast_type_ignore(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); - if (res != 0) goto failed; - if (len != PyList_GET_SIZE(tmp)) { - PyErr_SetString(PyExc_RuntimeError, "Module field \"type_ignores\" changed size during iteration"); - goto failed; - } - asdl_seq_SET(type_ignores, i, val); - } - Py_CLEAR(tmp); - } - *out = Module(body, type_ignores, arena); + if (_PyObject_LookupAttr(obj, state->type_ignores, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"type_ignores\" missing from Module"); + return 1; + } + else { + int res; + Py_ssize_t len; + Py_ssize_t i; + if (!PyList_Check(tmp)) { + PyErr_Format(PyExc_TypeError, "Module field \"type_ignores\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + goto failed; + } + len = PyList_GET_SIZE(tmp); + type_ignores = _Py_asdl_seq_new(len, arena); + if (type_ignores == NULL) goto failed; + for (i = 0; i < len; i++) { + type_ignore_ty val; + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Module' node")) { + goto failed; + } + res = obj2ast_type_ignore(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); + if (res != 0) goto failed; + if (len != PyList_GET_SIZE(tmp)) { + PyErr_SetString(PyExc_RuntimeError, "Module field \"type_ignores\" changed size during iteration"); + goto failed; + } + asdl_seq_SET(type_ignores, i, val); + } + Py_CLEAR(tmp); + } + *out = Module(body, type_ignores, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Interactive_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Interactive_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* body; - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5000,7 +5000,7 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Interactive field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Interactive field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5008,14 +5008,14 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Interactive' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Interactive' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Interactive field \"body\" changed size during iteration"); @@ -5029,15 +5029,15 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = state->Expression_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Expression_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty body; - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5046,11 +5046,11 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Expression' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &body, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Expression' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &body, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5058,73 +5058,73 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = state->FunctionType_type; - isinstance = PyObject_IsInstance(obj, tp); - if (isinstance == -1) { - return 1; - } - if (isinstance) { - asdl_seq* argtypes; - expr_ty returns; - - if (_PyObject_LookupAttr(obj, state->argtypes, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"argtypes\" missing from FunctionType"); - return 1; - } - else { - int res; - Py_ssize_t len; - Py_ssize_t i; - if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "FunctionType field \"argtypes\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); - goto failed; - } - len = PyList_GET_SIZE(tmp); - argtypes = _Py_asdl_seq_new(len, arena); - if (argtypes == NULL) goto failed; - for (i = 0; i < len; i++) { - expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'FunctionType' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); - if (res != 0) goto failed; - if (len != PyList_GET_SIZE(tmp)) { - PyErr_SetString(PyExc_RuntimeError, "FunctionType field \"argtypes\" changed size during iteration"); - goto failed; - } - asdl_seq_SET(argtypes, i, val); - } - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"returns\" missing from FunctionType"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'FunctionType' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &returns, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = FunctionType(argtypes, returns, arena); - if (*out == NULL) goto failed; - return 0; - } + tp = state->FunctionType_type; + isinstance = PyObject_IsInstance(obj, tp); + if (isinstance == -1) { + return 1; + } + if (isinstance) { + asdl_seq* argtypes; + expr_ty returns; + + if (_PyObject_LookupAttr(obj, state->argtypes, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"argtypes\" missing from FunctionType"); + return 1; + } + else { + int res; + Py_ssize_t len; + Py_ssize_t i; + if (!PyList_Check(tmp)) { + PyErr_Format(PyExc_TypeError, "FunctionType field \"argtypes\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + goto failed; + } + len = PyList_GET_SIZE(tmp); + argtypes = _Py_asdl_seq_new(len, arena); + if (argtypes == NULL) goto failed; + for (i = 0; i < len; i++) { + expr_ty val; + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'FunctionType' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); + if (res != 0) goto failed; + if (len != PyList_GET_SIZE(tmp)) { + PyErr_SetString(PyExc_RuntimeError, "FunctionType field \"argtypes\" changed size during iteration"); + goto failed; + } + asdl_seq_SET(argtypes, i, val); + } + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"returns\" missing from FunctionType"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'FunctionType' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &returns, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = FunctionType(argtypes, returns, arena); + if (*out == NULL) goto failed; + return 0; + } PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %R", obj); failed: @@ -5133,22 +5133,22 @@ obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) } int -obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) +obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; - PyObject *tp; + PyObject *tp; int lineno; int col_offset; - int end_lineno; - int end_col_offset; + int end_lineno; + int end_col_offset; if (obj == Py_None) { *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5157,15 +5157,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5174,50 +5174,50 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &col_offset, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &col_offset, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_lineno = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_col_offset = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - tp = state->FunctionDef_type; - isinstance = PyObject_IsInstance(obj, tp); + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'stmt' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + tp = state->FunctionDef_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -5227,9 +5227,9 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* decorator_list; expr_ty returns; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5238,15 +5238,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &name, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &name, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5255,15 +5255,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_arguments(state, tmp, &args, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_arguments(state, tmp, &args, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5275,7 +5275,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "FunctionDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "FunctionDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5283,14 +5283,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"body\" changed size during iteration"); @@ -5300,7 +5300,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5312,7 +5312,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "FunctionDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "FunctionDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5320,14 +5320,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (decorator_list == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"decorator_list\" changed size during iteration"); @@ -5337,7 +5337,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5346,39 +5346,39 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &returns, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &returns, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'FunctionDef' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = FunctionDef(name, args, body, decorator_list, returns, - type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = FunctionDef(name, args, body, decorator_list, returns, + type_comment, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->AsyncFunctionDef_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->AsyncFunctionDef_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -5388,9 +5388,9 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* decorator_list; expr_ty returns; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5399,15 +5399,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &name, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &name, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5416,15 +5416,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_arguments(state, tmp, &args, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_arguments(state, tmp, &args, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5436,7 +5436,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5444,14 +5444,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"body\" changed size during iteration"); @@ -5461,7 +5461,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5473,7 +5473,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5481,14 +5481,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (decorator_list == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"decorator_list\" changed size during iteration"); @@ -5498,7 +5498,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5507,39 +5507,39 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &returns, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &returns, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFunctionDef' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } *out = AsyncFunctionDef(name, args, body, decorator_list, returns, - type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + type_comment, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->ClassDef_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->ClassDef_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -5550,7 +5550,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* decorator_list; - if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5559,15 +5559,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &name, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &name, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->bases, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->bases, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5579,7 +5579,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ClassDef field \"bases\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ClassDef field \"bases\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5587,14 +5587,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (bases == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"bases\" changed size during iteration"); @@ -5604,7 +5604,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5616,7 +5616,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ClassDef field \"keywords\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ClassDef field \"keywords\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5624,14 +5624,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (keywords == NULL) goto failed; for (i = 0; i < len; i++) { keyword_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { - goto failed; - } - res = obj2ast_keyword(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { + goto failed; + } + res = obj2ast_keyword(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"keywords\" changed size during iteration"); @@ -5641,7 +5641,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5653,7 +5653,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ClassDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ClassDef field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5661,14 +5661,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"body\" changed size during iteration"); @@ -5678,7 +5678,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5690,7 +5690,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ClassDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ClassDef field \"decorator_list\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5698,14 +5698,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (decorator_list == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ClassDef' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"decorator_list\" changed size during iteration"); @@ -5716,19 +5716,19 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_CLEAR(tmp); } *out = ClassDef(name, bases, keywords, body, decorator_list, lineno, - col_offset, end_lineno, end_col_offset, arena); + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Return_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Return_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5737,28 +5737,28 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Return' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Return' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Return(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Return(value, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Delete_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Delete_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* targets; - if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5770,7 +5770,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Delete field \"targets\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Delete field \"targets\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5778,14 +5778,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (targets == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Delete' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Delete' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Delete field \"targets\" changed size during iteration"); @@ -5795,22 +5795,22 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Delete(targets, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Delete(targets, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Assign_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Assign_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* targets; expr_ty value; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5822,7 +5822,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Assign field \"targets\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Assign field \"targets\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -5830,14 +5830,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (targets == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Assign field \"targets\" changed size during iteration"); @@ -5847,7 +5847,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5856,38 +5856,38 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'Assign' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = Assign(targets, value, type_comment, lineno, col_offset, - end_lineno, end_col_offset, arena); + *out = Assign(targets, value, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->AugAssign_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->AugAssign_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -5896,7 +5896,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) operator_ty op; expr_ty value; - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5905,15 +5905,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5922,15 +5922,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { - goto failed; - } - res = obj2ast_operator(state, tmp, &op, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { + goto failed; + } + res = obj2ast_operator(state, tmp, &op, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5939,21 +5939,21 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AugAssign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AugAssign(target, op, value, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = AugAssign(target, op, value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->AnnAssign_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->AnnAssign_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -5963,7 +5963,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty value; int simple; - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5972,15 +5972,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5989,15 +5989,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &annotation, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &annotation, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6006,15 +6006,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->simple, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->simple, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6023,21 +6023,21 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &simple, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AnnAssign' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &simple, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } *out = AnnAssign(target, annotation, value, simple, lineno, col_offset, - end_lineno, end_col_offset, arena); + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->For_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->For_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6046,9 +6046,9 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty iter; asdl_seq* body; asdl_seq* orelse; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6057,15 +6057,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'For' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'For' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6074,15 +6074,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'For' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &iter, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'For' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &iter, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6094,7 +6094,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "For field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "For field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6102,14 +6102,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'For' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'For' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "For field \"body\" changed size during iteration"); @@ -6119,7 +6119,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6131,7 +6131,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "For field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "For field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6139,14 +6139,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (orelse == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'For' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'For' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "For field \"orelse\" changed size during iteration"); @@ -6156,30 +6156,30 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'For' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = For(target, iter, body, orelse, type_comment, lineno, - col_offset, end_lineno, end_col_offset, arena); + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'For' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = For(target, iter, body, orelse, type_comment, lineno, + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->AsyncFor_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->AsyncFor_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6188,9 +6188,9 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty iter; asdl_seq* body; asdl_seq* orelse; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6199,15 +6199,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6216,15 +6216,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &iter, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &iter, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6236,7 +6236,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncFor field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncFor field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6244,14 +6244,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"body\" changed size during iteration"); @@ -6261,7 +6261,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6273,7 +6273,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncFor field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncFor field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6281,14 +6281,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (orelse == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"orelse\" changed size during iteration"); @@ -6298,30 +6298,30 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = AsyncFor(target, iter, body, orelse, type_comment, lineno, - col_offset, end_lineno, end_col_offset, arena); + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'AsyncFor' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = AsyncFor(target, iter, body, orelse, type_comment, lineno, + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->While_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->While_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6330,7 +6330,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* orelse; - if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6339,15 +6339,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'While' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &test, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'While' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &test, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6359,7 +6359,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "While field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "While field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6367,14 +6367,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'While' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'While' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "While field \"body\" changed size during iteration"); @@ -6384,7 +6384,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6396,7 +6396,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "While field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "While field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6404,14 +6404,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (orelse == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'While' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'While' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "While field \"orelse\" changed size during iteration"); @@ -6421,13 +6421,13 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = While(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = While(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->If_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->If_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6436,7 +6436,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* orelse; - if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6445,15 +6445,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'If' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &test, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'If' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &test, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6465,7 +6465,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "If field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "If field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6473,14 +6473,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'If' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'If' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "If field \"body\" changed size during iteration"); @@ -6490,7 +6490,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6502,7 +6502,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "If field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "If field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6510,14 +6510,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (orelse == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'If' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'If' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "If field \"orelse\" changed size during iteration"); @@ -6527,22 +6527,22 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = If(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = If(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->With_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->With_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* items; asdl_seq* body; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6554,7 +6554,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "With field \"items\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "With field \"items\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6562,14 +6562,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (items == NULL) goto failed; for (i = 0; i < len; i++) { withitem_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'With' node")) { - goto failed; - } - res = obj2ast_withitem(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'With' node")) { + goto failed; + } + res = obj2ast_withitem(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "With field \"items\" changed size during iteration"); @@ -6579,7 +6579,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6591,7 +6591,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "With field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "With field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6599,14 +6599,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'With' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'With' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "With field \"body\" changed size during iteration"); @@ -6616,39 +6616,39 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'With' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = With(items, body, type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'With' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = With(items, body, type_comment, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->AsyncWith_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->AsyncWith_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* items; asdl_seq* body; - string type_comment; + string type_comment; - if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6660,7 +6660,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncWith field \"items\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncWith field \"items\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6668,14 +6668,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (items == NULL) goto failed; for (i = 0; i < len; i++) { withitem_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { - goto failed; - } - res = obj2ast_withitem(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { + goto failed; + } + res = obj2ast_withitem(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"items\" changed size during iteration"); @@ -6685,7 +6685,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6697,7 +6697,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "AsyncWith field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "AsyncWith field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6705,14 +6705,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"body\" changed size during iteration"); @@ -6722,30 +6722,30 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = AsyncWith(items, body, type_comment, lineno, col_offset, - end_lineno, end_col_offset, arena); + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'AsyncWith' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = AsyncWith(items, body, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Raise_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Raise_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6753,7 +6753,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty exc; expr_ty cause; - if (_PyObject_LookupAttr(obj, state->exc, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->exc, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6762,15 +6762,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Raise' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &exc, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Raise' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &exc, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->cause, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->cause, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6779,21 +6779,21 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Raise' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &cause, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Raise' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &cause, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Raise(exc, cause, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Raise(exc, cause, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Try_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Try_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6803,7 +6803,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* orelse; asdl_seq* finalbody; - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6815,7 +6815,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Try field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Try field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6823,14 +6823,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Try field \"body\" changed size during iteration"); @@ -6840,7 +6840,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->handlers, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->handlers, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6852,7 +6852,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Try field \"handlers\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Try field \"handlers\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6860,14 +6860,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (handlers == NULL) goto failed; for (i = 0; i < len; i++) { excepthandler_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { - goto failed; - } - res = obj2ast_excepthandler(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { + goto failed; + } + res = obj2ast_excepthandler(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Try field \"handlers\" changed size during iteration"); @@ -6877,7 +6877,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6889,7 +6889,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Try field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Try field \"orelse\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6897,14 +6897,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (orelse == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Try field \"orelse\" changed size during iteration"); @@ -6914,7 +6914,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->finalbody, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->finalbody, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6926,7 +6926,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Try field \"finalbody\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Try field \"finalbody\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -6934,14 +6934,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (finalbody == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Try' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Try field \"finalbody\" changed size during iteration"); @@ -6952,12 +6952,12 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_CLEAR(tmp); } *out = Try(body, handlers, orelse, finalbody, lineno, col_offset, - end_lineno, end_col_offset, arena); + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Assert_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Assert_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -6965,7 +6965,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty test; expr_ty msg; - if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6974,15 +6974,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Assert' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &test, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Assert' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &test, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->msg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->msg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6991,28 +6991,28 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Assert' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &msg, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Assert' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &msg, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Assert(test, msg, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Assert(test, msg, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Import_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Import_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7024,7 +7024,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Import field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Import field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7032,14 +7032,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (names == NULL) goto failed; for (i = 0; i < len; i++) { alias_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Import' node")) { - goto failed; - } - res = obj2ast_alias(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Import' node")) { + goto failed; + } + res = obj2ast_alias(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Import field \"names\" changed size during iteration"); @@ -7049,13 +7049,13 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Import(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Import(names, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->ImportFrom_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->ImportFrom_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7064,7 +7064,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* names; int level; - if (_PyObject_LookupAttr(obj, state->module, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->module, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7073,15 +7073,15 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &module, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &module, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7093,7 +7093,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ImportFrom field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ImportFrom field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7101,14 +7101,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (names == NULL) goto failed; for (i = 0; i < len; i++) { alias_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { - goto failed; - } - res = obj2ast_alias(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { + goto failed; + } + res = obj2ast_alias(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ImportFrom field \"names\" changed size during iteration"); @@ -7118,7 +7118,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->level, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->level, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7127,28 +7127,28 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &level, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ImportFrom' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &level, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = ImportFrom(module, names, level, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = ImportFrom(module, names, level, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Global_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Global_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7160,7 +7160,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Global field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Global field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7168,14 +7168,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (names == NULL) goto failed; for (i = 0; i < len; i++) { identifier val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Global' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Global' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Global field \"names\" changed size during iteration"); @@ -7185,20 +7185,20 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Global(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Global(names, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Nonlocal_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Nonlocal_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7210,7 +7210,7 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Nonlocal field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Nonlocal field \"names\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7218,14 +7218,14 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) if (names == NULL) goto failed; for (i = 0; i < len; i++) { identifier val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Nonlocal' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Nonlocal' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Nonlocal field \"names\" changed size during iteration"); @@ -7235,20 +7235,20 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Nonlocal(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Nonlocal(names, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Expr_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Expr_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7257,49 +7257,49 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Expr' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Expr' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Expr(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Expr(value, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Pass_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Pass_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { - *out = Pass(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = Pass(lineno, col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Break_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Break_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { - *out = Break(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = Break(lineno, col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Continue_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Continue_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { - *out = Continue(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = Continue(lineno, col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7311,22 +7311,22 @@ obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) } int -obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) +obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; - PyObject *tp; + PyObject *tp; int lineno; int col_offset; - int end_lineno; - int end_col_offset; + int end_lineno; + int end_col_offset; if (obj == Py_None) { *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7335,15 +7335,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7352,50 +7352,50 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &col_offset, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &col_offset, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_lineno = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_col_offset = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - tp = state->BoolOp_type; - isinstance = PyObject_IsInstance(obj, tp); + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'expr' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + tp = state->BoolOp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7403,7 +7403,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) boolop_ty op; asdl_seq* values; - if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7412,15 +7412,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'BoolOp' node")) { - goto failed; - } - res = obj2ast_boolop(state, tmp, &op, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'BoolOp' node")) { + goto failed; + } + res = obj2ast_boolop(state, tmp, &op, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7432,7 +7432,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "BoolOp field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "BoolOp field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7440,14 +7440,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (values == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'BoolOp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'BoolOp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "BoolOp field \"values\" changed size during iteration"); @@ -7457,61 +7457,61 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = BoolOp(op, values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = BoolOp(op, values, lineno, col_offset, end_lineno, + end_col_offset, arena); + if (*out == NULL) goto failed; + return 0; + } + tp = state->NamedExpr_type; + isinstance = PyObject_IsInstance(obj, tp); + if (isinstance == -1) { + return 1; + } + if (isinstance) { + expr_ty target; + expr_ty value; + + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from NamedExpr"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'NamedExpr' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from NamedExpr"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'NamedExpr' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = NamedExpr(target, value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->NamedExpr_type; - isinstance = PyObject_IsInstance(obj, tp); - if (isinstance == -1) { - return 1; - } - if (isinstance) { - expr_ty target; - expr_ty value; - - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from NamedExpr"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'NamedExpr' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from NamedExpr"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'NamedExpr' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = NamedExpr(target, value, lineno, col_offset, end_lineno, - end_col_offset, arena); - if (*out == NULL) goto failed; - return 0; - } - tp = state->BinOp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->BinOp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7520,7 +7520,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) operator_ty op; expr_ty right; - if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7529,15 +7529,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &left, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &left, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7546,15 +7546,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { - goto failed; - } - res = obj2ast_operator(state, tmp, &op, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { + goto failed; + } + res = obj2ast_operator(state, tmp, &op, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->right, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->right, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7563,21 +7563,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &right, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'BinOp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &right, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = BinOp(left, op, right, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = BinOp(left, op, right, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->UnaryOp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->UnaryOp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7585,7 +7585,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) unaryop_ty op; expr_ty operand; - if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7594,15 +7594,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'UnaryOp' node")) { - goto failed; - } - res = obj2ast_unaryop(state, tmp, &op, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'UnaryOp' node")) { + goto failed; + } + res = obj2ast_unaryop(state, tmp, &op, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->operand, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->operand, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7611,21 +7611,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'UnaryOp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &operand, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'UnaryOp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &operand, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = UnaryOp(op, operand, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = UnaryOp(op, operand, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Lambda_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Lambda_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7633,7 +7633,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) arguments_ty args; expr_ty body; - if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7642,15 +7642,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Lambda' node")) { - goto failed; - } - res = obj2ast_arguments(state, tmp, &args, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Lambda' node")) { + goto failed; + } + res = obj2ast_arguments(state, tmp, &args, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7659,21 +7659,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Lambda' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &body, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Lambda' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &body, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Lambda(args, body, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Lambda(args, body, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->IfExp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->IfExp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7682,7 +7682,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty body; expr_ty orelse; - if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7691,15 +7691,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &test, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &test, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7708,15 +7708,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &body, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &body, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7725,21 +7725,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &orelse, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'IfExp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &orelse, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = IfExp(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = IfExp(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Dict_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Dict_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7747,7 +7747,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* keys; asdl_seq* values; - if (_PyObject_LookupAttr(obj, state->keys, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->keys, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7759,7 +7759,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Dict field \"keys\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Dict field \"keys\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7767,14 +7767,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (keys == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Dict' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Dict' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Dict field \"keys\" changed size during iteration"); @@ -7784,7 +7784,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7796,7 +7796,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Dict field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Dict field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7804,14 +7804,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (values == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Dict' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Dict' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Dict field \"values\" changed size during iteration"); @@ -7821,20 +7821,20 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Dict(keys, values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Dict(keys, values, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Set_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Set_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* elts; - if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7846,7 +7846,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Set field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Set field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7854,14 +7854,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (elts == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Set' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Set' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Set field \"elts\" changed size during iteration"); @@ -7871,12 +7871,12 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Set(elts, lineno, col_offset, end_lineno, end_col_offset, arena); + *out = Set(elts, lineno, col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->ListComp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->ListComp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7884,7 +7884,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7893,15 +7893,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ListComp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &elt, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ListComp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &elt, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7913,7 +7913,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ListComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ListComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7921,14 +7921,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (generators == NULL) goto failed; for (i = 0; i < len; i++) { comprehension_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ListComp' node")) { - goto failed; - } - res = obj2ast_comprehension(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ListComp' node")) { + goto failed; + } + res = obj2ast_comprehension(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ListComp field \"generators\" changed size during iteration"); @@ -7938,13 +7938,13 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = ListComp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = ListComp(elt, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->SetComp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->SetComp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -7952,7 +7952,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7961,15 +7961,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'SetComp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &elt, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'SetComp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &elt, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7981,7 +7981,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "SetComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "SetComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -7989,14 +7989,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (generators == NULL) goto failed; for (i = 0; i < len; i++) { comprehension_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'SetComp' node")) { - goto failed; - } - res = obj2ast_comprehension(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'SetComp' node")) { + goto failed; + } + res = obj2ast_comprehension(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "SetComp field \"generators\" changed size during iteration"); @@ -8006,13 +8006,13 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = SetComp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = SetComp(elt, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->DictComp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->DictComp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8021,7 +8021,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty value; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, state->key, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->key, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8030,15 +8030,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &key, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &key, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8047,15 +8047,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8067,7 +8067,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "DictComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "DictComp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8075,14 +8075,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (generators == NULL) goto failed; for (i = 0; i < len; i++) { comprehension_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { - goto failed; - } - res = obj2ast_comprehension(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'DictComp' node")) { + goto failed; + } + res = obj2ast_comprehension(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "DictComp field \"generators\" changed size during iteration"); @@ -8092,13 +8092,13 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = DictComp(key, value, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = DictComp(key, value, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->GeneratorExp_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->GeneratorExp_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8106,7 +8106,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8115,15 +8115,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'GeneratorExp' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &elt, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'GeneratorExp' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &elt, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8135,7 +8135,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "GeneratorExp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "GeneratorExp field \"generators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8143,14 +8143,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (generators == NULL) goto failed; for (i = 0; i < len; i++) { comprehension_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'GeneratorExp' node")) { - goto failed; - } - res = obj2ast_comprehension(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'GeneratorExp' node")) { + goto failed; + } + res = obj2ast_comprehension(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "GeneratorExp field \"generators\" changed size during iteration"); @@ -8160,20 +8160,20 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = GeneratorExp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = GeneratorExp(elt, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Await_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Await_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8182,28 +8182,28 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Await' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Await' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Await(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Await(value, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Yield_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Yield_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8212,28 +8212,28 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Yield' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Yield' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Yield(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Yield(value, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->YieldFrom_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->YieldFrom_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8242,21 +8242,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'YieldFrom' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'YieldFrom' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = YieldFrom(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = YieldFrom(value, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Compare_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Compare_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8265,7 +8265,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) asdl_int_seq* ops; asdl_seq* comparators; - if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8274,15 +8274,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &left, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &left, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ops, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ops, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8294,7 +8294,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Compare field \"ops\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Compare field \"ops\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8302,14 +8302,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (ops == NULL) goto failed; for (i = 0; i < len; i++) { cmpop_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { - goto failed; - } - res = obj2ast_cmpop(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { + goto failed; + } + res = obj2ast_cmpop(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Compare field \"ops\" changed size during iteration"); @@ -8319,7 +8319,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->comparators, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->comparators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8331,7 +8331,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Compare field \"comparators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Compare field \"comparators\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8339,14 +8339,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (comparators == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Compare' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Compare field \"comparators\" changed size during iteration"); @@ -8356,13 +8356,13 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Compare(left, ops, comparators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Compare(left, ops, comparators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Call_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Call_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8371,7 +8371,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* args; asdl_seq* keywords; - if (_PyObject_LookupAttr(obj, state->func, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->func, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8380,15 +8380,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &func, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &func, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8400,7 +8400,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Call field \"args\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Call field \"args\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8408,14 +8408,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (args == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Call field \"args\" changed size during iteration"); @@ -8425,7 +8425,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8437,7 +8437,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Call field \"keywords\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Call field \"keywords\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8445,14 +8445,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (keywords == NULL) goto failed; for (i = 0; i < len; i++) { keyword_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { - goto failed; - } - res = obj2ast_keyword(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Call' node")) { + goto failed; + } + res = obj2ast_keyword(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Call field \"keywords\" changed size during iteration"); @@ -8462,13 +8462,13 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = Call(func, args, keywords, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Call(func, args, keywords, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->FormattedValue_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->FormattedValue_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8477,7 +8477,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) int conversion; expr_ty format_spec; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8486,15 +8486,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->conversion, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->conversion, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8503,15 +8503,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &conversion, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &conversion, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->format_spec, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->format_spec, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8520,28 +8520,28 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &format_spec, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'FormattedValue' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &format_spec, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } *out = FormattedValue(value, conversion, format_spec, lineno, - col_offset, end_lineno, end_col_offset, arena); + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->JoinedStr_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->JoinedStr_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { asdl_seq* values; - if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8553,7 +8553,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "JoinedStr field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "JoinedStr field \"values\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8561,14 +8561,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (values == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'JoinedStr' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'JoinedStr' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "JoinedStr field \"values\" changed size during iteration"); @@ -8578,61 +8578,61 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - *out = JoinedStr(values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = JoinedStr(values, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Constant_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Constant_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { - constant value; - string kind; + constant value; + string kind; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Constant"); + PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Constant"); return 1; } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Constant' node")) { - goto failed; - } - res = obj2ast_constant(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Constant' node")) { + goto failed; + } + res = obj2ast_constant(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->kind, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kind, &tmp) < 0) { return 1; } - if (tmp == NULL || tmp == Py_None) { + if (tmp == NULL || tmp == Py_None) { Py_CLEAR(tmp); - kind = NULL; + kind = NULL; } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Constant' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &kind, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Constant' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &kind, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Constant(value, kind, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Constant(value, kind, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Attribute_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Attribute_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8641,7 +8641,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) identifier attr; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8650,15 +8650,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->attr, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->attr, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8667,15 +8667,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &attr, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &attr, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8684,30 +8684,30 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Attribute' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Attribute(value, attr, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Attribute(value, attr, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Subscript_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Subscript_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } if (isinstance) { expr_ty value; - expr_ty slice; + expr_ty slice; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8716,15 +8716,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->slice, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->slice, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8733,15 +8733,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &slice, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &slice, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8750,21 +8750,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Subscript' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Subscript(value, slice, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Subscript(value, slice, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Starred_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Starred_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8772,7 +8772,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty value; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8781,15 +8781,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Starred' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Starred' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8798,21 +8798,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Starred' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Starred' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Starred(value, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Starred(value, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - tp = state->Name_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Name_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8820,7 +8820,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) identifier id; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->id, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->id, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8829,15 +8829,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Name' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &id, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Name' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &id, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8846,21 +8846,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Name' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Name' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Name(id, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Name(id, ctx, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->List_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->List_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8868,7 +8868,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* elts; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8880,7 +8880,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "List field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "List field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8888,14 +8888,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (elts == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'List' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'List' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "List field \"elts\" changed size during iteration"); @@ -8905,7 +8905,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8914,21 +8914,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'List' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'List' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = List(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = List(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Tuple_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Tuple_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -8936,7 +8936,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* elts; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8948,7 +8948,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "Tuple field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "Tuple field \"elts\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -8956,14 +8956,14 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) if (elts == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'Tuple' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'Tuple' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "Tuple field \"elts\" changed size during iteration"); @@ -8973,7 +8973,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8982,21 +8982,21 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Tuple' node")) { - goto failed; - } - res = obj2ast_expr_context(state, tmp, &ctx, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Tuple' node")) { + goto failed; + } + res = obj2ast_expr_context(state, tmp, &ctx, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Tuple(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = Tuple(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } - tp = state->Slice_type; - isinstance = PyObject_IsInstance(obj, tp); + tp = state->Slice_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -9005,7 +9005,7 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) expr_ty upper; expr_ty step; - if (_PyObject_LookupAttr(obj, state->lower, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lower, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9014,15 +9014,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &lower, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &lower, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->upper, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->upper, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9031,15 +9031,15 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &upper, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &upper, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->step, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->step, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9048,68 +9048,68 @@ obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &step, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'Slice' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &step, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Slice(lower, upper, step, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = Slice(lower, upper, step, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } - - PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj); - failed: - Py_XDECREF(tmp); - return 1; -} - -int -obj2ast_expr_context(astmodulestate *state, PyObject* obj, expr_context_ty* - out, PyArena* arena) -{ - int isinstance; - - isinstance = PyObject_IsInstance(obj, state->Load_type); + + PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj); + failed: + Py_XDECREF(tmp); + return 1; +} + +int +obj2ast_expr_context(astmodulestate *state, PyObject* obj, expr_context_ty* + out, PyArena* arena) +{ + int isinstance; + + isinstance = PyObject_IsInstance(obj, state->Load_type); + if (isinstance == -1) { + return 1; + } + if (isinstance) { + *out = Load; + return 0; + } + isinstance = PyObject_IsInstance(obj, state->Store_type); if (isinstance == -1) { return 1; } if (isinstance) { - *out = Load; + *out = Store; return 0; } - isinstance = PyObject_IsInstance(obj, state->Store_type); + isinstance = PyObject_IsInstance(obj, state->Del_type); if (isinstance == -1) { return 1; } if (isinstance) { - *out = Store; + *out = Del; return 0; } - isinstance = PyObject_IsInstance(obj, state->Del_type); - if (isinstance == -1) { - return 1; - } - if (isinstance) { - *out = Del; - return 0; - } - PyErr_Format(PyExc_TypeError, "expected some sort of expr_context, but got %R", obj); + PyErr_Format(PyExc_TypeError, "expected some sort of expr_context, but got %R", obj); return 1; } int -obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, PyArena* - arena) +obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, state->And_type); + isinstance = PyObject_IsInstance(obj, state->And_type); if (isinstance == -1) { return 1; } @@ -9117,7 +9117,7 @@ obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, PyArena* *out = And; return 0; } - isinstance = PyObject_IsInstance(obj, state->Or_type); + isinstance = PyObject_IsInstance(obj, state->Or_type); if (isinstance == -1) { return 1; } @@ -9131,12 +9131,12 @@ obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, PyArena* } int -obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, - PyArena* arena) +obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, + PyArena* arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, state->Add_type); + isinstance = PyObject_IsInstance(obj, state->Add_type); if (isinstance == -1) { return 1; } @@ -9144,7 +9144,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Add; return 0; } - isinstance = PyObject_IsInstance(obj, state->Sub_type); + isinstance = PyObject_IsInstance(obj, state->Sub_type); if (isinstance == -1) { return 1; } @@ -9152,7 +9152,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Sub; return 0; } - isinstance = PyObject_IsInstance(obj, state->Mult_type); + isinstance = PyObject_IsInstance(obj, state->Mult_type); if (isinstance == -1) { return 1; } @@ -9160,7 +9160,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Mult; return 0; } - isinstance = PyObject_IsInstance(obj, state->MatMult_type); + isinstance = PyObject_IsInstance(obj, state->MatMult_type); if (isinstance == -1) { return 1; } @@ -9168,7 +9168,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = MatMult; return 0; } - isinstance = PyObject_IsInstance(obj, state->Div_type); + isinstance = PyObject_IsInstance(obj, state->Div_type); if (isinstance == -1) { return 1; } @@ -9176,7 +9176,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Div; return 0; } - isinstance = PyObject_IsInstance(obj, state->Mod_type); + isinstance = PyObject_IsInstance(obj, state->Mod_type); if (isinstance == -1) { return 1; } @@ -9184,7 +9184,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Mod; return 0; } - isinstance = PyObject_IsInstance(obj, state->Pow_type); + isinstance = PyObject_IsInstance(obj, state->Pow_type); if (isinstance == -1) { return 1; } @@ -9192,7 +9192,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = Pow; return 0; } - isinstance = PyObject_IsInstance(obj, state->LShift_type); + isinstance = PyObject_IsInstance(obj, state->LShift_type); if (isinstance == -1) { return 1; } @@ -9200,7 +9200,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = LShift; return 0; } - isinstance = PyObject_IsInstance(obj, state->RShift_type); + isinstance = PyObject_IsInstance(obj, state->RShift_type); if (isinstance == -1) { return 1; } @@ -9208,7 +9208,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = RShift; return 0; } - isinstance = PyObject_IsInstance(obj, state->BitOr_type); + isinstance = PyObject_IsInstance(obj, state->BitOr_type); if (isinstance == -1) { return 1; } @@ -9216,7 +9216,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = BitOr; return 0; } - isinstance = PyObject_IsInstance(obj, state->BitXor_type); + isinstance = PyObject_IsInstance(obj, state->BitXor_type); if (isinstance == -1) { return 1; } @@ -9224,7 +9224,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = BitXor; return 0; } - isinstance = PyObject_IsInstance(obj, state->BitAnd_type); + isinstance = PyObject_IsInstance(obj, state->BitAnd_type); if (isinstance == -1) { return 1; } @@ -9232,7 +9232,7 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, *out = BitAnd; return 0; } - isinstance = PyObject_IsInstance(obj, state->FloorDiv_type); + isinstance = PyObject_IsInstance(obj, state->FloorDiv_type); if (isinstance == -1) { return 1; } @@ -9246,12 +9246,12 @@ obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, } int -obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* - arena) +obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, state->Invert_type); + isinstance = PyObject_IsInstance(obj, state->Invert_type); if (isinstance == -1) { return 1; } @@ -9259,7 +9259,7 @@ obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* *out = Invert; return 0; } - isinstance = PyObject_IsInstance(obj, state->Not_type); + isinstance = PyObject_IsInstance(obj, state->Not_type); if (isinstance == -1) { return 1; } @@ -9267,7 +9267,7 @@ obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* *out = Not; return 0; } - isinstance = PyObject_IsInstance(obj, state->UAdd_type); + isinstance = PyObject_IsInstance(obj, state->UAdd_type); if (isinstance == -1) { return 1; } @@ -9275,7 +9275,7 @@ obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* *out = UAdd; return 0; } - isinstance = PyObject_IsInstance(obj, state->USub_type); + isinstance = PyObject_IsInstance(obj, state->USub_type); if (isinstance == -1) { return 1; } @@ -9289,12 +9289,12 @@ obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* } int -obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* - arena) +obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, state->Eq_type); + isinstance = PyObject_IsInstance(obj, state->Eq_type); if (isinstance == -1) { return 1; } @@ -9302,7 +9302,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = Eq; return 0; } - isinstance = PyObject_IsInstance(obj, state->NotEq_type); + isinstance = PyObject_IsInstance(obj, state->NotEq_type); if (isinstance == -1) { return 1; } @@ -9310,7 +9310,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = NotEq; return 0; } - isinstance = PyObject_IsInstance(obj, state->Lt_type); + isinstance = PyObject_IsInstance(obj, state->Lt_type); if (isinstance == -1) { return 1; } @@ -9318,7 +9318,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = Lt; return 0; } - isinstance = PyObject_IsInstance(obj, state->LtE_type); + isinstance = PyObject_IsInstance(obj, state->LtE_type); if (isinstance == -1) { return 1; } @@ -9326,7 +9326,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = LtE; return 0; } - isinstance = PyObject_IsInstance(obj, state->Gt_type); + isinstance = PyObject_IsInstance(obj, state->Gt_type); if (isinstance == -1) { return 1; } @@ -9334,7 +9334,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = Gt; return 0; } - isinstance = PyObject_IsInstance(obj, state->GtE_type); + isinstance = PyObject_IsInstance(obj, state->GtE_type); if (isinstance == -1) { return 1; } @@ -9342,7 +9342,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = GtE; return 0; } - isinstance = PyObject_IsInstance(obj, state->Is_type); + isinstance = PyObject_IsInstance(obj, state->Is_type); if (isinstance == -1) { return 1; } @@ -9350,7 +9350,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = Is; return 0; } - isinstance = PyObject_IsInstance(obj, state->IsNot_type); + isinstance = PyObject_IsInstance(obj, state->IsNot_type); if (isinstance == -1) { return 1; } @@ -9358,7 +9358,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = IsNot; return 0; } - isinstance = PyObject_IsInstance(obj, state->In_type); + isinstance = PyObject_IsInstance(obj, state->In_type); if (isinstance == -1) { return 1; } @@ -9366,7 +9366,7 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* *out = In; return 0; } - isinstance = PyObject_IsInstance(obj, state->NotIn_type); + isinstance = PyObject_IsInstance(obj, state->NotIn_type); if (isinstance == -1) { return 1; } @@ -9380,8 +9380,8 @@ obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* } int -obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* - out, PyArena* arena) +obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* + out, PyArena* arena) { PyObject* tmp = NULL; expr_ty target; @@ -9389,7 +9389,7 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* asdl_seq* ifs; int is_async; - if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9398,15 +9398,15 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &target, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &target, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9415,15 +9415,15 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &iter, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &iter, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->ifs, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ifs, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9435,7 +9435,7 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "comprehension field \"ifs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "comprehension field \"ifs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9443,14 +9443,14 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* if (ifs == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "comprehension field \"ifs\" changed size during iteration"); @@ -9460,7 +9460,7 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->is_async, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->is_async, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9469,11 +9469,11 @@ obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &is_async, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'comprehension' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &is_async, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9485,23 +9485,23 @@ failed: } int -obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* - out, PyArena* arena) +obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* + out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; - PyObject *tp; + PyObject *tp; int lineno; int col_offset; - int end_lineno; - int end_col_offset; + int end_lineno; + int end_col_offset; if (obj == Py_None) { *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9510,15 +9510,15 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9527,50 +9527,50 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &col_offset, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_lineno, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_lineno = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_col_offset = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - tp = state->ExceptHandler_type; - isinstance = PyObject_IsInstance(obj, tp); + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'excepthandler' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + tp = state->ExceptHandler_type; + isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; } @@ -9579,7 +9579,7 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* identifier name; asdl_seq* body; - if (_PyObject_LookupAttr(obj, state->type, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9588,15 +9588,15 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &type, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &type, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9605,15 +9605,15 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &name, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &name, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9625,7 +9625,7 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "ExceptHandler field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "ExceptHandler field \"body\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9633,14 +9633,14 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* if (body == NULL) goto failed; for (i = 0; i < len; i++) { stmt_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { - goto failed; - } - res = obj2ast_stmt(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'ExceptHandler' node")) { + goto failed; + } + res = obj2ast_stmt(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "ExceptHandler field \"body\" changed size during iteration"); @@ -9650,8 +9650,8 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } Py_CLEAR(tmp); } - *out = ExceptHandler(type, name, body, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = ExceptHandler(type, name, body, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -9663,11 +9663,11 @@ obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* } int -obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, - PyArena* arena) +obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, + PyArena* arena) { PyObject* tmp = NULL; - asdl_seq* posonlyargs; + asdl_seq* posonlyargs; asdl_seq* args; arg_ty vararg; asdl_seq* kwonlyargs; @@ -9675,44 +9675,44 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, arg_ty kwarg; asdl_seq* defaults; - if (_PyObject_LookupAttr(obj, state->posonlyargs, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"posonlyargs\" missing from arguments"); - return 1; - } - else { - int res; - Py_ssize_t len; - Py_ssize_t i; - if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "arguments field \"posonlyargs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); - goto failed; - } - len = PyList_GET_SIZE(tmp); - posonlyargs = _Py_asdl_seq_new(len, arena); - if (posonlyargs == NULL) goto failed; - for (i = 0; i < len; i++) { - arg_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_arg(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); - if (res != 0) goto failed; - if (len != PyList_GET_SIZE(tmp)) { - PyErr_SetString(PyExc_RuntimeError, "arguments field \"posonlyargs\" changed size during iteration"); - goto failed; - } - asdl_seq_SET(posonlyargs, i, val); - } - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->posonlyargs, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"posonlyargs\" missing from arguments"); + return 1; + } + else { + int res; + Py_ssize_t len; + Py_ssize_t i; + if (!PyList_Check(tmp)) { + PyErr_Format(PyExc_TypeError, "arguments field \"posonlyargs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + goto failed; + } + len = PyList_GET_SIZE(tmp); + posonlyargs = _Py_asdl_seq_new(len, arena); + if (posonlyargs == NULL) goto failed; + for (i = 0; i < len; i++) { + arg_ty val; + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_arg(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); + if (res != 0) goto failed; + if (len != PyList_GET_SIZE(tmp)) { + PyErr_SetString(PyExc_RuntimeError, "arguments field \"posonlyargs\" changed size during iteration"); + goto failed; + } + asdl_seq_SET(posonlyargs, i, val); + } + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9724,7 +9724,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "arguments field \"args\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "arguments field \"args\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9732,14 +9732,14 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, if (args == NULL) goto failed; for (i = 0; i < len; i++) { arg_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_arg(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_arg(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "arguments field \"args\" changed size during iteration"); @@ -9749,7 +9749,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->vararg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->vararg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9758,15 +9758,15 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_arg(state, tmp, &vararg, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_arg(state, tmp, &vararg, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->kwonlyargs, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kwonlyargs, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9778,7 +9778,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "arguments field \"kwonlyargs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "arguments field \"kwonlyargs\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9786,14 +9786,14 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, if (kwonlyargs == NULL) goto failed; for (i = 0; i < len; i++) { arg_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_arg(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_arg(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "arguments field \"kwonlyargs\" changed size during iteration"); @@ -9803,7 +9803,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->kw_defaults, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kw_defaults, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9815,7 +9815,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "arguments field \"kw_defaults\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "arguments field \"kw_defaults\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9823,14 +9823,14 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, if (kw_defaults == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "arguments field \"kw_defaults\" changed size during iteration"); @@ -9840,7 +9840,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->kwarg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kwarg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9849,15 +9849,15 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_arg(state, tmp, &kwarg, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_arg(state, tmp, &kwarg, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->defaults, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->defaults, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9869,7 +9869,7 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, Py_ssize_t len; Py_ssize_t i; if (!PyList_Check(tmp)) { - PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); + PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", _PyType_Name(Py_TYPE(tmp))); goto failed; } len = PyList_GET_SIZE(tmp); @@ -9877,14 +9877,14 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, if (defaults == NULL) goto failed; for (i = 0; i < len; i++) { expr_ty val; - PyObject *tmp2 = PyList_GET_ITEM(tmp, i); - Py_INCREF(tmp2); - if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp2, &val, arena); - Py_LeaveRecursiveCall(); - Py_DECREF(tmp2); + PyObject *tmp2 = PyList_GET_ITEM(tmp, i); + Py_INCREF(tmp2); + if (Py_EnterRecursiveCall(" while traversing 'arguments' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp2, &val, arena); + Py_LeaveRecursiveCall(); + Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { PyErr_SetString(PyExc_RuntimeError, "arguments field \"defaults\" changed size during iteration"); @@ -9894,8 +9894,8 @@ obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, } Py_CLEAR(tmp); } - *out = arguments(posonlyargs, args, vararg, kwonlyargs, kw_defaults, kwarg, - defaults, arena); + *out = arguments(posonlyargs, args, vararg, kwonlyargs, kw_defaults, kwarg, + defaults, arena); return 0; failed: Py_XDECREF(tmp); @@ -9903,18 +9903,18 @@ failed: } int -obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) +obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) { PyObject* tmp = NULL; identifier arg; expr_ty annotation; - string type_comment; + string type_comment; int lineno; int col_offset; - int end_lineno; - int end_col_offset; + int end_lineno; + int end_col_offset; - if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9923,15 +9923,15 @@ obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &arg, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &arg, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9940,32 +9940,32 @@ obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &annotation, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &annotation, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + type_comment = NULL; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &type_comment, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - type_comment = NULL; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &type_comment, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9974,15 +9974,15 @@ obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9991,50 +9991,50 @@ obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &col_offset, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &col_offset, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_lineno = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_col_offset = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = arg(arg, annotation, type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'arg' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = arg(arg, annotation, type_comment, lineno, col_offset, end_lineno, + end_col_offset, arena); return 0; failed: Py_XDECREF(tmp); @@ -10042,18 +10042,18 @@ failed: } int -obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* out, PyArena* - arena) +obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* out, PyArena* + arena) { PyObject* tmp = NULL; identifier arg; expr_ty value; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; - if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -10062,15 +10062,15 @@ obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* out, PyArena* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &arg, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &arg, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -10079,84 +10079,84 @@ obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* out, PyArena* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &value, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &value, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from keyword"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from keyword"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &col_offset, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from keyword"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from keyword"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_lineno = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { - return 1; - } - if (tmp == NULL || tmp == Py_None) { - Py_CLEAR(tmp); - end_col_offset = 0; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &end_col_offset, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = keyword(arg, value, lineno, col_offset, end_lineno, end_col_offset, - arena); + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'keyword' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &end_col_offset, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = keyword(arg, value, lineno, col_offset, end_lineno, end_col_offset, + arena); return 0; failed: Py_XDECREF(tmp); @@ -10164,14 +10164,14 @@ failed: } int -obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, PyArena* - arena) +obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, PyArena* + arena) { PyObject* tmp = NULL; identifier name; identifier asname; - if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -10180,15 +10180,15 @@ obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, PyArena* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'alias' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &name, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'alias' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &name, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->asname, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->asname, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -10197,11 +10197,11 @@ obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, PyArena* } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'alias' node")) { - goto failed; - } - res = obj2ast_identifier(state, tmp, &asname, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'alias' node")) { + goto failed; + } + res = obj2ast_identifier(state, tmp, &asname, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -10213,14 +10213,14 @@ failed: } int -obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* out, - PyArena* arena) +obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* out, + PyArena* arena) { PyObject* tmp = NULL; expr_ty context_expr; expr_ty optional_vars; - if (_PyObject_LookupAttr(obj, state->context_expr, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->context_expr, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -10229,15 +10229,15 @@ obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* out, } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'withitem' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &context_expr, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'withitem' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &context_expr, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, state->optional_vars, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->optional_vars, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -10246,11 +10246,11 @@ obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* out, } else { int res; - if (Py_EnterRecursiveCall(" while traversing 'withitem' node")) { - goto failed; - } - res = obj2ast_expr(state, tmp, &optional_vars, arena); - Py_LeaveRecursiveCall(); + if (Py_EnterRecursiveCall(" while traversing 'withitem' node")) { + goto failed; + } + res = obj2ast_expr(state, tmp, &optional_vars, arena); + Py_LeaveRecursiveCall(); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -10261,568 +10261,568 @@ failed: return 1; } -int -obj2ast_type_ignore(astmodulestate *state, PyObject* obj, type_ignore_ty* out, - PyArena* arena) -{ - int isinstance; - - PyObject *tmp = NULL; - PyObject *tp; - - if (obj == Py_None) { - *out = NULL; - return 0; - } - tp = state->TypeIgnore_type; - isinstance = PyObject_IsInstance(obj, tp); - if (isinstance == -1) { - return 1; - } - if (isinstance) { - int lineno; - string tag; - - if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from TypeIgnore"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'TypeIgnore' node")) { - goto failed; - } - res = obj2ast_int(state, tmp, &lineno, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - if (_PyObject_LookupAttr(obj, state->tag, &tmp) < 0) { - return 1; - } - if (tmp == NULL) { - PyErr_SetString(PyExc_TypeError, "required field \"tag\" missing from TypeIgnore"); - return 1; - } - else { - int res; - if (Py_EnterRecursiveCall(" while traversing 'TypeIgnore' node")) { - goto failed; - } - res = obj2ast_string(state, tmp, &tag, arena); - Py_LeaveRecursiveCall(); - if (res != 0) goto failed; - Py_CLEAR(tmp); - } - *out = TypeIgnore(lineno, tag, arena); - if (*out == NULL) goto failed; - return 0; - } - - PyErr_Format(PyExc_TypeError, "expected some sort of type_ignore, but got %R", obj); - failed: - Py_XDECREF(tmp); - return 1; -} - - -static int -astmodule_exec(PyObject *m) -{ - astmodulestate *state = get_ast_state(m); - - if (!init_types(state)) { - return -1; - } - if (PyModule_AddObject(m, "AST", state->AST_type) < 0) { - return -1; - } - Py_INCREF(state->AST_type); - if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) { - return -1; - } - if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0) { - return -1; - } - if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) { - return -1; - } - if (PyModule_AddObject(m, "mod", state->mod_type) < 0) { - return -1; - } - Py_INCREF(state->mod_type); - if (PyModule_AddObject(m, "Module", state->Module_type) < 0) { - return -1; - } - Py_INCREF(state->Module_type); - if (PyModule_AddObject(m, "Interactive", state->Interactive_type) < 0) { - return -1; - } - Py_INCREF(state->Interactive_type); - if (PyModule_AddObject(m, "Expression", state->Expression_type) < 0) { - return -1; - } - Py_INCREF(state->Expression_type); - if (PyModule_AddObject(m, "FunctionType", state->FunctionType_type) < 0) { - return -1; - } - Py_INCREF(state->FunctionType_type); - if (PyModule_AddObject(m, "stmt", state->stmt_type) < 0) { - return -1; - } - Py_INCREF(state->stmt_type); - if (PyModule_AddObject(m, "FunctionDef", state->FunctionDef_type) < 0) { - return -1; - } - Py_INCREF(state->FunctionDef_type); - if (PyModule_AddObject(m, "AsyncFunctionDef", state->AsyncFunctionDef_type) - < 0) { - return -1; - } - Py_INCREF(state->AsyncFunctionDef_type); - if (PyModule_AddObject(m, "ClassDef", state->ClassDef_type) < 0) { - return -1; - } - Py_INCREF(state->ClassDef_type); - if (PyModule_AddObject(m, "Return", state->Return_type) < 0) { - return -1; - } - Py_INCREF(state->Return_type); - if (PyModule_AddObject(m, "Delete", state->Delete_type) < 0) { - return -1; - } - Py_INCREF(state->Delete_type); - if (PyModule_AddObject(m, "Assign", state->Assign_type) < 0) { - return -1; - } - Py_INCREF(state->Assign_type); - if (PyModule_AddObject(m, "AugAssign", state->AugAssign_type) < 0) { - return -1; - } - Py_INCREF(state->AugAssign_type); - if (PyModule_AddObject(m, "AnnAssign", state->AnnAssign_type) < 0) { - return -1; - } - Py_INCREF(state->AnnAssign_type); - if (PyModule_AddObject(m, "For", state->For_type) < 0) { - return -1; - } - Py_INCREF(state->For_type); - if (PyModule_AddObject(m, "AsyncFor", state->AsyncFor_type) < 0) { - return -1; - } - Py_INCREF(state->AsyncFor_type); - if (PyModule_AddObject(m, "While", state->While_type) < 0) { - return -1; - } - Py_INCREF(state->While_type); - if (PyModule_AddObject(m, "If", state->If_type) < 0) { - return -1; - } - Py_INCREF(state->If_type); - if (PyModule_AddObject(m, "With", state->With_type) < 0) { - return -1; - } - Py_INCREF(state->With_type); - if (PyModule_AddObject(m, "AsyncWith", state->AsyncWith_type) < 0) { - return -1; - } - Py_INCREF(state->AsyncWith_type); - if (PyModule_AddObject(m, "Raise", state->Raise_type) < 0) { - return -1; - } - Py_INCREF(state->Raise_type); - if (PyModule_AddObject(m, "Try", state->Try_type) < 0) { - return -1; - } - Py_INCREF(state->Try_type); - if (PyModule_AddObject(m, "Assert", state->Assert_type) < 0) { - return -1; - } - Py_INCREF(state->Assert_type); - if (PyModule_AddObject(m, "Import", state->Import_type) < 0) { - return -1; - } - Py_INCREF(state->Import_type); - if (PyModule_AddObject(m, "ImportFrom", state->ImportFrom_type) < 0) { - return -1; - } - Py_INCREF(state->ImportFrom_type); - if (PyModule_AddObject(m, "Global", state->Global_type) < 0) { - return -1; - } - Py_INCREF(state->Global_type); - if (PyModule_AddObject(m, "Nonlocal", state->Nonlocal_type) < 0) { - return -1; - } - Py_INCREF(state->Nonlocal_type); - if (PyModule_AddObject(m, "Expr", state->Expr_type) < 0) { - return -1; - } - Py_INCREF(state->Expr_type); - if (PyModule_AddObject(m, "Pass", state->Pass_type) < 0) { - return -1; - } - Py_INCREF(state->Pass_type); - if (PyModule_AddObject(m, "Break", state->Break_type) < 0) { - return -1; - } - Py_INCREF(state->Break_type); - if (PyModule_AddObject(m, "Continue", state->Continue_type) < 0) { - return -1; - } - Py_INCREF(state->Continue_type); - if (PyModule_AddObject(m, "expr", state->expr_type) < 0) { - return -1; - } - Py_INCREF(state->expr_type); - if (PyModule_AddObject(m, "BoolOp", state->BoolOp_type) < 0) { - return -1; - } - Py_INCREF(state->BoolOp_type); - if (PyModule_AddObject(m, "NamedExpr", state->NamedExpr_type) < 0) { - return -1; - } - Py_INCREF(state->NamedExpr_type); - if (PyModule_AddObject(m, "BinOp", state->BinOp_type) < 0) { - return -1; - } - Py_INCREF(state->BinOp_type); - if (PyModule_AddObject(m, "UnaryOp", state->UnaryOp_type) < 0) { - return -1; - } - Py_INCREF(state->UnaryOp_type); - if (PyModule_AddObject(m, "Lambda", state->Lambda_type) < 0) { - return -1; - } - Py_INCREF(state->Lambda_type); - if (PyModule_AddObject(m, "IfExp", state->IfExp_type) < 0) { - return -1; - } - Py_INCREF(state->IfExp_type); - if (PyModule_AddObject(m, "Dict", state->Dict_type) < 0) { - return -1; - } - Py_INCREF(state->Dict_type); - if (PyModule_AddObject(m, "Set", state->Set_type) < 0) { - return -1; - } - Py_INCREF(state->Set_type); - if (PyModule_AddObject(m, "ListComp", state->ListComp_type) < 0) { - return -1; - } - Py_INCREF(state->ListComp_type); - if (PyModule_AddObject(m, "SetComp", state->SetComp_type) < 0) { - return -1; - } - Py_INCREF(state->SetComp_type); - if (PyModule_AddObject(m, "DictComp", state->DictComp_type) < 0) { - return -1; - } - Py_INCREF(state->DictComp_type); - if (PyModule_AddObject(m, "GeneratorExp", state->GeneratorExp_type) < 0) { - return -1; - } - Py_INCREF(state->GeneratorExp_type); - if (PyModule_AddObject(m, "Await", state->Await_type) < 0) { - return -1; - } - Py_INCREF(state->Await_type); - if (PyModule_AddObject(m, "Yield", state->Yield_type) < 0) { - return -1; - } - Py_INCREF(state->Yield_type); - if (PyModule_AddObject(m, "YieldFrom", state->YieldFrom_type) < 0) { - return -1; - } - Py_INCREF(state->YieldFrom_type); - if (PyModule_AddObject(m, "Compare", state->Compare_type) < 0) { - return -1; - } - Py_INCREF(state->Compare_type); - if (PyModule_AddObject(m, "Call", state->Call_type) < 0) { - return -1; - } - Py_INCREF(state->Call_type); - if (PyModule_AddObject(m, "FormattedValue", state->FormattedValue_type) < - 0) { - return -1; - } - Py_INCREF(state->FormattedValue_type); - if (PyModule_AddObject(m, "JoinedStr", state->JoinedStr_type) < 0) { - return -1; - } - Py_INCREF(state->JoinedStr_type); - if (PyModule_AddObject(m, "Constant", state->Constant_type) < 0) { - return -1; - } - Py_INCREF(state->Constant_type); - if (PyModule_AddObject(m, "Attribute", state->Attribute_type) < 0) { - return -1; - } - Py_INCREF(state->Attribute_type); - if (PyModule_AddObject(m, "Subscript", state->Subscript_type) < 0) { - return -1; - } - Py_INCREF(state->Subscript_type); - if (PyModule_AddObject(m, "Starred", state->Starred_type) < 0) { - return -1; - } - Py_INCREF(state->Starred_type); - if (PyModule_AddObject(m, "Name", state->Name_type) < 0) { - return -1; - } - Py_INCREF(state->Name_type); - if (PyModule_AddObject(m, "List", state->List_type) < 0) { - return -1; - } - Py_INCREF(state->List_type); - if (PyModule_AddObject(m, "Tuple", state->Tuple_type) < 0) { - return -1; - } - Py_INCREF(state->Tuple_type); - if (PyModule_AddObject(m, "Slice", state->Slice_type) < 0) { - return -1; - } - Py_INCREF(state->Slice_type); - if (PyModule_AddObject(m, "expr_context", state->expr_context_type) < 0) { - return -1; - } - Py_INCREF(state->expr_context_type); - if (PyModule_AddObject(m, "Load", state->Load_type) < 0) { - return -1; - } - Py_INCREF(state->Load_type); - if (PyModule_AddObject(m, "Store", state->Store_type) < 0) { - return -1; - } - Py_INCREF(state->Store_type); - if (PyModule_AddObject(m, "Del", state->Del_type) < 0) { - return -1; - } - Py_INCREF(state->Del_type); - if (PyModule_AddObject(m, "boolop", state->boolop_type) < 0) { - return -1; - } - Py_INCREF(state->boolop_type); - if (PyModule_AddObject(m, "And", state->And_type) < 0) { - return -1; - } - Py_INCREF(state->And_type); - if (PyModule_AddObject(m, "Or", state->Or_type) < 0) { - return -1; - } - Py_INCREF(state->Or_type); - if (PyModule_AddObject(m, "operator", state->operator_type) < 0) { - return -1; - } - Py_INCREF(state->operator_type); - if (PyModule_AddObject(m, "Add", state->Add_type) < 0) { - return -1; - } - Py_INCREF(state->Add_type); - if (PyModule_AddObject(m, "Sub", state->Sub_type) < 0) { - return -1; - } - Py_INCREF(state->Sub_type); - if (PyModule_AddObject(m, "Mult", state->Mult_type) < 0) { - return -1; - } - Py_INCREF(state->Mult_type); - if (PyModule_AddObject(m, "MatMult", state->MatMult_type) < 0) { - return -1; - } - Py_INCREF(state->MatMult_type); - if (PyModule_AddObject(m, "Div", state->Div_type) < 0) { - return -1; - } - Py_INCREF(state->Div_type); - if (PyModule_AddObject(m, "Mod", state->Mod_type) < 0) { - return -1; - } - Py_INCREF(state->Mod_type); - if (PyModule_AddObject(m, "Pow", state->Pow_type) < 0) { - return -1; - } - Py_INCREF(state->Pow_type); - if (PyModule_AddObject(m, "LShift", state->LShift_type) < 0) { - return -1; - } - Py_INCREF(state->LShift_type); - if (PyModule_AddObject(m, "RShift", state->RShift_type) < 0) { - return -1; - } - Py_INCREF(state->RShift_type); - if (PyModule_AddObject(m, "BitOr", state->BitOr_type) < 0) { - return -1; - } - Py_INCREF(state->BitOr_type); - if (PyModule_AddObject(m, "BitXor", state->BitXor_type) < 0) { - return -1; - } - Py_INCREF(state->BitXor_type); - if (PyModule_AddObject(m, "BitAnd", state->BitAnd_type) < 0) { - return -1; - } - Py_INCREF(state->BitAnd_type); - if (PyModule_AddObject(m, "FloorDiv", state->FloorDiv_type) < 0) { - return -1; - } - Py_INCREF(state->FloorDiv_type); - if (PyModule_AddObject(m, "unaryop", state->unaryop_type) < 0) { - return -1; - } - Py_INCREF(state->unaryop_type); - if (PyModule_AddObject(m, "Invert", state->Invert_type) < 0) { - return -1; - } - Py_INCREF(state->Invert_type); - if (PyModule_AddObject(m, "Not", state->Not_type) < 0) { - return -1; - } - Py_INCREF(state->Not_type); - if (PyModule_AddObject(m, "UAdd", state->UAdd_type) < 0) { - return -1; - } - Py_INCREF(state->UAdd_type); - if (PyModule_AddObject(m, "USub", state->USub_type) < 0) { - return -1; - } - Py_INCREF(state->USub_type); - if (PyModule_AddObject(m, "cmpop", state->cmpop_type) < 0) { - return -1; - } - Py_INCREF(state->cmpop_type); - if (PyModule_AddObject(m, "Eq", state->Eq_type) < 0) { - return -1; - } - Py_INCREF(state->Eq_type); - if (PyModule_AddObject(m, "NotEq", state->NotEq_type) < 0) { - return -1; - } - Py_INCREF(state->NotEq_type); - if (PyModule_AddObject(m, "Lt", state->Lt_type) < 0) { - return -1; - } - Py_INCREF(state->Lt_type); - if (PyModule_AddObject(m, "LtE", state->LtE_type) < 0) { - return -1; - } - Py_INCREF(state->LtE_type); - if (PyModule_AddObject(m, "Gt", state->Gt_type) < 0) { - return -1; - } - Py_INCREF(state->Gt_type); - if (PyModule_AddObject(m, "GtE", state->GtE_type) < 0) { - return -1; - } - Py_INCREF(state->GtE_type); - if (PyModule_AddObject(m, "Is", state->Is_type) < 0) { - return -1; - } - Py_INCREF(state->Is_type); - if (PyModule_AddObject(m, "IsNot", state->IsNot_type) < 0) { - return -1; - } - Py_INCREF(state->IsNot_type); - if (PyModule_AddObject(m, "In", state->In_type) < 0) { - return -1; - } - Py_INCREF(state->In_type); - if (PyModule_AddObject(m, "NotIn", state->NotIn_type) < 0) { - return -1; - } - Py_INCREF(state->NotIn_type); - if (PyModule_AddObject(m, "comprehension", state->comprehension_type) < 0) { - return -1; - } - Py_INCREF(state->comprehension_type); - if (PyModule_AddObject(m, "excepthandler", state->excepthandler_type) < 0) { - return -1; - } - Py_INCREF(state->excepthandler_type); - if (PyModule_AddObject(m, "ExceptHandler", state->ExceptHandler_type) < 0) { - return -1; - } - Py_INCREF(state->ExceptHandler_type); - if (PyModule_AddObject(m, "arguments", state->arguments_type) < 0) { - return -1; - } - Py_INCREF(state->arguments_type); - if (PyModule_AddObject(m, "arg", state->arg_type) < 0) { - return -1; - } - Py_INCREF(state->arg_type); - if (PyModule_AddObject(m, "keyword", state->keyword_type) < 0) { - return -1; - } - Py_INCREF(state->keyword_type); - if (PyModule_AddObject(m, "alias", state->alias_type) < 0) { - return -1; - } - Py_INCREF(state->alias_type); - if (PyModule_AddObject(m, "withitem", state->withitem_type) < 0) { - return -1; - } - Py_INCREF(state->withitem_type); - if (PyModule_AddObject(m, "type_ignore", state->type_ignore_type) < 0) { - return -1; - } - Py_INCREF(state->type_ignore_type); - if (PyModule_AddObject(m, "TypeIgnore", state->TypeIgnore_type) < 0) { - return -1; - } - Py_INCREF(state->TypeIgnore_type); - return 0; -} - -static PyModuleDef_Slot astmodule_slots[] = { - {Py_mod_exec, astmodule_exec}, - {0, NULL} -}; - +int +obj2ast_type_ignore(astmodulestate *state, PyObject* obj, type_ignore_ty* out, + PyArena* arena) +{ + int isinstance; + + PyObject *tmp = NULL; + PyObject *tp; + + if (obj == Py_None) { + *out = NULL; + return 0; + } + tp = state->TypeIgnore_type; + isinstance = PyObject_IsInstance(obj, tp); + if (isinstance == -1) { + return 1; + } + if (isinstance) { + int lineno; + string tag; + + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from TypeIgnore"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'TypeIgnore' node")) { + goto failed; + } + res = obj2ast_int(state, tmp, &lineno, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->tag, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"tag\" missing from TypeIgnore"); + return 1; + } + else { + int res; + if (Py_EnterRecursiveCall(" while traversing 'TypeIgnore' node")) { + goto failed; + } + res = obj2ast_string(state, tmp, &tag, arena); + Py_LeaveRecursiveCall(); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = TypeIgnore(lineno, tag, arena); + if (*out == NULL) goto failed; + return 0; + } + + PyErr_Format(PyExc_TypeError, "expected some sort of type_ignore, but got %R", obj); + failed: + Py_XDECREF(tmp); + return 1; +} + + +static int +astmodule_exec(PyObject *m) +{ + astmodulestate *state = get_ast_state(m); + + if (!init_types(state)) { + return -1; + } + if (PyModule_AddObject(m, "AST", state->AST_type) < 0) { + return -1; + } + Py_INCREF(state->AST_type); + if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) { + return -1; + } + if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0) { + return -1; + } + if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) { + return -1; + } + if (PyModule_AddObject(m, "mod", state->mod_type) < 0) { + return -1; + } + Py_INCREF(state->mod_type); + if (PyModule_AddObject(m, "Module", state->Module_type) < 0) { + return -1; + } + Py_INCREF(state->Module_type); + if (PyModule_AddObject(m, "Interactive", state->Interactive_type) < 0) { + return -1; + } + Py_INCREF(state->Interactive_type); + if (PyModule_AddObject(m, "Expression", state->Expression_type) < 0) { + return -1; + } + Py_INCREF(state->Expression_type); + if (PyModule_AddObject(m, "FunctionType", state->FunctionType_type) < 0) { + return -1; + } + Py_INCREF(state->FunctionType_type); + if (PyModule_AddObject(m, "stmt", state->stmt_type) < 0) { + return -1; + } + Py_INCREF(state->stmt_type); + if (PyModule_AddObject(m, "FunctionDef", state->FunctionDef_type) < 0) { + return -1; + } + Py_INCREF(state->FunctionDef_type); + if (PyModule_AddObject(m, "AsyncFunctionDef", state->AsyncFunctionDef_type) + < 0) { + return -1; + } + Py_INCREF(state->AsyncFunctionDef_type); + if (PyModule_AddObject(m, "ClassDef", state->ClassDef_type) < 0) { + return -1; + } + Py_INCREF(state->ClassDef_type); + if (PyModule_AddObject(m, "Return", state->Return_type) < 0) { + return -1; + } + Py_INCREF(state->Return_type); + if (PyModule_AddObject(m, "Delete", state->Delete_type) < 0) { + return -1; + } + Py_INCREF(state->Delete_type); + if (PyModule_AddObject(m, "Assign", state->Assign_type) < 0) { + return -1; + } + Py_INCREF(state->Assign_type); + if (PyModule_AddObject(m, "AugAssign", state->AugAssign_type) < 0) { + return -1; + } + Py_INCREF(state->AugAssign_type); + if (PyModule_AddObject(m, "AnnAssign", state->AnnAssign_type) < 0) { + return -1; + } + Py_INCREF(state->AnnAssign_type); + if (PyModule_AddObject(m, "For", state->For_type) < 0) { + return -1; + } + Py_INCREF(state->For_type); + if (PyModule_AddObject(m, "AsyncFor", state->AsyncFor_type) < 0) { + return -1; + } + Py_INCREF(state->AsyncFor_type); + if (PyModule_AddObject(m, "While", state->While_type) < 0) { + return -1; + } + Py_INCREF(state->While_type); + if (PyModule_AddObject(m, "If", state->If_type) < 0) { + return -1; + } + Py_INCREF(state->If_type); + if (PyModule_AddObject(m, "With", state->With_type) < 0) { + return -1; + } + Py_INCREF(state->With_type); + if (PyModule_AddObject(m, "AsyncWith", state->AsyncWith_type) < 0) { + return -1; + } + Py_INCREF(state->AsyncWith_type); + if (PyModule_AddObject(m, "Raise", state->Raise_type) < 0) { + return -1; + } + Py_INCREF(state->Raise_type); + if (PyModule_AddObject(m, "Try", state->Try_type) < 0) { + return -1; + } + Py_INCREF(state->Try_type); + if (PyModule_AddObject(m, "Assert", state->Assert_type) < 0) { + return -1; + } + Py_INCREF(state->Assert_type); + if (PyModule_AddObject(m, "Import", state->Import_type) < 0) { + return -1; + } + Py_INCREF(state->Import_type); + if (PyModule_AddObject(m, "ImportFrom", state->ImportFrom_type) < 0) { + return -1; + } + Py_INCREF(state->ImportFrom_type); + if (PyModule_AddObject(m, "Global", state->Global_type) < 0) { + return -1; + } + Py_INCREF(state->Global_type); + if (PyModule_AddObject(m, "Nonlocal", state->Nonlocal_type) < 0) { + return -1; + } + Py_INCREF(state->Nonlocal_type); + if (PyModule_AddObject(m, "Expr", state->Expr_type) < 0) { + return -1; + } + Py_INCREF(state->Expr_type); + if (PyModule_AddObject(m, "Pass", state->Pass_type) < 0) { + return -1; + } + Py_INCREF(state->Pass_type); + if (PyModule_AddObject(m, "Break", state->Break_type) < 0) { + return -1; + } + Py_INCREF(state->Break_type); + if (PyModule_AddObject(m, "Continue", state->Continue_type) < 0) { + return -1; + } + Py_INCREF(state->Continue_type); + if (PyModule_AddObject(m, "expr", state->expr_type) < 0) { + return -1; + } + Py_INCREF(state->expr_type); + if (PyModule_AddObject(m, "BoolOp", state->BoolOp_type) < 0) { + return -1; + } + Py_INCREF(state->BoolOp_type); + if (PyModule_AddObject(m, "NamedExpr", state->NamedExpr_type) < 0) { + return -1; + } + Py_INCREF(state->NamedExpr_type); + if (PyModule_AddObject(m, "BinOp", state->BinOp_type) < 0) { + return -1; + } + Py_INCREF(state->BinOp_type); + if (PyModule_AddObject(m, "UnaryOp", state->UnaryOp_type) < 0) { + return -1; + } + Py_INCREF(state->UnaryOp_type); + if (PyModule_AddObject(m, "Lambda", state->Lambda_type) < 0) { + return -1; + } + Py_INCREF(state->Lambda_type); + if (PyModule_AddObject(m, "IfExp", state->IfExp_type) < 0) { + return -1; + } + Py_INCREF(state->IfExp_type); + if (PyModule_AddObject(m, "Dict", state->Dict_type) < 0) { + return -1; + } + Py_INCREF(state->Dict_type); + if (PyModule_AddObject(m, "Set", state->Set_type) < 0) { + return -1; + } + Py_INCREF(state->Set_type); + if (PyModule_AddObject(m, "ListComp", state->ListComp_type) < 0) { + return -1; + } + Py_INCREF(state->ListComp_type); + if (PyModule_AddObject(m, "SetComp", state->SetComp_type) < 0) { + return -1; + } + Py_INCREF(state->SetComp_type); + if (PyModule_AddObject(m, "DictComp", state->DictComp_type) < 0) { + return -1; + } + Py_INCREF(state->DictComp_type); + if (PyModule_AddObject(m, "GeneratorExp", state->GeneratorExp_type) < 0) { + return -1; + } + Py_INCREF(state->GeneratorExp_type); + if (PyModule_AddObject(m, "Await", state->Await_type) < 0) { + return -1; + } + Py_INCREF(state->Await_type); + if (PyModule_AddObject(m, "Yield", state->Yield_type) < 0) { + return -1; + } + Py_INCREF(state->Yield_type); + if (PyModule_AddObject(m, "YieldFrom", state->YieldFrom_type) < 0) { + return -1; + } + Py_INCREF(state->YieldFrom_type); + if (PyModule_AddObject(m, "Compare", state->Compare_type) < 0) { + return -1; + } + Py_INCREF(state->Compare_type); + if (PyModule_AddObject(m, "Call", state->Call_type) < 0) { + return -1; + } + Py_INCREF(state->Call_type); + if (PyModule_AddObject(m, "FormattedValue", state->FormattedValue_type) < + 0) { + return -1; + } + Py_INCREF(state->FormattedValue_type); + if (PyModule_AddObject(m, "JoinedStr", state->JoinedStr_type) < 0) { + return -1; + } + Py_INCREF(state->JoinedStr_type); + if (PyModule_AddObject(m, "Constant", state->Constant_type) < 0) { + return -1; + } + Py_INCREF(state->Constant_type); + if (PyModule_AddObject(m, "Attribute", state->Attribute_type) < 0) { + return -1; + } + Py_INCREF(state->Attribute_type); + if (PyModule_AddObject(m, "Subscript", state->Subscript_type) < 0) { + return -1; + } + Py_INCREF(state->Subscript_type); + if (PyModule_AddObject(m, "Starred", state->Starred_type) < 0) { + return -1; + } + Py_INCREF(state->Starred_type); + if (PyModule_AddObject(m, "Name", state->Name_type) < 0) { + return -1; + } + Py_INCREF(state->Name_type); + if (PyModule_AddObject(m, "List", state->List_type) < 0) { + return -1; + } + Py_INCREF(state->List_type); + if (PyModule_AddObject(m, "Tuple", state->Tuple_type) < 0) { + return -1; + } + Py_INCREF(state->Tuple_type); + if (PyModule_AddObject(m, "Slice", state->Slice_type) < 0) { + return -1; + } + Py_INCREF(state->Slice_type); + if (PyModule_AddObject(m, "expr_context", state->expr_context_type) < 0) { + return -1; + } + Py_INCREF(state->expr_context_type); + if (PyModule_AddObject(m, "Load", state->Load_type) < 0) { + return -1; + } + Py_INCREF(state->Load_type); + if (PyModule_AddObject(m, "Store", state->Store_type) < 0) { + return -1; + } + Py_INCREF(state->Store_type); + if (PyModule_AddObject(m, "Del", state->Del_type) < 0) { + return -1; + } + Py_INCREF(state->Del_type); + if (PyModule_AddObject(m, "boolop", state->boolop_type) < 0) { + return -1; + } + Py_INCREF(state->boolop_type); + if (PyModule_AddObject(m, "And", state->And_type) < 0) { + return -1; + } + Py_INCREF(state->And_type); + if (PyModule_AddObject(m, "Or", state->Or_type) < 0) { + return -1; + } + Py_INCREF(state->Or_type); + if (PyModule_AddObject(m, "operator", state->operator_type) < 0) { + return -1; + } + Py_INCREF(state->operator_type); + if (PyModule_AddObject(m, "Add", state->Add_type) < 0) { + return -1; + } + Py_INCREF(state->Add_type); + if (PyModule_AddObject(m, "Sub", state->Sub_type) < 0) { + return -1; + } + Py_INCREF(state->Sub_type); + if (PyModule_AddObject(m, "Mult", state->Mult_type) < 0) { + return -1; + } + Py_INCREF(state->Mult_type); + if (PyModule_AddObject(m, "MatMult", state->MatMult_type) < 0) { + return -1; + } + Py_INCREF(state->MatMult_type); + if (PyModule_AddObject(m, "Div", state->Div_type) < 0) { + return -1; + } + Py_INCREF(state->Div_type); + if (PyModule_AddObject(m, "Mod", state->Mod_type) < 0) { + return -1; + } + Py_INCREF(state->Mod_type); + if (PyModule_AddObject(m, "Pow", state->Pow_type) < 0) { + return -1; + } + Py_INCREF(state->Pow_type); + if (PyModule_AddObject(m, "LShift", state->LShift_type) < 0) { + return -1; + } + Py_INCREF(state->LShift_type); + if (PyModule_AddObject(m, "RShift", state->RShift_type) < 0) { + return -1; + } + Py_INCREF(state->RShift_type); + if (PyModule_AddObject(m, "BitOr", state->BitOr_type) < 0) { + return -1; + } + Py_INCREF(state->BitOr_type); + if (PyModule_AddObject(m, "BitXor", state->BitXor_type) < 0) { + return -1; + } + Py_INCREF(state->BitXor_type); + if (PyModule_AddObject(m, "BitAnd", state->BitAnd_type) < 0) { + return -1; + } + Py_INCREF(state->BitAnd_type); + if (PyModule_AddObject(m, "FloorDiv", state->FloorDiv_type) < 0) { + return -1; + } + Py_INCREF(state->FloorDiv_type); + if (PyModule_AddObject(m, "unaryop", state->unaryop_type) < 0) { + return -1; + } + Py_INCREF(state->unaryop_type); + if (PyModule_AddObject(m, "Invert", state->Invert_type) < 0) { + return -1; + } + Py_INCREF(state->Invert_type); + if (PyModule_AddObject(m, "Not", state->Not_type) < 0) { + return -1; + } + Py_INCREF(state->Not_type); + if (PyModule_AddObject(m, "UAdd", state->UAdd_type) < 0) { + return -1; + } + Py_INCREF(state->UAdd_type); + if (PyModule_AddObject(m, "USub", state->USub_type) < 0) { + return -1; + } + Py_INCREF(state->USub_type); + if (PyModule_AddObject(m, "cmpop", state->cmpop_type) < 0) { + return -1; + } + Py_INCREF(state->cmpop_type); + if (PyModule_AddObject(m, "Eq", state->Eq_type) < 0) { + return -1; + } + Py_INCREF(state->Eq_type); + if (PyModule_AddObject(m, "NotEq", state->NotEq_type) < 0) { + return -1; + } + Py_INCREF(state->NotEq_type); + if (PyModule_AddObject(m, "Lt", state->Lt_type) < 0) { + return -1; + } + Py_INCREF(state->Lt_type); + if (PyModule_AddObject(m, "LtE", state->LtE_type) < 0) { + return -1; + } + Py_INCREF(state->LtE_type); + if (PyModule_AddObject(m, "Gt", state->Gt_type) < 0) { + return -1; + } + Py_INCREF(state->Gt_type); + if (PyModule_AddObject(m, "GtE", state->GtE_type) < 0) { + return -1; + } + Py_INCREF(state->GtE_type); + if (PyModule_AddObject(m, "Is", state->Is_type) < 0) { + return -1; + } + Py_INCREF(state->Is_type); + if (PyModule_AddObject(m, "IsNot", state->IsNot_type) < 0) { + return -1; + } + Py_INCREF(state->IsNot_type); + if (PyModule_AddObject(m, "In", state->In_type) < 0) { + return -1; + } + Py_INCREF(state->In_type); + if (PyModule_AddObject(m, "NotIn", state->NotIn_type) < 0) { + return -1; + } + Py_INCREF(state->NotIn_type); + if (PyModule_AddObject(m, "comprehension", state->comprehension_type) < 0) { + return -1; + } + Py_INCREF(state->comprehension_type); + if (PyModule_AddObject(m, "excepthandler", state->excepthandler_type) < 0) { + return -1; + } + Py_INCREF(state->excepthandler_type); + if (PyModule_AddObject(m, "ExceptHandler", state->ExceptHandler_type) < 0) { + return -1; + } + Py_INCREF(state->ExceptHandler_type); + if (PyModule_AddObject(m, "arguments", state->arguments_type) < 0) { + return -1; + } + Py_INCREF(state->arguments_type); + if (PyModule_AddObject(m, "arg", state->arg_type) < 0) { + return -1; + } + Py_INCREF(state->arg_type); + if (PyModule_AddObject(m, "keyword", state->keyword_type) < 0) { + return -1; + } + Py_INCREF(state->keyword_type); + if (PyModule_AddObject(m, "alias", state->alias_type) < 0) { + return -1; + } + Py_INCREF(state->alias_type); + if (PyModule_AddObject(m, "withitem", state->withitem_type) < 0) { + return -1; + } + Py_INCREF(state->withitem_type); + if (PyModule_AddObject(m, "type_ignore", state->type_ignore_type) < 0) { + return -1; + } + Py_INCREF(state->type_ignore_type); + if (PyModule_AddObject(m, "TypeIgnore", state->TypeIgnore_type) < 0) { + return -1; + } + Py_INCREF(state->TypeIgnore_type); + return 0; +} + +static PyModuleDef_Slot astmodule_slots[] = { + {Py_mod_exec, astmodule_exec}, + {0, NULL} +}; + static struct PyModuleDef _astmodule = { - PyModuleDef_HEAD_INIT, - .m_name = "_ast", - // The _ast module uses a global state (global_ast_state). - .m_size = 0, - .m_slots = astmodule_slots, + PyModuleDef_HEAD_INIT, + .m_name = "_ast", + // The _ast module uses a global state (global_ast_state). + .m_size = 0, + .m_slots = astmodule_slots, }; - + PyMODINIT_FUNC PyInit__ast(void) { - return PyModuleDef_Init(&_astmodule); + return PyModuleDef_Init(&_astmodule); } PyObject* PyAST_mod2obj(mod_ty t) { - astmodulestate *state = get_global_ast_state(); - if (state == NULL) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return NULL; - } - return ast2obj_mod(state, t); + } + return ast2obj_mod(state, t); } /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) { - const char * const req_name[] = {"Module", "Expression", "Interactive"}; + const char * const req_name[] = {"Module", "Expression", "Interactive"}; int isinstance; - if (PySys_Audit("compile", "OO", ast, Py_None) < 0) { - return NULL; - } - - astmodulestate *state = get_global_ast_state(); - PyObject *req_type[3]; - req_type[0] = state->Module_type; - req_type[1] = state->Expression_type; - req_type[2] = state->Interactive_type; + if (PySys_Audit("compile", "OO", ast, Py_None) < 0) { + return NULL; + } + + astmodulestate *state = get_global_ast_state(); + PyObject *req_type[3]; + req_type[0] = state->Module_type; + req_type[1] = state->Expression_type; + req_type[2] = state->Interactive_type; assert(0 <= mode && mode <= 2); @@ -10831,12 +10831,12 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) return NULL; if (!isinstance) { PyErr_Format(PyExc_TypeError, "expected %s node, got %.400s", - req_name[mode], _PyType_Name(Py_TYPE(ast))); + req_name[mode], _PyType_Name(Py_TYPE(ast))); return NULL; } - - mod_ty res = NULL; - if (obj2ast_mod(state, ast, &res, arena) != 0) + + mod_ty res = NULL; + if (obj2ast_mod(state, ast, &res, arena) != 0) return NULL; else return res; @@ -10844,11 +10844,11 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) int PyAST_Check(PyObject* obj) { - astmodulestate *state = get_global_ast_state(); - if (state == NULL) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return -1; - } - return PyObject_IsInstance(obj, state->AST_type); + } + return PyObject_IsInstance(obj, state->AST_type); } diff --git a/contrib/tools/python3/src/Python/_warnings.c b/contrib/tools/python3/src/Python/_warnings.c index 4d07ed72fb..91a78fe72b 100644 --- a/contrib/tools/python3/src/Python/_warnings.c +++ b/contrib/tools/python3/src/Python/_warnings.c @@ -1,9 +1,9 @@ #include "Python.h" -#include "pycore_initconfig.h" -#include "pycore_interp.h" // PyInterpreterState.warnings -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "frameobject.h" // PyFrame_GetBack() +#include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.warnings +#include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "frameobject.h" // PyFrame_GetBack() #include "clinic/_warnings.c.h" #define MODULE_NAME "_warnings" @@ -18,141 +18,141 @@ _Py_IDENTIFIER(default); _Py_IDENTIFIER(ignore); #endif - -/*************************************************************************/ - -typedef struct _warnings_runtime_state WarningsState; - -/* Forward declaration of the _warnings module definition. */ -static struct PyModuleDef warningsmodule; - -_Py_IDENTIFIER(__name__); - -/* Given a module object, get its per-module state. */ -static WarningsState * -warnings_get_state(void) -{ - PyThreadState *tstate = _PyThreadState_GET(); - if (tstate == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "warnings_get_state: could not identify " - "current interpreter"); - return NULL; - } - return &tstate->interp->warnings; -} - -/* Clear the given warnings module state. */ -static void -warnings_clear_state(WarningsState *st) -{ - Py_CLEAR(st->filters); - Py_CLEAR(st->once_registry); - Py_CLEAR(st->default_action); -} - -#ifndef Py_DEBUG -static PyObject * -create_filter(PyObject *category, _Py_Identifier *id, const char *modname) -{ - PyObject *modname_obj = NULL; - PyObject *action_str = _PyUnicode_FromId(id); - if (action_str == NULL) { - return NULL; - } - - /* Default to "no module name" for initial filter set */ - if (modname != NULL) { - modname_obj = PyUnicode_InternFromString(modname); - if (modname_obj == NULL) { - return NULL; - } - } else { - modname_obj = Py_None; - Py_INCREF(modname_obj); - } - - /* This assumes the line number is zero for now. */ - PyObject *filter = PyTuple_Pack(5, action_str, Py_None, - category, modname_obj, _PyLong_Zero); - Py_DECREF(modname_obj); - return filter; -} -#endif - -static PyObject * -init_filters(void) -{ -#ifdef Py_DEBUG - /* Py_DEBUG builds show all warnings by default */ - return PyList_New(0); -#else - /* Other builds ignore a number of warning categories by default */ - PyObject *filters = PyList_New(5); - if (filters == NULL) { - return NULL; - } - - size_t pos = 0; /* Post-incremented in each use. */ - PyList_SET_ITEM(filters, pos++, - create_filter(PyExc_DeprecationWarning, &PyId_default, "__main__")); - PyList_SET_ITEM(filters, pos++, - create_filter(PyExc_DeprecationWarning, &PyId_ignore, NULL)); - PyList_SET_ITEM(filters, pos++, - create_filter(PyExc_PendingDeprecationWarning, &PyId_ignore, NULL)); - PyList_SET_ITEM(filters, pos++, - create_filter(PyExc_ImportWarning, &PyId_ignore, NULL)); - PyList_SET_ITEM(filters, pos++, - create_filter(PyExc_ResourceWarning, &PyId_ignore, NULL)); - - for (size_t x = 0; x < pos; x++) { - if (PyList_GET_ITEM(filters, x) == NULL) { - Py_DECREF(filters); - return NULL; - } - } - return filters; -#endif -} - -/* Initialize the given warnings module state. */ + +/*************************************************************************/ + +typedef struct _warnings_runtime_state WarningsState; + +/* Forward declaration of the _warnings module definition. */ +static struct PyModuleDef warningsmodule; + +_Py_IDENTIFIER(__name__); + +/* Given a module object, get its per-module state. */ +static WarningsState * +warnings_get_state(void) +{ + PyThreadState *tstate = _PyThreadState_GET(); + if (tstate == NULL) { + _PyErr_SetString(tstate, PyExc_RuntimeError, + "warnings_get_state: could not identify " + "current interpreter"); + return NULL; + } + return &tstate->interp->warnings; +} + +/* Clear the given warnings module state. */ +static void +warnings_clear_state(WarningsState *st) +{ + Py_CLEAR(st->filters); + Py_CLEAR(st->once_registry); + Py_CLEAR(st->default_action); +} + +#ifndef Py_DEBUG +static PyObject * +create_filter(PyObject *category, _Py_Identifier *id, const char *modname) +{ + PyObject *modname_obj = NULL; + PyObject *action_str = _PyUnicode_FromId(id); + if (action_str == NULL) { + return NULL; + } + + /* Default to "no module name" for initial filter set */ + if (modname != NULL) { + modname_obj = PyUnicode_InternFromString(modname); + if (modname_obj == NULL) { + return NULL; + } + } else { + modname_obj = Py_None; + Py_INCREF(modname_obj); + } + + /* This assumes the line number is zero for now. */ + PyObject *filter = PyTuple_Pack(5, action_str, Py_None, + category, modname_obj, _PyLong_Zero); + Py_DECREF(modname_obj); + return filter; +} +#endif + +static PyObject * +init_filters(void) +{ +#ifdef Py_DEBUG + /* Py_DEBUG builds show all warnings by default */ + return PyList_New(0); +#else + /* Other builds ignore a number of warning categories by default */ + PyObject *filters = PyList_New(5); + if (filters == NULL) { + return NULL; + } + + size_t pos = 0; /* Post-incremented in each use. */ + PyList_SET_ITEM(filters, pos++, + create_filter(PyExc_DeprecationWarning, &PyId_default, "__main__")); + PyList_SET_ITEM(filters, pos++, + create_filter(PyExc_DeprecationWarning, &PyId_ignore, NULL)); + PyList_SET_ITEM(filters, pos++, + create_filter(PyExc_PendingDeprecationWarning, &PyId_ignore, NULL)); + PyList_SET_ITEM(filters, pos++, + create_filter(PyExc_ImportWarning, &PyId_ignore, NULL)); + PyList_SET_ITEM(filters, pos++, + create_filter(PyExc_ResourceWarning, &PyId_ignore, NULL)); + + for (size_t x = 0; x < pos; x++) { + if (PyList_GET_ITEM(filters, x) == NULL) { + Py_DECREF(filters); + return NULL; + } + } + return filters; +#endif +} + +/* Initialize the given warnings module state. */ +static int +warnings_init_state(WarningsState *st) +{ + if (st->filters == NULL) { + st->filters = init_filters(); + if (st->filters == NULL) { + goto error; + } + } + + if (st->once_registry == NULL) { + st->once_registry = PyDict_New(); + if (st->once_registry == NULL) { + goto error; + } + } + + if (st->default_action == NULL) { + st->default_action = PyUnicode_FromString("default"); + if (st->default_action == NULL) { + goto error; + } + } + + st->filters_version = 0; + + return 0; + +error: + warnings_clear_state(st); + return -1; +} + + +/*************************************************************************/ + static int -warnings_init_state(WarningsState *st) -{ - if (st->filters == NULL) { - st->filters = init_filters(); - if (st->filters == NULL) { - goto error; - } - } - - if (st->once_registry == NULL) { - st->once_registry = PyDict_New(); - if (st->once_registry == NULL) { - goto error; - } - } - - if (st->default_action == NULL) { - st->default_action = PyUnicode_FromString("default"); - if (st->default_action == NULL) { - goto error; - } - } - - st->filters_version = 0; - - return 0; - -error: - warnings_clear_state(st); - return -1; -} - - -/*************************************************************************/ - -static int check_matched(PyObject *obj, PyObject *arg) { PyObject *result; @@ -173,7 +173,7 @@ check_matched(PyObject *obj, PyObject *arg) } /* Otherwise assume a regex filter and call its match() method */ - result = _PyObject_CallMethodIdOneArg(obj, &PyId_match, arg); + result = _PyObject_CallMethodIdOneArg(obj, &PyId_match, arg); if (result == NULL) return -1; @@ -215,7 +215,7 @@ get_warnings_attr(_Py_Identifier *attr_id, int try_import) gone, then we can't even use PyImport_GetModule without triggering an interpreter abort. */ - if (!_PyInterpreterState_GET()->modules) { + if (!_PyInterpreterState_GET()->modules) { return NULL; } warnings_module = PyImport_GetModule(warnings_str); @@ -230,7 +230,7 @@ get_warnings_attr(_Py_Identifier *attr_id, int try_import) static PyObject * -get_once_registry(WarningsState *st) +get_once_registry(WarningsState *st) { PyObject *registry; _Py_IDENTIFIER(onceregistry); @@ -239,8 +239,8 @@ get_once_registry(WarningsState *st) if (registry == NULL) { if (PyErr_Occurred()) return NULL; - assert(st->once_registry); - return st->once_registry; + assert(st->once_registry); + return st->once_registry; } if (!PyDict_Check(registry)) { PyErr_Format(PyExc_TypeError, @@ -250,13 +250,13 @@ get_once_registry(WarningsState *st) Py_DECREF(registry); return NULL; } - Py_SETREF(st->once_registry, registry); + Py_SETREF(st->once_registry, registry); return registry; } static PyObject * -get_default_action(WarningsState *st) +get_default_action(WarningsState *st) { PyObject *default_action; _Py_IDENTIFIER(defaultaction); @@ -266,8 +266,8 @@ get_default_action(WarningsState *st) if (PyErr_Occurred()) { return NULL; } - assert(st->default_action); - return st->default_action; + assert(st->default_action); + return st->default_action; } if (!PyUnicode_Check(default_action)) { PyErr_Format(PyExc_TypeError, @@ -277,7 +277,7 @@ get_default_action(WarningsState *st) Py_DECREF(default_action); return NULL; } - Py_SETREF(st->default_action, default_action); + Py_SETREF(st->default_action, default_action); return default_action; } @@ -291,10 +291,10 @@ get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno, Py_ssize_t i; PyObject *warnings_filters; _Py_IDENTIFIER(filters); - WarningsState *st = warnings_get_state(); - if (st == NULL) { - return NULL; - } + WarningsState *st = warnings_get_state(); + if (st == NULL) { + return NULL; + } warnings_filters = get_warnings_attr(&PyId_filters, 0); if (warnings_filters == NULL) { @@ -302,17 +302,17 @@ get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno, return NULL; } else { - Py_SETREF(st->filters, warnings_filters); + Py_SETREF(st->filters, warnings_filters); } - PyObject *filters = st->filters; + PyObject *filters = st->filters; if (filters == NULL || !PyList_Check(filters)) { PyErr_SetString(PyExc_ValueError, MODULE_NAME ".filters must be a list"); return NULL; } - /* WarningsState.filters could change while we are iterating over it. */ + /* WarningsState.filters could change while we are iterating over it. */ for (i = 0; i < PyList_GET_SIZE(filters); i++) { PyObject *tmp_item, *action, *msg, *cat, *mod, *ln_obj; Py_ssize_t ln; @@ -373,7 +373,7 @@ get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno, Py_DECREF(tmp_item); } - action = get_default_action(st); + action = get_default_action(st); if (action != NULL) { Py_INCREF(Py_None); *item = Py_None; @@ -393,20 +393,20 @@ already_warned(PyObject *registry, PyObject *key, int should_set) if (key == NULL) return -1; - WarningsState *st = warnings_get_state(); - if (st == NULL) { - return -1; - } - version_obj = _PyDict_GetItemIdWithError(registry, &PyId_version); + WarningsState *st = warnings_get_state(); + if (st == NULL) { + return -1; + } + version_obj = _PyDict_GetItemIdWithError(registry, &PyId_version); if (version_obj == NULL || !PyLong_CheckExact(version_obj) - || PyLong_AsLong(version_obj) != st->filters_version) + || PyLong_AsLong(version_obj) != st->filters_version) { if (PyErr_Occurred()) { return -1; } PyDict_Clear(registry); - version_obj = PyLong_FromLong(st->filters_version); + version_obj = PyLong_FromLong(st->filters_version); if (version_obj == NULL) return -1; if (_PyDict_SetItemId(registry, &PyId_version, version_obj) < 0) { @@ -416,15 +416,15 @@ already_warned(PyObject *registry, PyObject *key, int should_set) Py_DECREF(version_obj); } else { - already_warned = PyDict_GetItemWithError(registry, key); + already_warned = PyDict_GetItemWithError(registry, key); if (already_warned != NULL) { int rc = PyObject_IsTrue(already_warned); if (rc != 0) return rc; } - else if (PyErr_Occurred()) { - return -1; - } + else if (PyErr_Occurred()) { + return -1; + } } /* This warning wasn't found in the registry, set it. */ @@ -439,7 +439,7 @@ normalize_module(PyObject *filename) { PyObject *module; int kind; - const void *data; + const void *data; Py_ssize_t len; len = PyUnicode_GetLength(filename); @@ -495,9 +495,9 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno); name = _PyObject_GetAttrId(category, &PyId___name__); - if (name == NULL) { + if (name == NULL) { goto error; - } + } f_stderr = _PySys_GetObjectId(&PyId_stderr); if (f_stderr == NULL) { @@ -523,7 +523,7 @@ show_warning(PyObject *filename, int lineno, PyObject *text, /* Print " source_line\n" */ if (sourceline) { int kind; - const void *data; + const void *data; Py_ssize_t i, len; Py_UCS4 ch; PyObject *truncated; @@ -599,7 +599,7 @@ call_show_warning(PyObject *category, PyObject *text, PyObject *message, if (msg == NULL) goto error; - res = PyObject_CallOneArg(show_fn, msg); + res = PyObject_CallOneArg(show_fn, msg); Py_DECREF(show_fn); Py_DECREF(msg); @@ -656,11 +656,11 @@ warn_explicit(PyObject *category, PyObject *message, text = PyObject_Str(message); if (text == NULL) goto cleanup; - category = (PyObject*)Py_TYPE(message); + category = (PyObject*)Py_TYPE(message); } else { text = message; - message = PyObject_CallOneArg(category, message); + message = PyObject_CallOneArg(category, message); if (message == NULL) goto cleanup; } @@ -712,15 +712,15 @@ warn_explicit(PyObject *category, PyObject *message, if (_PyUnicode_EqualToASCIIString(action, "once")) { if (registry == NULL || registry == Py_None) { - WarningsState *st = warnings_get_state(); - if (st == NULL) { - goto cleanup; - } - registry = get_once_registry(st); + WarningsState *st = warnings_get_state(); + if (st == NULL) { + goto cleanup; + } + registry = get_once_registry(st); if (registry == NULL) goto cleanup; } - /* WarningsState.once_registry[(text, category)] = 1 */ + /* WarningsState.once_registry[(text, category)] = 1 */ rc = update_registry(registry, text, category, 0); } else if (_PyUnicode_EqualToASCIIString(action, "module")) { @@ -782,21 +782,21 @@ is_internal_frame(PyFrameObject *frame) Py_INCREF(bootstrap_string); } - if (frame == NULL) { + if (frame == NULL) { + return 0; + } + + PyCodeObject *code = PyFrame_GetCode(frame); + PyObject *filename = code->co_filename; + Py_DECREF(code); + + if (filename == NULL) { return 0; } - - PyCodeObject *code = PyFrame_GetCode(frame); - PyObject *filename = code->co_filename; - Py_DECREF(code); - - if (filename == NULL) { - return 0; - } if (!PyUnicode_Check(filename)) { return 0; } - + contains = PyUnicode_Contains(filename, importlib_string); if (contains < 0) { return 0; @@ -818,9 +818,9 @@ static PyFrameObject * next_external_frame(PyFrameObject *frame) { do { - PyFrameObject *back = PyFrame_GetBack(frame); - Py_DECREF(frame); - frame = back; + PyFrameObject *back = PyFrame_GetBack(frame); + Py_DECREF(frame); + frame = back; } while (frame != NULL && is_internal_frame(frame)); return frame; @@ -832,19 +832,19 @@ static int setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, PyObject **module, PyObject **registry) { - _Py_IDENTIFIER(__warningregistry__); + _Py_IDENTIFIER(__warningregistry__); PyObject *globals; - /* Setup globals, filename and lineno. */ - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *f = PyThreadState_GetFrame(tstate); + /* Setup globals, filename and lineno. */ + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *f = PyThreadState_GetFrame(tstate); // Stack level comparisons to Python code is off by one as there is no // warnings-related stack level to avoid. if (stack_level <= 0 || is_internal_frame(f)) { while (--stack_level > 0 && f != NULL) { - PyFrameObject *back = PyFrame_GetBack(f); - Py_DECREF(f); - f = back; + PyFrameObject *back = PyFrame_GetBack(f); + Py_DECREF(f); + f = back; } } else { @@ -854,18 +854,18 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, } if (f == NULL) { - globals = _PyInterpreterState_GET()->sysdict; - *filename = PyUnicode_FromString("sys"); + globals = _PyInterpreterState_GET()->sysdict; + *filename = PyUnicode_FromString("sys"); *lineno = 1; } else { globals = f->f_globals; - PyCodeObject *code = PyFrame_GetCode(f); - *filename = code->co_filename; - Py_DECREF(code); - Py_INCREF(*filename); + PyCodeObject *code = PyFrame_GetCode(f); + *filename = code->co_filename; + Py_DECREF(code); + Py_INCREF(*filename); *lineno = PyFrame_GetLineNumber(f); - Py_DECREF(f); + Py_DECREF(f); } *module = NULL; @@ -873,18 +873,18 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, /* Setup registry. */ assert(globals != NULL); assert(PyDict_Check(globals)); - *registry = _PyDict_GetItemIdWithError(globals, &PyId___warningregistry__); + *registry = _PyDict_GetItemIdWithError(globals, &PyId___warningregistry__); if (*registry == NULL) { int rc; - if (_PyErr_Occurred(tstate)) { - goto handle_error; - } + if (_PyErr_Occurred(tstate)) { + goto handle_error; + } *registry = PyDict_New(); if (*registry == NULL) - goto handle_error; + goto handle_error; - rc = _PyDict_SetItemId(globals, &PyId___warningregistry__, *registry); + rc = _PyDict_SetItemId(globals, &PyId___warningregistry__, *registry); if (rc < 0) goto handle_error; } @@ -892,13 +892,13 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, Py_INCREF(*registry); /* Setup module. */ - *module = _PyDict_GetItemIdWithError(globals, &PyId___name__); + *module = _PyDict_GetItemIdWithError(globals, &PyId___name__); if (*module == Py_None || (*module != NULL && PyUnicode_Check(*module))) { Py_INCREF(*module); } - else if (_PyErr_Occurred(tstate)) { - goto handle_error; - } + else if (_PyErr_Occurred(tstate)) { + goto handle_error; + } else { *module = PyUnicode_FromString("<string>"); if (*module == NULL) @@ -910,7 +910,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, handle_error: Py_XDECREF(*registry); Py_XDECREF(*module); - Py_DECREF(*filename); + Py_DECREF(*filename); return 0; } @@ -925,7 +925,7 @@ get_category(PyObject *message, PyObject *category) return NULL; if (rc == 1) - category = (PyObject*)Py_TYPE(message); + category = (PyObject*)Py_TYPE(message); else if (category == NULL || category == Py_None) category = PyExc_UserWarning; @@ -1016,7 +1016,7 @@ get_source_line(PyObject *module_globals, int lineno) return NULL; } /* Call get_source() to get the source code. */ - source = PyObject_CallOneArg(get_source, module_name); + source = PyObject_CallOneArg(get_source, module_name); Py_DECREF(get_source); Py_DECREF(module_name); if (!source) { @@ -1085,11 +1085,11 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds) static PyObject * warnings_filters_mutated(PyObject *self, PyObject *args) { - WarningsState *st = warnings_get_state(); - if (st == NULL) { - return NULL; - } - st->filters_version++; + WarningsState *st = warnings_get_state(); + if (st == NULL) { + return NULL; + } + st->filters_version++; Py_RETURN_NONE; } @@ -1147,23 +1147,23 @@ PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, return res; } -static int -_PyErr_WarnFormat(PyObject *source, PyObject *category, Py_ssize_t stack_level, - const char *format, ...) -{ - int res; - va_list vargs; - -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - res = _PyErr_WarnFormatV(source, category, stack_level, format, vargs); - va_end(vargs); - return res; -} - +static int +_PyErr_WarnFormat(PyObject *source, PyObject *category, Py_ssize_t stack_level, + const char *format, ...) +{ + int res; + va_list vargs; + +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + res = _PyErr_WarnFormatV(source, category, stack_level, format, vargs); + va_end(vargs); + return res; +} + int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...) @@ -1200,7 +1200,7 @@ PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level) #undef PyErr_Warn -int +int PyErr_Warn(PyObject *category, const char *text) { return PyErr_WarnEx(category, text, 1); @@ -1320,7 +1320,7 @@ _PyErr_WarnUnawaitedCoroutine(PyObject *coro) int warned = 0; PyObject *fn = get_warnings_attr(&PyId__warn_unawaited_coroutine, 1); if (fn) { - PyObject *res = PyObject_CallOneArg(fn, coro); + PyObject *res = PyObject_CallOneArg(fn, coro); Py_DECREF(fn); if (res || PyErr_ExceptionMatches(PyExc_RuntimeWarning)) { warned = 1; @@ -1332,9 +1332,9 @@ _PyErr_WarnUnawaitedCoroutine(PyObject *coro) PyErr_WriteUnraisable(coro); } if (!warned) { - if (_PyErr_WarnFormat(coro, PyExc_RuntimeWarning, 1, - "coroutine '%S' was never awaited", - ((PyCoroObject *)coro)->cr_qualname) < 0) + if (_PyErr_WarnFormat(coro, PyExc_RuntimeWarning, 1, + "coroutine '%S' was never awaited", + ((PyCoroObject *)coro)->cr_qualname) < 0) { PyErr_WriteUnraisable(coro); } @@ -1342,11 +1342,11 @@ _PyErr_WarnUnawaitedCoroutine(PyObject *coro) } PyDoc_STRVAR(warn_explicit_doc, -"Low-level interface to warnings functionality."); +"Low-level interface to warnings functionality."); static PyMethodDef warnings_functions[] = { WARNINGS_WARN_METHODDEF - {"warn_explicit", (PyCFunction)(void(*)(void))warnings_warn_explicit, + {"warn_explicit", (PyCFunction)(void(*)(void))warnings_warn_explicit, METH_VARARGS | METH_KEYWORDS, warn_explicit_doc}, {"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS, NULL}, @@ -1358,73 +1358,73 @@ static PyMethodDef warnings_functions[] = { static struct PyModuleDef warningsmodule = { PyModuleDef_HEAD_INIT, - MODULE_NAME, /* m_name */ - warnings__doc__, /* m_doc */ - 0, /* m_size */ - warnings_functions, /* m_methods */ - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ + MODULE_NAME, /* m_name */ + warnings__doc__, /* m_doc */ + 0, /* m_size */ + warnings_functions, /* m_methods */ + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ }; -PyStatus -_PyWarnings_InitState(PyThreadState *tstate) -{ - if (warnings_init_state(&tstate->interp->warnings) < 0) { - return _PyStatus_ERR("can't initialize warnings"); - } - return _PyStatus_OK(); -} - - +PyStatus +_PyWarnings_InitState(PyThreadState *tstate) +{ + if (warnings_init_state(&tstate->interp->warnings) < 0) { + return _PyStatus_ERR("can't initialize warnings"); + } + return _PyStatus_OK(); +} + + PyMODINIT_FUNC _PyWarnings_Init(void) { PyObject *m; m = PyModule_Create(&warningsmodule); - if (m == NULL) { + if (m == NULL) { return NULL; - } + } - WarningsState *st = warnings_get_state(); - if (st == NULL) { - goto error; + WarningsState *st = warnings_get_state(); + if (st == NULL) { + goto error; + } + if (warnings_init_state(st) < 0) { + goto error; } - if (warnings_init_state(st) < 0) { - goto error; - } - Py_INCREF(st->filters); - if (PyModule_AddObject(m, "filters", st->filters) < 0) { - goto error; + Py_INCREF(st->filters); + if (PyModule_AddObject(m, "filters", st->filters) < 0) { + goto error; } - Py_INCREF(st->once_registry); - if (PyModule_AddObject(m, "_onceregistry", st->once_registry) < 0) { - goto error; + Py_INCREF(st->once_registry); + if (PyModule_AddObject(m, "_onceregistry", st->once_registry) < 0) { + goto error; + } + + Py_INCREF(st->default_action); + if (PyModule_AddObject(m, "_defaultaction", st->default_action) < 0) { + goto error; } - Py_INCREF(st->default_action); - if (PyModule_AddObject(m, "_defaultaction", st->default_action) < 0) { - goto error; - } - return m; - -error: - if (st != NULL) { - warnings_clear_state(st); - } - Py_DECREF(m); - return NULL; + +error: + if (st != NULL) { + warnings_clear_state(st); + } + Py_DECREF(m); + return NULL; +} + +// We need this to ensure that warnings still work until late in finalization. +void +_PyWarnings_Fini(PyInterpreterState *interp) +{ + warnings_clear_state(&interp->warnings); } - -// We need this to ensure that warnings still work until late in finalization. -void -_PyWarnings_Fini(PyInterpreterState *interp) -{ - warnings_clear_state(&interp->warnings); -} diff --git a/contrib/tools/python3/src/Python/ast.c b/contrib/tools/python3/src/Python/ast.c index cf9d61ccd2..6dd7059263 100644 --- a/contrib/tools/python3/src/Python/ast.c +++ b/contrib/tools/python3/src/Python/ast.c @@ -13,8 +13,8 @@ #include <assert.h> #include <stdbool.h> -#define MAXLEVEL 200 /* Max parentheses level */ - +#define MAXLEVEL 200 /* Max parentheses level */ + static int validate_stmts(asdl_seq *); static int validate_exprs(asdl_seq *, expr_context_ty, int); static int validate_nonempty_seq(asdl_seq *, const char *, const char *); @@ -22,28 +22,28 @@ static int validate_stmt(stmt_ty); static int validate_expr(expr_ty, expr_context_ty); static int -validate_name(PyObject *name) -{ - assert(PyUnicode_Check(name)); - static const char * const forbidden[] = { - "None", - "True", - "False", - NULL - }; - for (int i = 0; forbidden[i] != NULL; i++) { - if (_PyUnicode_EqualToASCIIString(name, forbidden[i])) { - PyErr_Format(PyExc_ValueError, "Name node can't be used with '%s' constant", forbidden[i]); - return 0; - } - } - return 1; -} - -static int +validate_name(PyObject *name) +{ + assert(PyUnicode_Check(name)); + static const char * const forbidden[] = { + "None", + "True", + "False", + NULL + }; + for (int i = 0; forbidden[i] != NULL; i++) { + if (_PyUnicode_EqualToASCIIString(name, forbidden[i])) { + PyErr_Format(PyExc_ValueError, "Name node can't be used with '%s' constant", forbidden[i]); + return 0; + } + } + return 1; +} + +static int validate_comprehension(asdl_seq *gens) { - Py_ssize_t i; + Py_ssize_t i; if (!asdl_seq_LEN(gens)) { PyErr_SetString(PyExc_ValueError, "comprehension with no generators"); return 0; @@ -61,7 +61,7 @@ validate_comprehension(asdl_seq *gens) static int validate_keywords(asdl_seq *keywords) { - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(keywords); i++) if (!validate_expr(((keyword_ty)asdl_seq_GET(keywords, i))->value, Load)) return 0; @@ -71,7 +71,7 @@ validate_keywords(asdl_seq *keywords) static int validate_args(asdl_seq *args) { - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(args); i++) { arg_ty arg = asdl_seq_GET(args, i); if (arg->annotation && !validate_expr(arg->annotation, Load)) @@ -98,9 +98,9 @@ expr_context_name(expr_context_ty ctx) static int validate_arguments(arguments_ty args) { - if (!validate_args(args->posonlyargs) || !validate_args(args->args)) { + if (!validate_args(args->posonlyargs) || !validate_args(args->args)) { return 0; - } + } if (args->vararg && args->vararg->annotation && !validate_expr(args->vararg->annotation, Load)) { return 0; @@ -111,7 +111,7 @@ validate_arguments(arguments_ty args) && !validate_expr(args->kwarg->annotation, Load)) { return 0; } - if (asdl_seq_LEN(args->defaults) > asdl_seq_LEN(args->posonlyargs) + asdl_seq_LEN(args->args)) { + if (asdl_seq_LEN(args->defaults) > asdl_seq_LEN(args->posonlyargs) + asdl_seq_LEN(args->args)) { PyErr_SetString(PyExc_ValueError, "more positional defaults than args on arguments"); return 0; } @@ -166,11 +166,11 @@ validate_constant(PyObject *value) return 1; } - if (!PyErr_Occurred()) { - PyErr_Format(PyExc_TypeError, - "got an invalid type in Constant: %s", - _PyType_Name(Py_TYPE(value))); - } + if (!PyErr_Occurred()) { + PyErr_Format(PyExc_TypeError, + "got an invalid type in Constant: %s", + _PyType_Name(Py_TYPE(value))); + } return 0; } @@ -192,9 +192,9 @@ validate_expr(expr_ty exp, expr_context_ty ctx) actual_ctx = exp->v.Starred.ctx; break; case Name_kind: - if (!validate_name(exp->v.Name.id)) { - return 0; - } + if (!validate_name(exp->v.Name.id)) { + return 0; + } actual_ctx = exp->v.Name.ctx; break; case List_kind: @@ -302,26 +302,26 @@ validate_expr(expr_ty exp, expr_context_ty ctx) case Attribute_kind: return validate_expr(exp->v.Attribute.value, Load); case Subscript_kind: - return validate_expr(exp->v.Subscript.slice, Load) && + return validate_expr(exp->v.Subscript.slice, Load) && validate_expr(exp->v.Subscript.value, Load); case Starred_kind: return validate_expr(exp->v.Starred.value, ctx); - case Slice_kind: - return (!exp->v.Slice.lower || validate_expr(exp->v.Slice.lower, Load)) && - (!exp->v.Slice.upper || validate_expr(exp->v.Slice.upper, Load)) && - (!exp->v.Slice.step || validate_expr(exp->v.Slice.step, Load)); + case Slice_kind: + return (!exp->v.Slice.lower || validate_expr(exp->v.Slice.lower, Load)) && + (!exp->v.Slice.upper || validate_expr(exp->v.Slice.upper, Load)) && + (!exp->v.Slice.step || validate_expr(exp->v.Slice.step, Load)); case List_kind: return validate_exprs(exp->v.List.elts, ctx, 0); case Tuple_kind: return validate_exprs(exp->v.Tuple.elts, ctx, 0); - case NamedExpr_kind: - return validate_expr(exp->v.NamedExpr.value, Load); - /* This last case doesn't have any checking. */ + case NamedExpr_kind: + return validate_expr(exp->v.NamedExpr.value, Load); + /* This last case doesn't have any checking. */ case Name_kind: return 1; } - PyErr_SetString(PyExc_SystemError, "unexpected expression"); - return 0; + PyErr_SetString(PyExc_SystemError, "unexpected expression"); + return 0; } static int @@ -349,7 +349,7 @@ validate_body(asdl_seq *body, const char *owner) static int validate_stmt(stmt_ty stmt) { - Py_ssize_t i; + Py_ssize_t i; switch (stmt->kind) { case FunctionDef_kind: return validate_body(stmt->v.FunctionDef.body, "FunctionDef") && @@ -491,7 +491,7 @@ validate_stmt(stmt_ty stmt) static int validate_stmts(asdl_seq *seq) { - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(seq); i++) { stmt_ty stmt = asdl_seq_GET(seq, i); if (stmt) { @@ -510,7 +510,7 @@ validate_stmts(asdl_seq *seq) static int validate_exprs(asdl_seq *exprs, expr_context_ty ctx, int null_ok) { - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(exprs); i++) { expr_ty expr = asdl_seq_GET(exprs, i); if (expr) { @@ -560,7 +560,7 @@ struct compiling { PyArena *c_arena; /* Arena for allocating memory. */ PyObject *c_filename; /* filename */ PyObject *c_normalize; /* Normalization function from unicodedata. */ - int c_feature_version; /* Latest minor version of Python for allowed features */ + int c_feature_version; /* Latest minor version of Python for allowed features */ }; static asdl_seq *seq_for_testlist(struct compiling *, const node *); @@ -576,12 +576,12 @@ static stmt_ty ast_for_with_stmt(struct compiling *, const node *, bool); static stmt_ty ast_for_for_stmt(struct compiling *, const node *, bool); /* Note different signature for ast_for_call */ -static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, - const node *, const node *, const node *); +static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, + const node *, const node *, const node *); static PyObject *parsenumber(struct compiling *, const char *); static expr_ty parsestrplus(struct compiling *, const node *n); -static void get_last_end_pos(asdl_seq *, int *, int *); +static void get_last_end_pos(asdl_seq *, int *, int *); #define COMP_GENEXP 0 #define COMP_LISTCOMP 1 @@ -616,7 +616,7 @@ new_identifier(const char *n, struct compiling *c) Py_DECREF(id); return NULL; } - PyObject *form = PyUnicode_InternFromString("NFKC"); + PyObject *form = PyUnicode_InternFromString("NFKC"); if (form == NULL) { Py_DECREF(id); return NULL; @@ -624,14 +624,14 @@ new_identifier(const char *n, struct compiling *c) PyObject *args[2] = {form, id}; id2 = _PyObject_FastCall(c->c_normalize, args, 2); Py_DECREF(id); - Py_DECREF(form); + Py_DECREF(form); if (!id2) return NULL; if (!PyUnicode_Check(id2)) { PyErr_Format(PyExc_TypeError, "unicodedata.normalize() must return a string, not " "%.200s", - _PyType_Name(Py_TYPE(id2))); + _PyType_Name(Py_TYPE(id2))); Py_DECREF(id2); return NULL; } @@ -648,25 +648,25 @@ new_identifier(const char *n, struct compiling *c) #define NEW_IDENTIFIER(n) new_identifier(STR(n), c) static int -ast_error(struct compiling *c, const node *n, const char *errmsg, ...) +ast_error(struct compiling *c, const node *n, const char *errmsg, ...) { PyObject *value, *errstr, *loc, *tmp; - va_list va; - - va_start(va, errmsg); - errstr = PyUnicode_FromFormatV(errmsg, va); - va_end(va); - if (!errstr) { - return 0; - } + va_list va; + + va_start(va, errmsg); + errstr = PyUnicode_FromFormatV(errmsg, va); + va_end(va); + if (!errstr) { + return 0; + } loc = PyErr_ProgramTextObject(c->c_filename, LINENO(n)); if (!loc) { Py_INCREF(Py_None); loc = Py_None; } - tmp = Py_BuildValue("(OiiN)", c->c_filename, LINENO(n), n->n_col_offset + 1, loc); - if (!tmp) { - Py_DECREF(errstr); + tmp = Py_BuildValue("(OiiN)", c->c_filename, LINENO(n), n->n_col_offset + 1, loc); + if (!tmp) { + Py_DECREF(errstr); return 0; } value = PyTuple_Pack(2, errstr, tmp); @@ -693,20 +693,20 @@ ast_error(struct compiling *c, const node *n, const char *errmsg, ...) small_stmt elements is returned. */ -static string -new_type_comment(const char *s, struct compiling *c) -{ - PyObject *res = PyUnicode_DecodeUTF8(s, strlen(s), NULL); - if (res == NULL) - return NULL; - if (PyArena_AddPyObject(c->c_arena, res) < 0) { - Py_DECREF(res); - return NULL; - } - return res; -} -#define NEW_TYPE_COMMENT(n) new_type_comment(STR(n), c) - +static string +new_type_comment(const char *s, struct compiling *c) +{ + PyObject *res = PyUnicode_DecodeUTF8(s, strlen(s), NULL); + if (res == NULL) + return NULL; + if (PyArena_AddPyObject(c->c_arena, res) < 0) { + Py_DECREF(res); + return NULL; + } + return res; +} +#define NEW_TYPE_COMMENT(n) new_type_comment(STR(n), c) + static int num_stmts(const node *n) { @@ -734,23 +734,23 @@ num_stmts(const node *n) case simple_stmt: return NCH(n) / 2; /* Divide by 2 to remove count of semi-colons */ case suite: - case func_body_suite: - /* func_body_suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ - /* suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT */ + case func_body_suite: + /* func_body_suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ + /* suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT */ if (NCH(n) == 1) return num_stmts(CHILD(n, 0)); else { - i = 2; + i = 2; l = 0; - if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) - i += 2; - for (; i < (NCH(n) - 1); i++) + if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) + i += 2; + for (; i < (NCH(n) - 1); i++) l += num_stmts(CHILD(n, i)); return l; } default: { - _Py_FatalErrorFormat(__func__, "Non-statement found: %d %d", - TYPE(n), NCH(n)); + _Py_FatalErrorFormat(__func__, "Non-statement found: %d %d", + TYPE(n), NCH(n)); } } Py_UNREACHABLE(); @@ -765,20 +765,20 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, { int i, j, k, num; asdl_seq *stmts = NULL; - asdl_seq *type_ignores = NULL; + asdl_seq *type_ignores = NULL; stmt_ty s; node *ch; struct compiling c; mod_ty res = NULL; - asdl_seq *argtypes = NULL; - expr_ty ret, arg; + asdl_seq *argtypes = NULL; + expr_ty ret, arg; c.c_arena = arena; /* borrowed reference */ c.c_filename = filename; c.c_normalize = NULL; - c.c_feature_version = flags && (flags->cf_flags & PyCF_ONLY_AST) ? - flags->cf_feature_version : PY_MINOR_VERSION; + c.c_feature_version = flags && (flags->cf_flags & PyCF_ONLY_AST) ? + flags->cf_feature_version : PY_MINOR_VERSION; if (TYPE(n) == encoding_decl) n = CHILD(n, 0); @@ -812,26 +812,26 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, } } } - - /* Type ignores are stored under the ENDMARKER in file_input. */ - ch = CHILD(n, NCH(n) - 1); - REQ(ch, ENDMARKER); - num = NCH(ch); - type_ignores = _Py_asdl_seq_new(num, arena); - if (!type_ignores) - goto out; - - for (i = 0; i < num; i++) { - string type_comment = new_type_comment(STR(CHILD(ch, i)), &c); - if (!type_comment) - goto out; - type_ignore_ty ti = TypeIgnore(LINENO(CHILD(ch, i)), type_comment, arena); - if (!ti) - goto out; - asdl_seq_SET(type_ignores, i, ti); - } - - res = Module(stmts, type_ignores, arena); + + /* Type ignores are stored under the ENDMARKER in file_input. */ + ch = CHILD(n, NCH(n) - 1); + REQ(ch, ENDMARKER); + num = NCH(ch); + type_ignores = _Py_asdl_seq_new(num, arena); + if (!type_ignores) + goto out; + + for (i = 0; i < num; i++) { + string type_comment = new_type_comment(STR(CHILD(ch, i)), &c); + if (!type_comment) + goto out; + type_ignore_ty ti = TypeIgnore(LINENO(CHILD(ch, i)), type_comment, arena); + if (!ti) + goto out; + asdl_seq_SET(type_ignores, i, ti); + } + + res = Module(stmts, type_ignores, arena); break; case eval_input: { expr_ty testlist_ast; @@ -849,7 +849,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, if (!stmts) goto out; asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, arena)); if (!asdl_seq_GET(stmts, 0)) goto out; @@ -883,46 +883,46 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, res = Interactive(stmts, arena); } break; - case func_type_input: - n = CHILD(n, 0); - REQ(n, func_type); - - if (TYPE(CHILD(n, 1)) == typelist) { - ch = CHILD(n, 1); - /* this is overly permissive -- we don't pay any attention to - * stars on the args -- just parse them into an ordered list */ - num = 0; - for (i = 0; i < NCH(ch); i++) { - if (TYPE(CHILD(ch, i)) == test) { - num++; - } - } - - argtypes = _Py_asdl_seq_new(num, arena); - if (!argtypes) - goto out; - - j = 0; - for (i = 0; i < NCH(ch); i++) { - if (TYPE(CHILD(ch, i)) == test) { - arg = ast_for_expr(&c, CHILD(ch, i)); - if (!arg) - goto out; - asdl_seq_SET(argtypes, j++, arg); - } - } - } - else { - argtypes = _Py_asdl_seq_new(0, arena); - if (!argtypes) - goto out; - } - - ret = ast_for_expr(&c, CHILD(n, NCH(n) - 1)); - if (!ret) - goto out; - res = FunctionType(argtypes, ret, arena); - break; + case func_type_input: + n = CHILD(n, 0); + REQ(n, func_type); + + if (TYPE(CHILD(n, 1)) == typelist) { + ch = CHILD(n, 1); + /* this is overly permissive -- we don't pay any attention to + * stars on the args -- just parse them into an ordered list */ + num = 0; + for (i = 0; i < NCH(ch); i++) { + if (TYPE(CHILD(ch, i)) == test) { + num++; + } + } + + argtypes = _Py_asdl_seq_new(num, arena); + if (!argtypes) + goto out; + + j = 0; + for (i = 0; i < NCH(ch); i++) { + if (TYPE(CHILD(ch, i)) == test) { + arg = ast_for_expr(&c, CHILD(ch, i)); + if (!arg) + goto out; + asdl_seq_SET(argtypes, j++, arg); + } + } + } + else { + argtypes = _Py_asdl_seq_new(0, arena); + if (!argtypes) + goto out; + } + + ret = ast_for_expr(&c, CHILD(n, NCH(n) - 1)); + if (!ret) + goto out; + res = FunctionType(argtypes, ret, arena); + break; default: PyErr_Format(PyExc_SystemError, "invalid node %d for PyAST_FromNode", TYPE(n)); @@ -954,7 +954,7 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename_str, */ static operator_ty -get_operator(struct compiling *c, const node *n) +get_operator(struct compiling *c, const node *n) { switch (TYPE(n)) { case VBAR: @@ -974,11 +974,11 @@ get_operator(struct compiling *c, const node *n) case STAR: return Mult; case AT: - if (c->c_feature_version < 5) { - ast_error(c, n, - "The '@' operator is only supported in Python 3.5 and greater"); - return (operator_ty)0; - } + if (c->c_feature_version < 5) { + ast_error(c, n, + "The '@' operator is only supported in Python 3.5 and greater"); + return (operator_ty)0; + } return MatMult; case SLASH: return Div; @@ -995,7 +995,7 @@ static const char * const FORBIDDEN[] = { "None", "True", "False", - "__debug__", + "__debug__", NULL, }; @@ -1004,107 +1004,107 @@ forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks) { assert(PyUnicode_Check(name)); - const char * const *p = FORBIDDEN; - if (!full_checks) { - /* In most cases, the parser will protect True, False, and None - from being assign to. */ - p += 3; - } - for (; *p; p++) { - if (_PyUnicode_EqualToASCIIString(name, *p)) { - ast_error(c, n, "cannot assign to %U", name); - return 1; + const char * const *p = FORBIDDEN; + if (!full_checks) { + /* In most cases, the parser will protect True, False, and None + from being assign to. */ + p += 3; + } + for (; *p; p++) { + if (_PyUnicode_EqualToASCIIString(name, *p)) { + ast_error(c, n, "cannot assign to %U", name); + return 1; } } return 0; } -static expr_ty -copy_location(expr_ty e, const node *n, const node *end) -{ - if (e) { - e->lineno = LINENO(n); - e->col_offset = n->n_col_offset; - e->end_lineno = end->n_end_lineno; - e->end_col_offset = end->n_end_col_offset; - } - return e; -} - -static const char * -get_expr_name(expr_ty e) -{ - switch (e->kind) { - case Attribute_kind: - return "attribute"; - case Subscript_kind: - return "subscript"; - case Starred_kind: - return "starred"; - case Name_kind: - return "name"; - case List_kind: - return "list"; - case Tuple_kind: - return "tuple"; - case Lambda_kind: - return "lambda"; - case Call_kind: - return "function call"; - case BoolOp_kind: - case BinOp_kind: - case UnaryOp_kind: - return "operator"; - case GeneratorExp_kind: - return "generator expression"; - case Yield_kind: - case YieldFrom_kind: - return "yield expression"; - case Await_kind: - return "await expression"; - case ListComp_kind: - return "list comprehension"; - case SetComp_kind: - return "set comprehension"; - case DictComp_kind: - return "dict comprehension"; - case Dict_kind: - return "dict display"; - case Set_kind: - return "set display"; - case JoinedStr_kind: - case FormattedValue_kind: - return "f-string expression"; - case Constant_kind: { - PyObject *value = e->v.Constant.value; - if (value == Py_None) { - return "None"; - } - if (value == Py_False) { - return "False"; - } - if (value == Py_True) { - return "True"; - } - if (value == Py_Ellipsis) { - return "Ellipsis"; - } - return "literal"; - } - case Compare_kind: - return "comparison"; - case IfExp_kind: - return "conditional expression"; - case NamedExpr_kind: - return "named expression"; - default: - PyErr_Format(PyExc_SystemError, - "unexpected expression in assignment %d (line %d)", - e->kind, e->lineno); - return NULL; - } -} - +static expr_ty +copy_location(expr_ty e, const node *n, const node *end) +{ + if (e) { + e->lineno = LINENO(n); + e->col_offset = n->n_col_offset; + e->end_lineno = end->n_end_lineno; + e->end_col_offset = end->n_end_col_offset; + } + return e; +} + +static const char * +get_expr_name(expr_ty e) +{ + switch (e->kind) { + case Attribute_kind: + return "attribute"; + case Subscript_kind: + return "subscript"; + case Starred_kind: + return "starred"; + case Name_kind: + return "name"; + case List_kind: + return "list"; + case Tuple_kind: + return "tuple"; + case Lambda_kind: + return "lambda"; + case Call_kind: + return "function call"; + case BoolOp_kind: + case BinOp_kind: + case UnaryOp_kind: + return "operator"; + case GeneratorExp_kind: + return "generator expression"; + case Yield_kind: + case YieldFrom_kind: + return "yield expression"; + case Await_kind: + return "await expression"; + case ListComp_kind: + return "list comprehension"; + case SetComp_kind: + return "set comprehension"; + case DictComp_kind: + return "dict comprehension"; + case Dict_kind: + return "dict display"; + case Set_kind: + return "set display"; + case JoinedStr_kind: + case FormattedValue_kind: + return "f-string expression"; + case Constant_kind: { + PyObject *value = e->v.Constant.value; + if (value == Py_None) { + return "None"; + } + if (value == Py_False) { + return "False"; + } + if (value == Py_True) { + return "True"; + } + if (value == Py_Ellipsis) { + return "Ellipsis"; + } + return "literal"; + } + case Compare_kind: + return "comparison"; + case IfExp_kind: + return "conditional expression"; + case NamedExpr_kind: + return "named expression"; + default: + PyErr_Format(PyExc_SystemError, + "unexpected expression in assignment %d (line %d)", + e->kind, e->lineno); + return NULL; + } +} + /* Set the context ctx for expr_ty e, recursively traversing e. Only sets context for expr kinds that "can appear in assignment context" @@ -1117,7 +1117,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n) { asdl_seq *s = NULL; - /* Expressions in an augmented assignment have a Store context. */ + /* Expressions in an augmented assignment have a Store context. */ switch (e->kind) { case Attribute_kind: @@ -1148,22 +1148,22 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n) e->v.Tuple.ctx = ctx; s = e->v.Tuple.elts; break; - default: { - const char *expr_name = get_expr_name(e); - if (expr_name != NULL) { - ast_error(c, n, "cannot %s %s", - ctx == Store ? "assign to" : "delete", - expr_name); - } + default: { + const char *expr_name = get_expr_name(e); + if (expr_name != NULL) { + ast_error(c, n, "cannot %s %s", + ctx == Store ? "assign to" : "delete", + expr_name); + } return 0; - } + } } /* If the LHS is a list or tuple, we need to set the assignment context for all the contained elements. */ if (s) { - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(s); i++) { if (!set_context(c, (expr_ty)asdl_seq_GET(s, i), ctx, n)) @@ -1206,11 +1206,11 @@ ast_for_augassign(struct compiling *c, const node *n) else return Mult; case '@': - if (c->c_feature_version < 5) { - ast_error(c, n, - "The '@' operator is only supported in Python 3.5 and greater"); - return (operator_ty)0; - } + if (c->c_feature_version < 5) { + ast_error(c, n, + "The '@' operator is only supported in Python 3.5 and greater"); + return (operator_ty)0; + } return MatMult; default: PyErr_Format(PyExc_SystemError, "invalid augassign: %s", STR(n)); @@ -1289,7 +1289,7 @@ seq_for_testlist(struct compiling *c, const node *n) for (i = 0; i < NCH(n); i += 2) { const node *ch = CHILD(n, i); - assert(TYPE(ch) == test || TYPE(ch) == test_nocond || TYPE(ch) == star_expr || TYPE(ch) == namedexpr_test); + assert(TYPE(ch) == test || TYPE(ch) == test_nocond || TYPE(ch) == star_expr || TYPE(ch) == namedexpr_test); expression = ast_for_expr(c, ch); if (!expression) @@ -1323,8 +1323,8 @@ ast_for_arg(struct compiling *c, const node *n) return NULL; } - ret = arg(name, annotation, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + ret = arg(name, annotation, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); if (!ret) return NULL; return ret; @@ -1343,7 +1343,7 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start, PyObject *argname; node *ch; expr_ty expression, annotation; - arg_ty arg = NULL; + arg_ty arg = NULL; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ @@ -1382,23 +1382,23 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start, goto error; if (forbidden_name(c, argname, ch, 0)) goto error; - arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, - ch->n_end_lineno, ch->n_end_col_offset, + arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, + ch->n_end_lineno, ch->n_end_col_offset, c->c_arena); if (!arg) goto error; asdl_seq_SET(kwonlyargs, j++, arg); - i += 1; /* the name */ - if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) - i += 1; /* the comma, if present */ + i += 1; /* the name */ + if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) + i += 1; /* the comma, if present */ + break; + case TYPE_COMMENT: + /* arg will be equal to the last argument processed */ + arg->type_comment = NEW_TYPE_COMMENT(ch); + if (!arg->type_comment) + goto error; + i += 1; break; - case TYPE_COMMENT: - /* arg will be equal to the last argument processed */ - arg->type_comment = NEW_TYPE_COMMENT(ch); - if (!arg->type_comment) - goto error; - i += 1; - break; case DOUBLESTAR: return i; default: @@ -1420,73 +1420,73 @@ ast_for_arguments(struct compiling *c, const node *n) and varargslist (lambda definition). parameters: '(' [typedargslist] ')' - - The following definition for typedarglist is equivalent to this set of rules: - - arguments = argument (',' [TYPE_COMMENT] argument)* - argument = tfpdef ['=' test] - kwargs = '**' tfpdef [','] [TYPE_COMMENT] - args = '*' [tfpdef] - kwonly_kwargs = (',' [TYPE_COMMENT] argument)* (TYPE_COMMENT | [',' - [TYPE_COMMENT] [kwargs]]) - args_kwonly_kwargs = args kwonly_kwargs | kwargs - poskeyword_args_kwonly_kwargs = arguments ( TYPE_COMMENT | [',' - [TYPE_COMMENT] [args_kwonly_kwargs]]) - typedargslist_no_posonly = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs - typedarglist = (arguments ',' [TYPE_COMMENT] '/' [',' [[TYPE_COMMENT] - typedargslist_no_posonly]])|(typedargslist_no_posonly)" - - typedargslist: ( (tfpdef ['=' test] (',' [TYPE_COMMENT] tfpdef ['=' test])* - ',' [TYPE_COMMENT] '/' [',' [ [TYPE_COMMENT] tfpdef ['=' test] ( ',' - [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' [TYPE_COMMENT] [ '*' - [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' - [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | '**' tfpdef [','] - [TYPE_COMMENT]]]) | '*' [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* - (TYPE_COMMENT | [',' [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | - '**' tfpdef [','] [TYPE_COMMENT]]] ) | (tfpdef ['=' test] (',' - [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' [TYPE_COMMENT] [ '*' - [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' - [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | '**' tfpdef [','] - [TYPE_COMMENT]]]) | '*' [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* - (TYPE_COMMENT | [',' [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | - '**' tfpdef [','] [TYPE_COMMENT])) - + + The following definition for typedarglist is equivalent to this set of rules: + + arguments = argument (',' [TYPE_COMMENT] argument)* + argument = tfpdef ['=' test] + kwargs = '**' tfpdef [','] [TYPE_COMMENT] + args = '*' [tfpdef] + kwonly_kwargs = (',' [TYPE_COMMENT] argument)* (TYPE_COMMENT | [',' + [TYPE_COMMENT] [kwargs]]) + args_kwonly_kwargs = args kwonly_kwargs | kwargs + poskeyword_args_kwonly_kwargs = arguments ( TYPE_COMMENT | [',' + [TYPE_COMMENT] [args_kwonly_kwargs]]) + typedargslist_no_posonly = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs + typedarglist = (arguments ',' [TYPE_COMMENT] '/' [',' [[TYPE_COMMENT] + typedargslist_no_posonly]])|(typedargslist_no_posonly)" + + typedargslist: ( (tfpdef ['=' test] (',' [TYPE_COMMENT] tfpdef ['=' test])* + ',' [TYPE_COMMENT] '/' [',' [ [TYPE_COMMENT] tfpdef ['=' test] ( ',' + [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' [TYPE_COMMENT] [ '*' + [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' + [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | '**' tfpdef [','] + [TYPE_COMMENT]]]) | '*' [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* + (TYPE_COMMENT | [',' [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | + '**' tfpdef [','] [TYPE_COMMENT]]] ) | (tfpdef ['=' test] (',' + [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' [TYPE_COMMENT] [ '*' + [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* (TYPE_COMMENT | [',' + [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | '**' tfpdef [','] + [TYPE_COMMENT]]]) | '*' [tfpdef] (',' [TYPE_COMMENT] tfpdef ['=' test])* + (TYPE_COMMENT | [',' [TYPE_COMMENT] ['**' tfpdef [','] [TYPE_COMMENT]]]) | + '**' tfpdef [','] [TYPE_COMMENT])) + tfpdef: NAME [':' test] - - The following definition for varargslist is equivalent to this set of rules: - - arguments = argument (',' argument )* - argument = vfpdef ['=' test] - kwargs = '**' vfpdef [','] - args = '*' [vfpdef] - kwonly_kwargs = (',' argument )* [',' [kwargs]] - args_kwonly_kwargs = args kwonly_kwargs | kwargs - poskeyword_args_kwonly_kwargs = arguments [',' [args_kwonly_kwargs]] - vararglist_no_posonly = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs - varargslist = arguments ',' '/' [','[(vararglist_no_posonly)]] | - (vararglist_no_posonly) - - varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' - test] (',' vfpdef ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' - ['**' vfpdef [',']]] | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* - [',' ['**' vfpdef [',']]] | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef - ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] - | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef - [',']]] | '**' vfpdef [',']) - + + The following definition for varargslist is equivalent to this set of rules: + + arguments = argument (',' argument )* + argument = vfpdef ['=' test] + kwargs = '**' vfpdef [','] + args = '*' [vfpdef] + kwonly_kwargs = (',' argument )* [',' [kwargs]] + args_kwonly_kwargs = args kwonly_kwargs | kwargs + poskeyword_args_kwonly_kwargs = arguments [',' [args_kwonly_kwargs]] + vararglist_no_posonly = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs + varargslist = arguments ',' '/' [','[(vararglist_no_posonly)]] | + (vararglist_no_posonly) + + varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' + test] (',' vfpdef ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' + ['**' vfpdef [',']]] | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* + [',' ['**' vfpdef [',']]] | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef + ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef + [',']]] | '**' vfpdef [',']) + vfpdef: NAME */ - int i, j, k, l, nposonlyargs=0, nposargs = 0, nkwonlyargs = 0; + int i, j, k, l, nposonlyargs=0, nposargs = 0, nkwonlyargs = 0; int nposdefaults = 0, found_default = 0; - asdl_seq *posonlyargs, *posargs, *posdefaults, *kwonlyargs, *kwdefaults; + asdl_seq *posonlyargs, *posargs, *posdefaults, *kwonlyargs, *kwdefaults; arg_ty vararg = NULL, kwarg = NULL; - arg_ty arg = NULL; + arg_ty arg = NULL; node *ch; if (TYPE(n) == parameters) { if (NCH(n) == 2) /* () as argument list */ - return arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); + return arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); n = CHILD(n, 1); } assert(TYPE(n) == typedargslist || TYPE(n) == varargslist); @@ -1510,10 +1510,10 @@ ast_for_arguments(struct compiling *c, const node *n) if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++; if (TYPE(ch) == EQUAL) nposdefaults++; - if (TYPE(ch) == SLASH ) { - nposonlyargs = nposargs; - nposargs = 0; - } + if (TYPE(ch) == SLASH ) { + nposonlyargs = nposargs; + nposargs = 0; + } } /* count the number of keyword only args & defaults for keyword only args */ @@ -1522,10 +1522,10 @@ ast_for_arguments(struct compiling *c, const node *n) if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++; } - posonlyargs = (nposonlyargs ? _Py_asdl_seq_new(nposonlyargs, c->c_arena) : NULL); - if (!posonlyargs && nposonlyargs) { - return NULL; - } + posonlyargs = (nposonlyargs ? _Py_asdl_seq_new(nposonlyargs, c->c_arena) : NULL); + if (!posonlyargs && nposonlyargs) { + return NULL; + } posargs = (nposargs ? _Py_asdl_seq_new(nposargs, c->c_arena) : NULL); if (!posargs && nposargs) return NULL; @@ -1551,7 +1551,7 @@ ast_for_arguments(struct compiling *c, const node *n) i = 0; j = 0; /* index for defaults */ k = 0; /* index for args */ - l = 0; /* index for posonlyargs */ + l = 0; /* index for posonlyargs */ while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { @@ -1571,48 +1571,48 @@ ast_for_arguments(struct compiling *c, const node *n) } else if (found_default) { ast_error(c, n, - "non-default argument follows default argument"); + "non-default argument follows default argument"); return NULL; } arg = ast_for_arg(c, ch); if (!arg) return NULL; - if (l < nposonlyargs) { - asdl_seq_SET(posonlyargs, l++, arg); - } else { - asdl_seq_SET(posargs, k++, arg); - } - i += 1; /* the name */ - if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) - i += 1; /* the comma, if present */ + if (l < nposonlyargs) { + asdl_seq_SET(posonlyargs, l++, arg); + } else { + asdl_seq_SET(posargs, k++, arg); + } + i += 1; /* the name */ + if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) + i += 1; /* the comma, if present */ + break; + case SLASH: + /* Advance the slash and the comma. If there are more names + * after the slash there will be a comma so we are advancing + * the correct number of nodes. If the slash is the last item, + * we will be advancing an extra token but then * i > NCH(n) + * and the enclosing while will finish correctly. */ + i += 2; break; - case SLASH: - /* Advance the slash and the comma. If there are more names - * after the slash there will be a comma so we are advancing - * the correct number of nodes. If the slash is the last item, - * we will be advancing an extra token but then * i > NCH(n) - * and the enclosing while will finish correctly. */ - i += 2; - break; case STAR: if (i+1 >= NCH(n) || - (i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA - || TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) { + (i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA + || TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) { ast_error(c, CHILD(n, i), - "named arguments must follow bare *"); + "named arguments must follow bare *"); return NULL; } ch = CHILD(n, i+1); /* tfpdef or COMMA */ if (TYPE(ch) == COMMA) { int res = 0; i += 2; /* now follows keyword only arguments */ - - if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { - ast_error(c, CHILD(n, i), - "bare * has associated type comment"); - return NULL; - } - + + if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { + ast_error(c, CHILD(n, i), + "bare * has associated type comment"); + return NULL; + } + res = handle_keywordonly_args(c, n, i, kwonlyargs, kwdefaults); if (res == -1) return NULL; @@ -1623,17 +1623,17 @@ ast_for_arguments(struct compiling *c, const node *n) if (!vararg) return NULL; - i += 2; /* the star and the name */ - if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) - i += 1; /* the comma, if present */ - - if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { - vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i)); - if (!vararg->type_comment) - return NULL; - i += 1; - } - + i += 2; /* the star and the name */ + if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) + i += 1; /* the comma, if present */ + + if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { + vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i)); + if (!vararg->type_comment) + return NULL; + i += 1; + } + if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef || TYPE(CHILD(n, i)) == vfpdef)) { int res = 0; @@ -1650,22 +1650,22 @@ ast_for_arguments(struct compiling *c, const node *n) kwarg = ast_for_arg(c, ch); if (!kwarg) return NULL; - i += 2; /* the double star and the name */ - if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) - i += 1; /* the comma, if present */ + i += 2; /* the double star and the name */ + if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) + i += 1; /* the comma, if present */ + break; + case TYPE_COMMENT: + assert(i); + + if (kwarg) + arg = kwarg; + + /* arg will be equal to the last argument processed */ + arg->type_comment = NEW_TYPE_COMMENT(ch); + if (!arg->type_comment) + return NULL; + i += 1; break; - case TYPE_COMMENT: - assert(i); - - if (kwarg) - arg = kwarg; - - /* arg will be equal to the last argument processed */ - arg->type_comment = NEW_TYPE_COMMENT(ch); - if (!arg->type_comment) - return NULL; - i += 1; - break; default: PyErr_Format(PyExc_SystemError, "unexpected node in varargslist: %d @ %d", @@ -1673,19 +1673,19 @@ ast_for_arguments(struct compiling *c, const node *n) return NULL; } } - return arguments(posonlyargs, posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena); + return arguments(posonlyargs, posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena); } static expr_ty ast_for_decorator(struct compiling *c, const node *n) { - /* decorator: '@' namedexpr_test NEWLINE */ + /* decorator: '@' namedexpr_test NEWLINE */ REQ(n, decorator); REQ(CHILD(n, 0), AT); - REQ(CHILD(n, 2), NEWLINE); + REQ(CHILD(n, 2), NEWLINE); - return ast_for_expr(c, CHILD(n, 1)); + return ast_for_expr(c, CHILD(n, 1)); } static asdl_seq* @@ -1713,23 +1713,23 @@ static stmt_ty ast_for_funcdef_impl(struct compiling *c, const node *n0, asdl_seq *decorator_seq, bool is_async) { - /* funcdef: 'def' NAME parameters ['->' test] ':' [TYPE_COMMENT] suite */ + /* funcdef: 'def' NAME parameters ['->' test] ':' [TYPE_COMMENT] suite */ const node * const n = is_async ? CHILD(n0, 1) : n0; identifier name; arguments_ty args; asdl_seq *body; expr_ty returns = NULL; int name_i = 1; - int end_lineno, end_col_offset; - node *tc; - string type_comment = NULL; - - if (is_async && c->c_feature_version < 5) { - ast_error(c, n, - "Async functions are only supported in Python 3.5 and greater"); - return NULL; - } - + int end_lineno, end_col_offset; + node *tc; + string type_comment = NULL; + + if (is_async && c->c_feature_version < 5) { + ast_error(c, n, + "Async functions are only supported in Python 3.5 and greater"); + return NULL; + } + REQ(n, funcdef); name = NEW_IDENTIFIER(CHILD(n, name_i)); @@ -1746,46 +1746,46 @@ ast_for_funcdef_impl(struct compiling *c, const node *n0, return NULL; name_i += 2; } - if (TYPE(CHILD(n, name_i + 3)) == TYPE_COMMENT) { - type_comment = NEW_TYPE_COMMENT(CHILD(n, name_i + 3)); - if (!type_comment) - return NULL; - name_i += 1; - } + if (TYPE(CHILD(n, name_i + 3)) == TYPE_COMMENT) { + type_comment = NEW_TYPE_COMMENT(CHILD(n, name_i + 3)); + if (!type_comment) + return NULL; + name_i += 1; + } body = ast_for_suite(c, CHILD(n, name_i + 3)); if (!body) return NULL; - get_last_end_pos(body, &end_lineno, &end_col_offset); - - if (NCH(CHILD(n, name_i + 3)) > 1) { - /* Check if the suite has a type comment in it. */ - tc = CHILD(CHILD(n, name_i + 3), 1); - - if (TYPE(tc) == TYPE_COMMENT) { - if (type_comment != NULL) { - ast_error(c, n, "Cannot have two type comments on def"); - return NULL; - } - type_comment = NEW_TYPE_COMMENT(tc); - if (!type_comment) - return NULL; - } - } - + get_last_end_pos(body, &end_lineno, &end_col_offset); + + if (NCH(CHILD(n, name_i + 3)) > 1) { + /* Check if the suite has a type comment in it. */ + tc = CHILD(CHILD(n, name_i + 3), 1); + + if (TYPE(tc) == TYPE_COMMENT) { + if (type_comment != NULL) { + ast_error(c, n, "Cannot have two type comments on def"); + return NULL; + } + type_comment = NEW_TYPE_COMMENT(tc); + if (!type_comment) + return NULL; + } + } + if (is_async) - return AsyncFunctionDef(name, args, body, decorator_seq, returns, type_comment, - LINENO(n0), n0->n_col_offset, end_lineno, end_col_offset, c->c_arena); + return AsyncFunctionDef(name, args, body, decorator_seq, returns, type_comment, + LINENO(n0), n0->n_col_offset, end_lineno, end_col_offset, c->c_arena); else - return FunctionDef(name, args, body, decorator_seq, returns, type_comment, - LINENO(n), n->n_col_offset, end_lineno, end_col_offset, c->c_arena); + return FunctionDef(name, args, body, decorator_seq, returns, type_comment, + LINENO(n), n->n_col_offset, end_lineno, end_col_offset, c->c_arena); } static stmt_ty ast_for_async_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { - /* async_funcdef: ASYNC funcdef */ + /* async_funcdef: ASYNC funcdef */ REQ(n, async_funcdef); - REQ(CHILD(n, 0), ASYNC); + REQ(CHILD(n, 0), ASYNC); REQ(CHILD(n, 1), funcdef); return ast_for_funcdef_impl(c, n, decorator_seq, @@ -1804,9 +1804,9 @@ ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) static stmt_ty ast_for_async_stmt(struct compiling *c, const node *n) { - /* async_stmt: ASYNC (funcdef | with_stmt | for_stmt) */ + /* async_stmt: ASYNC (funcdef | with_stmt | for_stmt) */ REQ(n, async_stmt); - REQ(CHILD(n, 0), ASYNC); + REQ(CHILD(n, 0), ASYNC); switch (TYPE(CHILD(n, 1))) { case funcdef: @@ -1856,41 +1856,41 @@ ast_for_decorated(struct compiling *c, const node *n) } static expr_ty -ast_for_namedexpr(struct compiling *c, const node *n) -{ - /* namedexpr_test: test [':=' test] - argument: ( test [comp_for] | - test ':=' test | - test '=' test | - '**' test | - '*' test ) - */ - expr_ty target, value; - - target = ast_for_expr(c, CHILD(n, 0)); - if (!target) - return NULL; - - value = ast_for_expr(c, CHILD(n, 2)); - if (!value) - return NULL; - - if (target->kind != Name_kind) { - const char *expr_name = get_expr_name(target); - if (expr_name != NULL) { - ast_error(c, n, "cannot use assignment expressions with %s", expr_name); - } - return NULL; - } - - if (!set_context(c, target, Store, n)) - return NULL; - - return NamedExpr(target, value, LINENO(n), n->n_col_offset, n->n_end_lineno, - n->n_end_col_offset, c->c_arena); -} - -static expr_ty +ast_for_namedexpr(struct compiling *c, const node *n) +{ + /* namedexpr_test: test [':=' test] + argument: ( test [comp_for] | + test ':=' test | + test '=' test | + '**' test | + '*' test ) + */ + expr_ty target, value; + + target = ast_for_expr(c, CHILD(n, 0)); + if (!target) + return NULL; + + value = ast_for_expr(c, CHILD(n, 2)); + if (!value) + return NULL; + + if (target->kind != Name_kind) { + const char *expr_name = get_expr_name(target); + if (expr_name != NULL) { + ast_error(c, n, "cannot use assignment expressions with %s", expr_name); + } + return NULL; + } + + if (!set_context(c, target, Store, n)) + return NULL; + + return NamedExpr(target, value, LINENO(n), n->n_col_offset, n->n_end_lineno, + n->n_end_col_offset, c->c_arena); +} + +static expr_ty ast_for_lambdef(struct compiling *c, const node *n) { /* lambdef: 'lambda' [varargslist] ':' test @@ -1899,7 +1899,7 @@ ast_for_lambdef(struct compiling *c, const node *n) expr_ty expression; if (NCH(n) == 3) { - args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); + args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); if (!args) return NULL; expression = ast_for_expr(c, CHILD(n, 2)); @@ -1915,8 +1915,8 @@ ast_for_lambdef(struct compiling *c, const node *n) return NULL; } - return Lambda(args, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Lambda(args, expression, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static expr_ty @@ -1936,7 +1936,7 @@ ast_for_ifexpr(struct compiling *c, const node *n) if (!orelse) return NULL; return IfExp(expression, body, orelse, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } @@ -1955,7 +1955,7 @@ count_comp_fors(struct compiling *c, const node *n) n_fors++; REQ(n, comp_for); if (NCH(n) == 2) { - REQ(CHILD(n, 0), ASYNC); + REQ(CHILD(n, 0), ASYNC); n = CHILD(n, 1); } else if (NCH(n) == 1) { @@ -2040,7 +2040,7 @@ ast_for_comprehension(struct compiling *c, const node *n) if (NCH(n) == 2) { is_async = 1; - REQ(CHILD(n, 0), ASYNC); + REQ(CHILD(n, 0), ASYNC); sync_n = CHILD(n, 1); } else { @@ -2048,13 +2048,13 @@ ast_for_comprehension(struct compiling *c, const node *n) } REQ(sync_n, sync_comp_for); - /* Async comprehensions only allowed in Python 3.6 and greater */ - if (is_async && c->c_feature_version < 6) { - ast_error(c, n, - "Async comprehensions are only supported in Python 3.6 and greater"); - return NULL; - } - + /* Async comprehensions only allowed in Python 3.6 and greater */ + if (is_async && c->c_feature_version < 6) { + ast_error(c, n, + "Async comprehensions are only supported in Python 3.6 and greater"); + return NULL; + } + for_ch = CHILD(sync_n, 1); t = ast_for_exprlist(c, for_ch, Store); if (!t) @@ -2070,9 +2070,9 @@ ast_for_comprehension(struct compiling *c, const node *n) comp = comprehension(first, expression, NULL, is_async, c->c_arena); else - comp = comprehension(Tuple(t, Store, first->lineno, first->col_offset, - for_ch->n_end_lineno, for_ch->n_end_col_offset, - c->c_arena), + comp = comprehension(Tuple(t, Store, first->lineno, first->col_offset, + for_ch->n_end_lineno, for_ch->n_end_col_offset, + c->c_arena), expression, NULL, is_async, c->c_arena); if (!comp) return NULL; @@ -2137,14 +2137,14 @@ ast_for_itercomp(struct compiling *c, const node *n, int type) return NULL; if (type == COMP_GENEXP) - return GeneratorExp(elt, comps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return GeneratorExp(elt, comps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else if (type == COMP_LISTCOMP) - return ListComp(elt, comps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return ListComp(elt, comps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else if (type == COMP_SETCOMP) - return SetComp(elt, comps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return SetComp(elt, comps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else /* Should never happen */ return NULL; @@ -2206,8 +2206,8 @@ ast_for_dictcomp(struct compiling *c, const node *n) if (!comps) return NULL; - return DictComp(key, value, comps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return DictComp(key, value, comps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static expr_ty @@ -2240,8 +2240,8 @@ ast_for_dictdisplay(struct compiling *c, const node *n) } keys->size = j; values->size = j; - return Dict(keys, values, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Dict(keys, values, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static expr_ty @@ -2284,8 +2284,8 @@ ast_for_setdisplay(struct compiling *c, const node *n) return NULL; asdl_seq_SET(elts, i / 2, expression); } - return Set(elts, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Set(elts, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static expr_ty @@ -2304,21 +2304,21 @@ ast_for_atom(struct compiling *c, const node *n) size_t len = strlen(s); if (len >= 4 && len <= 5) { if (!strcmp(s, "None")) - return Constant(Py_None, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(Py_None, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); if (!strcmp(s, "True")) - return Constant(Py_True, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(Py_True, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); if (!strcmp(s, "False")) - return Constant(Py_False, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(Py_False, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } name = new_identifier(s, c); if (!name) return NULL; /* All names start in Load context, but may later be changed. */ - return Name(name, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Name(name, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case STRING: { expr_ty str = parsestrplus(c, n); @@ -2332,13 +2332,13 @@ ast_for_atom(struct compiling *c, const node *n) PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); - if (errstr) { - ast_error(c, n, "(%s) %U", errtype, errstr); - Py_DECREF(errstr); - } - else { + if (errstr) { + ast_error(c, n, "(%s) %U", errtype, errstr); + Py_DECREF(errstr); + } + else { PyErr_Clear(); - ast_error(c, n, "(%s) unknown error", errtype); + ast_error(c, n, "(%s) unknown error", errtype); } Py_DECREF(type); Py_XDECREF(value); @@ -2349,15 +2349,15 @@ ast_for_atom(struct compiling *c, const node *n) return str; } case NUMBER: { - PyObject *pynum; - /* Underscores in numeric literals are only allowed in Python 3.6 or greater */ - /* Check for underscores here rather than in parse_number so we can report a line number on error */ - if (c->c_feature_version < 6 && strchr(STR(ch), '_') != NULL) { - ast_error(c, ch, - "Underscores in numeric literals are only supported in Python 3.6 and greater"); - return NULL; - } - pynum = parsenumber(c, STR(ch)); + PyObject *pynum; + /* Underscores in numeric literals are only allowed in Python 3.6 or greater */ + /* Check for underscores here rather than in parse_number so we can report a line number on error */ + if (c->c_feature_version < 6 && strchr(STR(ch), '_') != NULL) { + ast_error(c, ch, + "Underscores in numeric literals are only supported in Python 3.6 and greater"); + return NULL; + } + pynum = parsenumber(c, STR(ch)); if (!pynum) return NULL; @@ -2365,39 +2365,39 @@ ast_for_atom(struct compiling *c, const node *n) Py_DECREF(pynum); return NULL; } - return Constant(pynum, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(pynum, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case ELLIPSIS: /* Ellipsis */ - return Constant(Py_Ellipsis, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(Py_Ellipsis, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case LPAR: /* some parenthesized expressions */ ch = CHILD(n, 1); if (TYPE(ch) == RPAR) - return Tuple(NULL, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Tuple(NULL, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); if (TYPE(ch) == yield_expr) return ast_for_expr(c, ch); /* testlist_comp: test ( comp_for | (',' test)* [','] ) */ - if (NCH(ch) == 1) { - return ast_for_testlist(c, ch); - } - - if (TYPE(CHILD(ch, 1)) == comp_for) { - return copy_location(ast_for_genexp(c, ch), n, n); - } - else { - return copy_location(ast_for_testlist(c, ch), n, n); - } + if (NCH(ch) == 1) { + return ast_for_testlist(c, ch); + } + + if (TYPE(CHILD(ch, 1)) == comp_for) { + return copy_location(ast_for_genexp(c, ch), n, n); + } + else { + return copy_location(ast_for_testlist(c, ch), n, n); + } case LSQB: /* list (or list comprehension) */ ch = CHILD(n, 1); if (TYPE(ch) == RSQB) - return List(NULL, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return List(NULL, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); REQ(ch, testlist_comp); if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) { @@ -2405,12 +2405,12 @@ ast_for_atom(struct compiling *c, const node *n) if (!elts) return NULL; - return List(elts, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return List(elts, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); + } + else { + return copy_location(ast_for_listcomp(c, ch), n, n); } - else { - return copy_location(ast_for_listcomp(c, ch), n, n); - } case LBRACE: { /* dictorsetmaker: ( ((test ':' test | '**' test) * (comp_for | (',' (test ':' test | '**' test))* [','])) | @@ -2420,8 +2420,8 @@ ast_for_atom(struct compiling *c, const node *n) ch = CHILD(n, 1); if (TYPE(ch) == RBRACE) { /* It's an empty dict. */ - return Dict(NULL, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Dict(NULL, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else { int is_dict = (TYPE(CHILD(ch, 0)) == DOUBLESTAR); @@ -2440,8 +2440,8 @@ ast_for_atom(struct compiling *c, const node *n) TYPE(CHILD(ch, 3 - is_dict)) == comp_for) { /* It's a dictionary comprehension. */ if (is_dict) { - ast_error(c, n, - "dict unpacking cannot be used in dict comprehension"); + ast_error(c, n, + "dict unpacking cannot be used in dict comprehension"); return NULL; } res = ast_for_dictcomp(c, ch); @@ -2450,7 +2450,7 @@ ast_for_atom(struct compiling *c, const node *n) /* It's a dictionary display. */ res = ast_for_dictdisplay(c, ch); } - return copy_location(res, n, n); + return copy_location(res, n, n); } } default: @@ -2459,7 +2459,7 @@ ast_for_atom(struct compiling *c, const node *n) } } -static expr_ty +static expr_ty ast_for_slice(struct compiling *c, const node *n) { node *ch; @@ -2473,7 +2473,7 @@ ast_for_slice(struct compiling *c, const node *n) */ ch = CHILD(n, 0); if (NCH(n) == 1 && TYPE(ch) == test) { - return ast_for_expr(c, ch); + return ast_for_expr(c, ch); } if (TYPE(ch) == test) { @@ -2515,8 +2515,8 @@ ast_for_slice(struct compiling *c, const node *n) } } - return Slice(lower, upper, step, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Slice(lower, upper, step, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static expr_ty @@ -2539,12 +2539,12 @@ ast_for_binop(struct compiling *c, const node *n) if (!expr2) return NULL; - newoperator = get_operator(c, CHILD(n, 1)); + newoperator = get_operator(c, CHILD(n, 1)); if (!newoperator) return NULL; result = BinOp(expr1, newoperator, expr2, LINENO(n), n->n_col_offset, - CHILD(n, 2)->n_end_lineno, CHILD(n, 2)->n_end_col_offset, + CHILD(n, 2)->n_end_lineno, CHILD(n, 2)->n_end_col_offset, c->c_arena); if (!result) return NULL; @@ -2554,7 +2554,7 @@ ast_for_binop(struct compiling *c, const node *n) expr_ty tmp_result, tmp; const node* next_oper = CHILD(n, i * 2 + 1); - newoperator = get_operator(c, next_oper); + newoperator = get_operator(c, next_oper); if (!newoperator) return NULL; @@ -2563,9 +2563,9 @@ ast_for_binop(struct compiling *c, const node *n) return NULL; tmp_result = BinOp(result, newoperator, tmp, - LINENO(n), n->n_col_offset, - CHILD(n, i * 2 + 2)->n_end_lineno, - CHILD(n, i * 2 + 2)->n_end_col_offset, + LINENO(n), n->n_col_offset, + CHILD(n, i * 2 + 2)->n_end_lineno, + CHILD(n, i * 2 + 2)->n_end_col_offset, c->c_arena); if (!tmp_result) return NULL; @@ -2575,64 +2575,64 @@ ast_for_binop(struct compiling *c, const node *n) } static expr_ty -ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr, const node *start) +ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr, const node *start) { /* trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] */ - const node *n_copy = n; + const node *n_copy = n; REQ(n, trailer); if (TYPE(CHILD(n, 0)) == LPAR) { if (NCH(n) == 2) - return Call(left_expr, NULL, NULL, LINENO(start), start->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Call(left_expr, NULL, NULL, LINENO(start), start->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else - return ast_for_call(c, CHILD(n, 1), left_expr, - start, CHILD(n, 0), CHILD(n, 2)); + return ast_for_call(c, CHILD(n, 1), left_expr, + start, CHILD(n, 0), CHILD(n, 2)); } else if (TYPE(CHILD(n, 0)) == DOT) { PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1)); if (!attr_id) return NULL; return Attribute(left_expr, attr_id, Load, - LINENO(start), start->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + LINENO(start), start->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else { REQ(CHILD(n, 0), LSQB); REQ(CHILD(n, 2), RSQB); n = CHILD(n, 1); if (NCH(n) == 1) { - expr_ty slc = ast_for_slice(c, CHILD(n, 0)); + expr_ty slc = ast_for_slice(c, CHILD(n, 0)); if (!slc) return NULL; - return Subscript(left_expr, slc, Load, LINENO(start), start->n_col_offset, - n_copy->n_end_lineno, n_copy->n_end_col_offset, + return Subscript(left_expr, slc, Load, LINENO(start), start->n_col_offset, + n_copy->n_end_lineno, n_copy->n_end_col_offset, c->c_arena); } else { - int j; - expr_ty slc, e; - asdl_seq *elts; - elts = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); - if (!elts) + int j; + expr_ty slc, e; + asdl_seq *elts; + elts = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); + if (!elts) return NULL; for (j = 0; j < NCH(n); j += 2) { slc = ast_for_slice(c, CHILD(n, j)); if (!slc) return NULL; - asdl_seq_SET(elts, j / 2, slc); + asdl_seq_SET(elts, j / 2, slc); } - e = Tuple(elts, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, - c->c_arena); + e = Tuple(elts, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, + c->c_arena); if (!e) return NULL; - return Subscript(left_expr, e, - Load, LINENO(start), start->n_col_offset, - n_copy->n_end_lineno, n_copy->n_end_col_offset, - c->c_arena); + return Subscript(left_expr, e, + Load, LINENO(start), start->n_col_offset, + n_copy->n_end_lineno, n_copy->n_end_col_offset, + c->c_arena); } } } @@ -2649,16 +2649,16 @@ ast_for_factor(struct compiling *c, const node *n) switch (TYPE(CHILD(n, 0))) { case PLUS: return UnaryOp(UAdd, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case MINUS: return UnaryOp(USub, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case TILDE: - return UnaryOp(Invert, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, - c->c_arena); + return UnaryOp(Invert, expression, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, + c->c_arena); } PyErr_Format(PyExc_SystemError, "unhandled factor: %d", TYPE(CHILD(n, 0))); @@ -2669,17 +2669,17 @@ static expr_ty ast_for_atom_expr(struct compiling *c, const node *n) { int i, nch, start = 0; - expr_ty e; + expr_ty e; REQ(n, atom_expr); nch = NCH(n); - if (TYPE(CHILD(n, 0)) == AWAIT) { - if (c->c_feature_version < 5) { - ast_error(c, n, - "Await expressions are only supported in Python 3.5 and greater"); - return NULL; - } + if (TYPE(CHILD(n, 0)) == AWAIT) { + if (c->c_feature_version < 5) { + ast_error(c, n, + "Await expressions are only supported in Python 3.5 and greater"); + return NULL; + } start = 1; assert(nch > 1); } @@ -2690,23 +2690,23 @@ ast_for_atom_expr(struct compiling *c, const node *n) if (nch == 1) return e; if (start && nch == 2) { - return Await(e, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Await(e, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } for (i = start + 1; i < nch; i++) { node *ch = CHILD(n, i); if (TYPE(ch) != trailer) break; - e = ast_for_trailer(c, ch, e, CHILD(n, start)); - if (!e) + e = ast_for_trailer(c, ch, e, CHILD(n, start)); + if (!e) return NULL; } if (start) { /* there was an 'await' */ - return Await(e, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Await(e, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else { return e; @@ -2729,8 +2729,8 @@ ast_for_power(struct compiling *c, const node *n) expr_ty f = ast_for_expr(c, CHILD(n, NCH(n) - 1)); if (!f) return NULL; - e = BinOp(e, Pow, f, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + e = BinOp(e, Pow, f, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } return e; } @@ -2746,8 +2746,8 @@ ast_for_starred(struct compiling *c, const node *n) return NULL; /* The Load context is changed later. */ - return Starred(tmp, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Starred(tmp, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } @@ -2758,7 +2758,7 @@ static expr_ty ast_for_expr(struct compiling *c, const node *n) { /* handle the full range of simple expressions - namedexpr_test: test [':=' test] + namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef test_nocond: or_test | lambdef_nocond or_test: and_test ('or' and_test)* @@ -2773,7 +2773,7 @@ ast_for_expr(struct compiling *c, const node *n) term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power power: atom_expr ['**' factor] - atom_expr: [AWAIT] atom trailer* + atom_expr: [AWAIT] atom trailer* yield_expr: 'yield' [yield_arg] */ @@ -2782,10 +2782,10 @@ ast_for_expr(struct compiling *c, const node *n) loop: switch (TYPE(n)) { - case namedexpr_test: - if (NCH(n) == 3) - return ast_for_namedexpr(c, n); - /* Fallthrough */ + case namedexpr_test: + if (NCH(n) == 3) + return ast_for_namedexpr(c, n); + /* Fallthrough */ case test: case test_nocond: if (TYPE(CHILD(n, 0)) == lambdef || @@ -2811,11 +2811,11 @@ ast_for_expr(struct compiling *c, const node *n) } if (!strcmp(STR(CHILD(n, 1)), "and")) return BoolOp(And, seq, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); assert(!strcmp(STR(CHILD(n, 1)), "or")); - return BoolOp(Or, seq, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return BoolOp(Or, seq, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case not_test: if (NCH(n) == 1) { n = CHILD(n, 0); @@ -2827,7 +2827,7 @@ ast_for_expr(struct compiling *c, const node *n) return NULL; return UnaryOp(Not, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case comparison: @@ -2867,8 +2867,8 @@ ast_for_expr(struct compiling *c, const node *n) return NULL; } - return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case star_expr: @@ -2907,10 +2907,10 @@ ast_for_expr(struct compiling *c, const node *n) return NULL; } if (is_from) - return YieldFrom(exp, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); - return Yield(exp, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return YieldFrom(exp, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Yield(exp, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case factor: if (NCH(n) == 1) { @@ -2929,8 +2929,8 @@ ast_for_expr(struct compiling *c, const node *n) } static expr_ty -ast_for_call(struct compiling *c, const node *n, expr_ty func, - const node *start, const node *maybegenbeg, const node *closepar) +ast_for_call(struct compiling *c, const node *n, expr_ty func, + const node *start, const node *maybegenbeg, const node *closepar) { /* arglist: argument (',' argument)* [','] @@ -2953,7 +2953,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, nargs++; else if (TYPE(CHILD(ch, 1)) == comp_for) { nargs++; - if (!maybegenbeg) { + if (!maybegenbeg) { ast_error(c, ch, "invalid syntax"); return NULL; } @@ -2964,9 +2964,9 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, } else if (TYPE(CHILD(ch, 0)) == STAR) nargs++; - else if (TYPE(CHILD(ch, 1)) == COLONEQUAL) { - nargs++; - } + else if (TYPE(CHILD(ch, 1)) == COLONEQUAL) { + nargs++; + } else /* TYPE(CHILD(ch, 0)) == DOUBLESTAR or keyword argument */ nkeywords++; @@ -2993,13 +2993,13 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, if (nkeywords) { if (ndoublestars) { ast_error(c, chch, - "positional argument follows " - "keyword argument unpacking"); + "positional argument follows " + "keyword argument unpacking"); } else { ast_error(c, chch, - "positional argument follows " - "keyword argument"); + "positional argument follows " + "keyword argument"); } return NULL; } @@ -3013,8 +3013,8 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, expr_ty starred; if (ndoublestars) { ast_error(c, chch, - "iterable argument unpacking follows " - "keyword argument unpacking"); + "iterable argument unpacking follows " + "keyword argument unpacking"); return NULL; } e = ast_for_expr(c, CHILD(ch, 1)); @@ -3022,7 +3022,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, return NULL; starred = Starred(e, Load, LINENO(chch), chch->n_col_offset, - e->end_lineno, e->end_col_offset, + e->end_lineno, e->end_col_offset, c->c_arena); if (!starred) return NULL; @@ -3036,91 +3036,91 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; - kw = keyword(NULL, e, chch->n_lineno, chch->n_col_offset, - e->end_lineno, e->end_col_offset, c->c_arena); + kw = keyword(NULL, e, chch->n_lineno, chch->n_col_offset, + e->end_lineno, e->end_col_offset, c->c_arena); asdl_seq_SET(keywords, nkeywords++, kw); ndoublestars++; } else if (TYPE(CHILD(ch, 1)) == comp_for) { /* the lone generator expression */ - e = copy_location(ast_for_genexp(c, ch), maybegenbeg, closepar); + e = copy_location(ast_for_genexp(c, ch), maybegenbeg, closepar); + if (!e) + return NULL; + asdl_seq_SET(args, nargs++, e); + } + else if (TYPE(CHILD(ch, 1)) == COLONEQUAL) { + /* treat colon equal as positional argument */ + if (nkeywords) { + if (ndoublestars) { + ast_error(c, chch, + "positional argument follows " + "keyword argument unpacking"); + } + else { + ast_error(c, chch, + "positional argument follows " + "keyword argument"); + } + return NULL; + } + e = ast_for_namedexpr(c, ch); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); } - else if (TYPE(CHILD(ch, 1)) == COLONEQUAL) { - /* treat colon equal as positional argument */ - if (nkeywords) { - if (ndoublestars) { - ast_error(c, chch, - "positional argument follows " - "keyword argument unpacking"); - } - else { - ast_error(c, chch, - "positional argument follows " - "keyword argument"); - } - return NULL; - } - e = ast_for_namedexpr(c, ch); - if (!e) - return NULL; - asdl_seq_SET(args, nargs++, e); - } else { /* a keyword argument */ keyword_ty kw; - identifier key; - - // To remain LL(1), the grammar accepts any test (basically, any - // expression) in the keyword slot of a call site. So, we need - // to manually enforce that the keyword is a NAME here. - static const int name_tree[] = { - test, - or_test, - and_test, - not_test, - comparison, - expr, - xor_expr, - and_expr, - shift_expr, - arith_expr, - term, - factor, - power, - atom_expr, - atom, - 0, - }; - node *expr_node = chch; - for (int i = 0; name_tree[i]; i++) { - if (TYPE(expr_node) != name_tree[i]) - break; - if (NCH(expr_node) != 1) - break; - expr_node = CHILD(expr_node, 0); - } - if (TYPE(expr_node) != NAME) { + identifier key; + + // To remain LL(1), the grammar accepts any test (basically, any + // expression) in the keyword slot of a call site. So, we need + // to manually enforce that the keyword is a NAME here. + static const int name_tree[] = { + test, + or_test, + and_test, + not_test, + comparison, + expr, + xor_expr, + and_expr, + shift_expr, + arith_expr, + term, + factor, + power, + atom_expr, + atom, + 0, + }; + node *expr_node = chch; + for (int i = 0; name_tree[i]; i++) { + if (TYPE(expr_node) != name_tree[i]) + break; + if (NCH(expr_node) != 1) + break; + expr_node = CHILD(expr_node, 0); + } + if (TYPE(expr_node) != NAME) { ast_error(c, chch, - "expression cannot contain assignment, " - "perhaps you meant \"==\"?"); + "expression cannot contain assignment, " + "perhaps you meant \"==\"?"); return NULL; } - key = new_identifier(STR(expr_node), c); - if (key == NULL) { + key = new_identifier(STR(expr_node), c); + if (key == NULL) { return NULL; } - if (forbidden_name(c, key, chch, 1)) { + if (forbidden_name(c, key, chch, 1)) { return NULL; } e = ast_for_expr(c, CHILD(ch, 2)); if (!e) return NULL; - kw = keyword(key, e, chch->n_lineno, chch->n_col_offset, - e->end_lineno, e->end_col_offset, c->c_arena); - + kw = keyword(key, e, chch->n_lineno, chch->n_col_offset, + e->end_lineno, e->end_col_offset, c->c_arena); + if (!kw) return NULL; asdl_seq_SET(keywords, nkeywords++, kw); @@ -3128,8 +3128,8 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, } } - return Call(func, args, keywords, LINENO(start), start->n_col_offset, - closepar->n_end_lineno, closepar->n_end_col_offset, c->c_arena); + return Call(func, args, keywords, LINENO(start), start->n_col_offset, + closepar->n_end_lineno, closepar->n_end_col_offset, c->c_arena); } static expr_ty @@ -3152,8 +3152,8 @@ ast_for_testlist(struct compiling *c, const node* n) asdl_seq *tmp = seq_for_testlist(c, n); if (!tmp) return NULL; - return Tuple(tmp, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Tuple(tmp, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } } @@ -3162,22 +3162,22 @@ ast_for_expr_stmt(struct compiling *c, const node *n) { REQ(n, expr_stmt); /* expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | - [('=' (yield_expr|testlist_star_expr))+ [TYPE_COMMENT]] ) - annassign: ':' test ['=' (yield_expr|testlist)] - testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] - augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | - '<<=' | '>>=' | '**=' | '//=') + [('=' (yield_expr|testlist_star_expr))+ [TYPE_COMMENT]] ) + annassign: ':' test ['=' (yield_expr|testlist)] + testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] + augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') test: ... here starts the operator precedence dance */ - int num = NCH(n); + int num = NCH(n); - if (num == 1) { + if (num == 1) { expr_ty e = ast_for_testlist(c, CHILD(n, 0)); if (!e) return NULL; - return Expr(e, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Expr(e, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else if (TYPE(CHILD(n, 1)) == augassign) { expr_ty expr1, expr2; @@ -3187,7 +3187,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n) expr1 = ast_for_testlist(c, ch); if (!expr1) return NULL; - /* Augmented assignments can only have a name, a subscript, or an + /* Augmented assignments can only have a name, a subscript, or an attribute on the left, though, so we have to explicitly check for those. */ switch (expr1->kind) { @@ -3196,16 +3196,16 @@ ast_for_expr_stmt(struct compiling *c, const node *n) case Subscript_kind: break; default: - ast_error(c, ch, "'%s' is an illegal expression for augmented assignment", - get_expr_name(expr1)); + ast_error(c, ch, "'%s' is an illegal expression for augmented assignment", + get_expr_name(expr1)); return NULL; } - /* set_context checks that most expressions are not the left side. */ - if(!set_context(c, expr1, Store, ch)) { - return NULL; - } - + /* set_context checks that most expressions are not the left side. */ + if(!set_context(c, expr1, Store, ch)) { + return NULL; + } + ch = CHILD(n, 2); if (TYPE(ch) == testlist) expr2 = ast_for_testlist(c, ch); @@ -3218,8 +3218,8 @@ ast_for_expr_stmt(struct compiling *c, const node *n) if (!newoperator) return NULL; - return AugAssign(expr1, newoperator, expr2, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return AugAssign(expr1, newoperator, expr2, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else if (TYPE(CHILD(n, 1)) == annassign) { expr_ty expr1, expr2, expr3; @@ -3227,13 +3227,13 @@ ast_for_expr_stmt(struct compiling *c, const node *n) node *deep, *ann = CHILD(n, 1); int simple = 1; - /* AnnAssigns are only allowed in Python 3.6 or greater */ - if (c->c_feature_version < 6) { - ast_error(c, ch, - "Variable annotation syntax is only supported in Python 3.6 and greater"); - return NULL; - } - + /* AnnAssigns are only allowed in Python 3.6 or greater */ + if (c->c_feature_version < 6) { + ast_error(c, ch, + "Variable annotation syntax is only supported in Python 3.6 and greater"); + return NULL; + } + /* we keep track of parens to qualify (x) as expression not name */ deep = ch; while (NCH(deep) == 1) { @@ -3286,42 +3286,42 @@ ast_for_expr_stmt(struct compiling *c, const node *n) } if (NCH(ann) == 2) { return AnnAssign(expr1, expr2, NULL, simple, - LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else { ch = CHILD(ann, 3); - if (TYPE(ch) == testlist_star_expr) { - expr3 = ast_for_testlist(c, ch); - } - else { - expr3 = ast_for_expr(c, ch); - } + if (TYPE(ch) == testlist_star_expr) { + expr3 = ast_for_testlist(c, ch); + } + else { + expr3 = ast_for_expr(c, ch); + } if (!expr3) { return NULL; } return AnnAssign(expr1, expr2, expr3, simple, - LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } } else { - int i, nch_minus_type, has_type_comment; + int i, nch_minus_type, has_type_comment; asdl_seq *targets; node *value; expr_ty expression; - string type_comment; + string type_comment; /* a normal assignment */ REQ(CHILD(n, 1), EQUAL); - - has_type_comment = TYPE(CHILD(n, num - 1)) == TYPE_COMMENT; - nch_minus_type = num - has_type_comment; - - targets = _Py_asdl_seq_new(nch_minus_type / 2, c->c_arena); + + has_type_comment = TYPE(CHILD(n, num - 1)) == TYPE_COMMENT; + nch_minus_type = num - has_type_comment; + + targets = _Py_asdl_seq_new(nch_minus_type / 2, c->c_arena); if (!targets) return NULL; - for (i = 0; i < nch_minus_type - 2; i += 2) { + for (i = 0; i < nch_minus_type - 2; i += 2) { expr_ty e; node *ch = CHILD(n, i); if (TYPE(ch) == yield_expr) { @@ -3338,22 +3338,22 @@ ast_for_expr_stmt(struct compiling *c, const node *n) asdl_seq_SET(targets, i / 2, e); } - value = CHILD(n, nch_minus_type - 1); + value = CHILD(n, nch_minus_type - 1); if (TYPE(value) == testlist_star_expr) expression = ast_for_testlist(c, value); else expression = ast_for_expr(c, value); if (!expression) return NULL; - if (has_type_comment) { - type_comment = NEW_TYPE_COMMENT(CHILD(n, nch_minus_type)); - if (!type_comment) - return NULL; - } - else - type_comment = NULL; - return Assign(targets, expression, type_comment, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + if (has_type_comment) { + type_comment = NEW_TYPE_COMMENT(CHILD(n, nch_minus_type)); + if (!type_comment) + return NULL; + } + else + type_comment = NULL; + return Assign(targets, expression, type_comment, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } } @@ -3392,8 +3392,8 @@ ast_for_del_stmt(struct compiling *c, const node *n) expr_list = ast_for_exprlist(c, CHILD(n, 1), Del); if (!expr_list) return NULL; - return Delete(expr_list, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Delete(expr_list, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static stmt_ty @@ -3415,33 +3415,33 @@ ast_for_flow_stmt(struct compiling *c, const node *n) ch = CHILD(n, 0); switch (TYPE(ch)) { case break_stmt: - return Break(LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Break(LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case continue_stmt: - return Continue(LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Continue(LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case yield_stmt: { /* will reduce to yield_expr */ expr_ty exp = ast_for_expr(c, CHILD(ch, 0)); if (!exp) return NULL; - return Expr(exp, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Expr(exp, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case return_stmt: if (NCH(ch) == 1) - return Return(NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Return(NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else { expr_ty expression = ast_for_testlist(c, CHILD(ch, 1)); if (!expression) return NULL; - return Return(expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Return(expression, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case raise_stmt: if (NCH(ch) == 1) - return Raise(NULL, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Raise(NULL, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); else if (NCH(ch) >= 2) { expr_ty cause = NULL; expr_ty expression = ast_for_expr(c, CHILD(ch, 1)); @@ -3452,8 +3452,8 @@ ast_for_flow_stmt(struct compiling *c, const node *n) if (!cause) return NULL; } - return Raise(expression, cause, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Raise(expression, cause, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } /* fall through */ default: @@ -3609,14 +3609,14 @@ ast_for_import_stmt(struct compiling *c, const node *n) return NULL; asdl_seq_SET(aliases, i / 2, import_alias); } - // Even though n is modified above, the end position is not changed - return Import(aliases, lineno, col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + // Even though n is modified above, the end position is not changed + return Import(aliases, lineno, col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else if (TYPE(n) == import_from) { int n_children; int idx, ndots = 0; - const node *n_copy = n; + const node *n_copy = n; alias_ty mod = NULL; identifier modname = NULL; @@ -3655,9 +3655,9 @@ ast_for_import_stmt(struct compiling *c, const node *n) n = CHILD(n, idx); n_children = NCH(n); if (n_children % 2 == 0) { - ast_error(c, n, - "trailing comma not allowed without" - " surrounding parentheses"); + ast_error(c, n, + "trailing comma not allowed without" + " surrounding parentheses"); return NULL; } break; @@ -3688,7 +3688,7 @@ ast_for_import_stmt(struct compiling *c, const node *n) if (mod != NULL) modname = mod->name; return ImportFrom(modname, aliases, ndots, lineno, col_offset, - n_copy->n_end_lineno, n_copy->n_end_col_offset, + n_copy->n_end_lineno, n_copy->n_end_col_offset, c->c_arena); } PyErr_Format(PyExc_SystemError, @@ -3715,8 +3715,8 @@ ast_for_global_stmt(struct compiling *c, const node *n) return NULL; asdl_seq_SET(s, i / 2, name); } - return Global(s, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Global(s, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static stmt_ty @@ -3737,8 +3737,8 @@ ast_for_nonlocal_stmt(struct compiling *c, const node *n) return NULL; asdl_seq_SET(s, i / 2, name); } - return Nonlocal(s, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Nonlocal(s, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static stmt_ty @@ -3750,8 +3750,8 @@ ast_for_assert_stmt(struct compiling *c, const node *n) expr_ty expression = ast_for_expr(c, CHILD(n, 1)); if (!expression) return NULL; - return Assert(expression, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Assert(expression, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } else if (NCH(n) == 4) { expr_ty expr1, expr2; @@ -3763,8 +3763,8 @@ ast_for_assert_stmt(struct compiling *c, const node *n) if (!expr2) return NULL; - return Assert(expr1, expr2, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Assert(expr1, expr2, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } PyErr_Format(PyExc_SystemError, "improper number of parts to 'assert' statement: %d", @@ -3775,15 +3775,15 @@ ast_for_assert_stmt(struct compiling *c, const node *n) static asdl_seq * ast_for_suite(struct compiling *c, const node *n) { - /* suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ + /* suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ asdl_seq *seq; stmt_ty s; int i, total, num, end, pos = 0; node *ch; - if (TYPE(n) != func_body_suite) { - REQ(n, suite); - } + if (TYPE(n) != func_body_suite) { + REQ(n, suite); + } total = num_stmts(n); seq = _Py_asdl_seq_new(total, c->c_arena); @@ -3807,13 +3807,13 @@ ast_for_suite(struct compiling *c, const node *n) } } else { - i = 2; - if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) { - i += 2; - REQ(CHILD(n, 2), NEWLINE); - } - - for (; i < (NCH(n) - 1); i++) { + i = 2; + if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) { + i += 2; + REQ(CHILD(n, 2), NEWLINE); + } + + for (; i < (NCH(n) - 1); i++) { ch = CHILD(n, i); REQ(ch, stmt); num = num_stmts(ch); @@ -3846,17 +3846,17 @@ ast_for_suite(struct compiling *c, const node *n) return seq; } -static void -get_last_end_pos(asdl_seq *s, int *end_lineno, int *end_col_offset) -{ - Py_ssize_t tot = asdl_seq_LEN(s); - // There must be no empty suites. - assert(tot > 0); - stmt_ty last = asdl_seq_GET(s, tot - 1); - *end_lineno = last->end_lineno; - *end_col_offset = last->end_col_offset; -} - +static void +get_last_end_pos(asdl_seq *s, int *end_lineno, int *end_col_offset) +{ + Py_ssize_t tot = asdl_seq_LEN(s); + // There must be no empty suites. + assert(tot > 0); + stmt_ty last = asdl_seq_GET(s, tot - 1); + *end_lineno = last->end_lineno; + *end_col_offset = last->end_col_offset; +} + static stmt_ty ast_for_if_stmt(struct compiling *c, const node *n) { @@ -3864,7 +3864,7 @@ ast_for_if_stmt(struct compiling *c, const node *n) ['else' ':' suite] */ char *s; - int end_lineno, end_col_offset; + int end_lineno, end_col_offset; REQ(n, if_stmt); @@ -3878,10 +3878,10 @@ ast_for_if_stmt(struct compiling *c, const node *n) suite_seq = ast_for_suite(c, CHILD(n, 3)); if (!suite_seq) return NULL; - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); return If(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + end_lineno, end_col_offset, c->c_arena); } s = STR(CHILD(n, 4)); @@ -3902,10 +3902,10 @@ ast_for_if_stmt(struct compiling *c, const node *n) seq2 = ast_for_suite(c, CHILD(n, 6)); if (!seq2) return NULL; - get_last_end_pos(seq2, &end_lineno, &end_col_offset); + get_last_end_pos(seq2, &end_lineno, &end_col_offset); return If(expression, seq1, seq2, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + end_lineno, end_col_offset, c->c_arena); } else if (s[2] == 'i') { int i, n_elif, has_else = 0; @@ -3937,13 +3937,13 @@ ast_for_if_stmt(struct compiling *c, const node *n) suite_seq2 = ast_for_suite(c, CHILD(n, NCH(n) - 1)); if (!suite_seq2) return NULL; - get_last_end_pos(suite_seq2, &end_lineno, &end_col_offset); + get_last_end_pos(suite_seq2, &end_lineno, &end_col_offset); asdl_seq_SET(orelse, 0, If(expression, suite_seq, suite_seq2, - LINENO(CHILD(n, NCH(n) - 7)), - CHILD(n, NCH(n) - 7)->n_col_offset, - end_lineno, end_col_offset, c->c_arena)); + LINENO(CHILD(n, NCH(n) - 7)), + CHILD(n, NCH(n) - 7)->n_col_offset, + end_lineno, end_col_offset, c->c_arena)); /* the just-created orelse handled the last elif */ n_elif--; } @@ -3960,16 +3960,16 @@ ast_for_if_stmt(struct compiling *c, const node *n) if (!suite_seq) return NULL; - if (orelse != NULL) { - get_last_end_pos(orelse, &end_lineno, &end_col_offset); - } else { - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); - } + if (orelse != NULL) { + get_last_end_pos(orelse, &end_lineno, &end_col_offset); + } else { + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + } asdl_seq_SET(newobj, 0, If(expression, suite_seq, orelse, - LINENO(CHILD(n, off - 1)), - CHILD(n, off - 1)->n_col_offset, - end_lineno, end_col_offset, c->c_arena)); + LINENO(CHILD(n, off - 1)), + CHILD(n, off - 1)->n_col_offset, + end_lineno, end_col_offset, c->c_arena)); orelse = newobj; } expression = ast_for_expr(c, CHILD(n, 1)); @@ -3978,10 +3978,10 @@ ast_for_if_stmt(struct compiling *c, const node *n) suite_seq = ast_for_suite(c, CHILD(n, 3)); if (!suite_seq) return NULL; - get_last_end_pos(orelse, &end_lineno, &end_col_offset); + get_last_end_pos(orelse, &end_lineno, &end_col_offset); return If(expression, suite_seq, orelse, - LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } PyErr_Format(PyExc_SystemError, @@ -3994,7 +3994,7 @@ ast_for_while_stmt(struct compiling *c, const node *n) { /* while_stmt: 'while' test ':' suite ['else' ':' suite] */ REQ(n, while_stmt); - int end_lineno, end_col_offset; + int end_lineno, end_col_offset; if (NCH(n) == 4) { expr_ty expression; @@ -4006,9 +4006,9 @@ ast_for_while_stmt(struct compiling *c, const node *n) suite_seq = ast_for_suite(c, CHILD(n, 3)); if (!suite_seq) return NULL; - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); - return While(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + return While(expression, suite_seq, NULL, LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } else if (NCH(n) == 7) { expr_ty expression; @@ -4023,10 +4023,10 @@ ast_for_while_stmt(struct compiling *c, const node *n) seq2 = ast_for_suite(c, CHILD(n, 6)); if (!seq2) return NULL; - get_last_end_pos(seq2, &end_lineno, &end_col_offset); + get_last_end_pos(seq2, &end_lineno, &end_col_offset); - return While(expression, seq1, seq2, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + return While(expression, seq1, seq2, LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } PyErr_Format(PyExc_SystemError, @@ -4043,23 +4043,23 @@ ast_for_for_stmt(struct compiling *c, const node *n0, bool is_async) expr_ty expression; expr_ty target, first; const node *node_target; - int end_lineno, end_col_offset; - int has_type_comment; - string type_comment; - - if (is_async && c->c_feature_version < 5) { - ast_error(c, n, - "Async for loops are only supported in Python 3.5 and greater"); - return NULL; - } - - /* for_stmt: 'for' exprlist 'in' testlist ':' [TYPE_COMMENT] suite ['else' ':' suite] */ + int end_lineno, end_col_offset; + int has_type_comment; + string type_comment; + + if (is_async && c->c_feature_version < 5) { + ast_error(c, n, + "Async for loops are only supported in Python 3.5 and greater"); + return NULL; + } + + /* for_stmt: 'for' exprlist 'in' testlist ':' [TYPE_COMMENT] suite ['else' ':' suite] */ REQ(n, for_stmt); - has_type_comment = TYPE(CHILD(n, 5)) == TYPE_COMMENT; - - if (NCH(n) == 9 + has_type_comment) { - seq = ast_for_suite(c, CHILD(n, 8 + has_type_comment)); + has_type_comment = TYPE(CHILD(n, 5)) == TYPE_COMMENT; + + if (NCH(n) == 9 + has_type_comment) { + seq = ast_for_suite(c, CHILD(n, 8 + has_type_comment)); if (!seq) return NULL; } @@ -4074,46 +4074,46 @@ ast_for_for_stmt(struct compiling *c, const node *n0, bool is_async) if (NCH(node_target) == 1) target = first; else - target = Tuple(_target, Store, first->lineno, first->col_offset, - node_target->n_end_lineno, node_target->n_end_col_offset, - c->c_arena); + target = Tuple(_target, Store, first->lineno, first->col_offset, + node_target->n_end_lineno, node_target->n_end_col_offset, + c->c_arena); expression = ast_for_testlist(c, CHILD(n, 3)); if (!expression) return NULL; - suite_seq = ast_for_suite(c, CHILD(n, 5 + has_type_comment)); + suite_seq = ast_for_suite(c, CHILD(n, 5 + has_type_comment)); if (!suite_seq) return NULL; - if (seq != NULL) { - get_last_end_pos(seq, &end_lineno, &end_col_offset); - } else { - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); - } - - if (has_type_comment) { - type_comment = NEW_TYPE_COMMENT(CHILD(n, 5)); - if (!type_comment) - return NULL; - } - else - type_comment = NULL; - + if (seq != NULL) { + get_last_end_pos(seq, &end_lineno, &end_col_offset); + } else { + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + } + + if (has_type_comment) { + type_comment = NEW_TYPE_COMMENT(CHILD(n, 5)); + if (!type_comment) + return NULL; + } + else + type_comment = NULL; + if (is_async) - return AsyncFor(target, expression, suite_seq, seq, type_comment, + return AsyncFor(target, expression, suite_seq, seq, type_comment, LINENO(n0), n0->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + end_lineno, end_col_offset, c->c_arena); else - return For(target, expression, suite_seq, seq, type_comment, + return For(target, expression, suite_seq, seq, type_comment, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + end_lineno, end_col_offset, c->c_arena); } static excepthandler_ty ast_for_except_clause(struct compiling *c, const node *exc, node *body) { /* except_clause: 'except' [test ['as' test]] */ - int end_lineno, end_col_offset; + int end_lineno, end_col_offset; REQ(exc, except_clause); REQ(body, suite); @@ -4121,11 +4121,11 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body) asdl_seq *suite_seq = ast_for_suite(c, body); if (!suite_seq) return NULL; - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); return ExceptHandler(NULL, NULL, suite_seq, LINENO(exc), - exc->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + exc->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } else if (NCH(exc) == 2) { expr_ty expression; @@ -4137,11 +4137,11 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body) suite_seq = ast_for_suite(c, body); if (!suite_seq) return NULL; - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); return ExceptHandler(expression, NULL, suite_seq, LINENO(exc), - exc->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + exc->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } else if (NCH(exc) == 4) { asdl_seq *suite_seq; @@ -4157,11 +4157,11 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body) suite_seq = ast_for_suite(c, body); if (!suite_seq) return NULL; - get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); + get_last_end_pos(suite_seq, &end_lineno, &end_col_offset); return ExceptHandler(expression, e, suite_seq, LINENO(exc), - exc->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + exc->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } PyErr_Format(PyExc_SystemError, @@ -4174,9 +4174,9 @@ static stmt_ty ast_for_try_stmt(struct compiling *c, const node *n) { const int nch = NCH(n); - int end_lineno, end_col_offset, n_except = (nch - 3)/3; + int end_lineno, end_col_offset, n_except = (nch - 3)/3; asdl_seq *body, *handlers = NULL, *orelse = NULL, *finally = NULL; - excepthandler_ty last_handler; + excepthandler_ty last_handler; REQ(n, try_stmt); @@ -4232,20 +4232,20 @@ ast_for_try_stmt(struct compiling *c, const node *n) } assert(finally != NULL || asdl_seq_LEN(handlers)); - if (finally != NULL) { - // finally is always last - get_last_end_pos(finally, &end_lineno, &end_col_offset); - } else if (orelse != NULL) { - // otherwise else is last - get_last_end_pos(orelse, &end_lineno, &end_col_offset); - } else { - // inline the get_last_end_pos logic due to layout mismatch - last_handler = (excepthandler_ty) asdl_seq_GET(handlers, n_except - 1); - end_lineno = last_handler->end_lineno; - end_col_offset = last_handler->end_col_offset; - } - return Try(body, handlers, orelse, finally, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + if (finally != NULL) { + // finally is always last + get_last_end_pos(finally, &end_lineno, &end_col_offset); + } else if (orelse != NULL) { + // otherwise else is last + get_last_end_pos(orelse, &end_lineno, &end_col_offset); + } else { + // inline the get_last_end_pos logic due to layout mismatch + last_handler = (excepthandler_ty) asdl_seq_GET(handlers, n_except - 1); + end_lineno = last_handler->end_lineno; + end_col_offset = last_handler->end_col_offset; + } + return Try(body, handlers, orelse, finally, LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } /* with_item: test ['as' expr] */ @@ -4272,31 +4272,31 @@ ast_for_with_item(struct compiling *c, const node *n) return withitem(context_expr, optional_vars, c->c_arena); } -/* with_stmt: 'with' with_item (',' with_item)* ':' [TYPE_COMMENT] suite */ +/* with_stmt: 'with' with_item (',' with_item)* ':' [TYPE_COMMENT] suite */ static stmt_ty ast_for_with_stmt(struct compiling *c, const node *n0, bool is_async) { const node * const n = is_async ? CHILD(n0, 1) : n0; - int i, n_items, nch_minus_type, has_type_comment, end_lineno, end_col_offset; + int i, n_items, nch_minus_type, has_type_comment, end_lineno, end_col_offset; asdl_seq *items, *body; - string type_comment; - - if (is_async && c->c_feature_version < 5) { - ast_error(c, n, - "Async with statements are only supported in Python 3.5 and greater"); - return NULL; - } - + string type_comment; + + if (is_async && c->c_feature_version < 5) { + ast_error(c, n, + "Async with statements are only supported in Python 3.5 and greater"); + return NULL; + } + REQ(n, with_stmt); - has_type_comment = TYPE(CHILD(n, NCH(n) - 2)) == TYPE_COMMENT; - nch_minus_type = NCH(n) - has_type_comment; - - n_items = (nch_minus_type - 2) / 2; + has_type_comment = TYPE(CHILD(n, NCH(n) - 2)) == TYPE_COMMENT; + nch_minus_type = NCH(n) - has_type_comment; + + n_items = (nch_minus_type - 2) / 2; items = _Py_asdl_seq_new(n_items, c->c_arena); if (!items) return NULL; - for (i = 1; i < nch_minus_type - 2; i += 2) { + for (i = 1; i < nch_minus_type - 2; i += 2) { withitem_ty item = ast_for_with_item(c, CHILD(n, i)); if (!item) return NULL; @@ -4306,22 +4306,22 @@ ast_for_with_stmt(struct compiling *c, const node *n0, bool is_async) body = ast_for_suite(c, CHILD(n, NCH(n) - 1)); if (!body) return NULL; - get_last_end_pos(body, &end_lineno, &end_col_offset); - - if (has_type_comment) { - type_comment = NEW_TYPE_COMMENT(CHILD(n, NCH(n) - 2)); - if (!type_comment) - return NULL; - } - else - type_comment = NULL; - + get_last_end_pos(body, &end_lineno, &end_col_offset); + + if (has_type_comment) { + type_comment = NEW_TYPE_COMMENT(CHILD(n, NCH(n) - 2)); + if (!type_comment) + return NULL; + } + else + type_comment = NULL; + if (is_async) - return AsyncWith(items, body, type_comment, LINENO(n0), n0->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + return AsyncWith(items, body, type_comment, LINENO(n0), n0->n_col_offset, + end_lineno, end_col_offset, c->c_arena); else - return With(items, body, type_comment, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + return With(items, body, type_comment, LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } static stmt_ty @@ -4331,7 +4331,7 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) PyObject *classname; asdl_seq *s; expr_ty call; - int end_lineno, end_col_offset; + int end_lineno, end_col_offset; REQ(n, classdef); @@ -4339,32 +4339,32 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) s = ast_for_suite(c, CHILD(n, 3)); if (!s) return NULL; - get_last_end_pos(s, &end_lineno, &end_col_offset); - + get_last_end_pos(s, &end_lineno, &end_col_offset); + classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, - LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } if (TYPE(CHILD(n, 3)) == RPAR) { /* class NAME '(' ')' ':' suite */ s = ast_for_suite(c, CHILD(n, 5)); if (!s) return NULL; - get_last_end_pos(s, &end_lineno, &end_col_offset); - + get_last_end_pos(s, &end_lineno, &end_col_offset); + classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, - LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } /* class NAME '(' arglist ')' ':' suite */ @@ -4375,19 +4375,19 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) dummy_name = NEW_IDENTIFIER(CHILD(n, 1)); if (!dummy_name) return NULL; - dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, - CHILD(n, 1)->n_end_lineno, CHILD(n, 1)->n_end_col_offset, - c->c_arena); - call = ast_for_call(c, CHILD(n, 3), dummy, - CHILD(n, 1), NULL, CHILD(n, 4)); + dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, + CHILD(n, 1)->n_end_lineno, CHILD(n, 1)->n_end_col_offset, + c->c_arena); + call = ast_for_call(c, CHILD(n, 3), dummy, + CHILD(n, 1), NULL, CHILD(n, 4)); if (!call) return NULL; } s = ast_for_suite(c, CHILD(n, 6)); if (!s) return NULL; - get_last_end_pos(s, &end_lineno, &end_col_offset); - + get_last_end_pos(s, &end_lineno, &end_col_offset); + classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; @@ -4395,8 +4395,8 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) return NULL; return ClassDef(classname, call->v.Call.args, call->v.Call.keywords, s, - decorator_seq, LINENO(n), n->n_col_offset, - end_lineno, end_col_offset, c->c_arena); + decorator_seq, LINENO(n), n->n_col_offset, + end_lineno, end_col_offset, c->c_arena); } static stmt_ty @@ -4421,8 +4421,8 @@ ast_for_stmt(struct compiling *c, const node *n) case del_stmt: return ast_for_del_stmt(c, n); case pass_stmt: - return Pass(LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Pass(LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case flow_stmt: return ast_for_flow_stmt(c, n); case import_stmt: @@ -4467,7 +4467,7 @@ ast_for_stmt(struct compiling *c, const node *n) return ast_for_async_stmt(c, ch); default: PyErr_Format(PyExc_SystemError, - "unhandled compound_stmt: TYPE=%d NCH=%d\n", + "unhandled compound_stmt: TYPE=%d NCH=%d\n", TYPE(n), NCH(n)); return NULL; } @@ -4573,7 +4573,7 @@ warn_invalid_escape_sequence(struct compiling *c, const node *n, /* Replace the DeprecationWarning exception with a SyntaxError to get a more accurate error report */ PyErr_Clear(); - ast_error(c, n, "%U", msg); + ast_error(c, n, "%U", msg); } Py_DECREF(msg); return -1; @@ -4614,7 +4614,7 @@ decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s, if (*s & 0x80) { /* XXX inefficient */ PyObject *w; int kind; - const void *data; + const void *data; Py_ssize_t len, i; w = decode_utf8(c, &s, end); if (w == NULL) { @@ -4640,7 +4640,7 @@ decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s, s = buf; const char *first_invalid_escape; - v = _PyUnicode_DecodeUnicodeEscapeInternal(s, len, NULL, NULL, &first_invalid_escape); + v = _PyUnicode_DecodeUnicodeEscapeInternal(s, len, NULL, NULL, &first_invalid_escape); if (v != NULL && first_invalid_escape != NULL) { if (warn_invalid_escape_sequence(c, n, *first_invalid_escape) < 0) { @@ -4660,7 +4660,7 @@ decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { const char *first_invalid_escape; - PyObject *result = _PyBytes_DecodeEscape(s, len, NULL, + PyObject *result = _PyBytes_DecodeEscape(s, len, NULL, &first_invalid_escape); if (result == NULL) return NULL; @@ -4679,7 +4679,7 @@ decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s, static void fstring_shift_node_locations(node *n, int lineno, int col_offset) { n->n_col_offset = n->n_col_offset + col_offset; - n->n_end_col_offset = n->n_end_col_offset + col_offset; + n->n_end_col_offset = n->n_end_col_offset + col_offset; for (int i = 0; i < NCH(n); ++i) { if (n->n_lineno && n->n_lineno < CHILD(n, i)->n_lineno) { /* Shifting column offsets unnecessary if there's been newlines. */ @@ -4688,7 +4688,7 @@ static void fstring_shift_node_locations(node *n, int lineno, int col_offset) fstring_shift_node_locations(CHILD(n, i), lineno, col_offset); } n->n_lineno = n->n_lineno + lineno; - n->n_end_lineno = n->n_end_lineno + lineno; + n->n_end_lineno = n->n_end_lineno + lineno; } /* Fix locations for the given node and its children. @@ -4716,14 +4716,14 @@ fstring_fix_node_location(const node *parent, node *n, char *expr_str) break; start--; } - cols += (int)(substr - start); - /* adjust the start based on the number of newlines encountered - before the f-string expression */ - for (char* p = parent->n_str; p < substr; p++) { - if (*p == '\n') { - lines++; - } - } + cols += (int)(substr - start); + /* adjust the start based on the number of newlines encountered + before the f-string expression */ + for (char* p = parent->n_str; p < substr; p++) { + if (*p == '\n') { + lines++; + } + } } } fstring_shift_node_locations(n, lines, cols); @@ -4744,8 +4744,8 @@ fstring_compile_expr(const char *expr_start, const char *expr_end, assert(expr_end >= expr_start); assert(*(expr_start-1) == '{'); - assert(*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || - *expr_end == '='); + assert(*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || + *expr_end == '='); /* If the substring is all whitespace, it's an error. We need to catch this here, and not when we call PyParser_SimpleParseStringFlagsFilename, @@ -4766,7 +4766,7 @@ fstring_compile_expr(const char *expr_start, const char *expr_end, len = expr_end - expr_start; /* Allocate 3 extra bytes: open paren, close paren, null byte. */ - str = PyMem_Malloc(len + 3); + str = PyMem_Malloc(len + 3); if (str == NULL) { PyErr_NoMemory(); return NULL; @@ -4777,12 +4777,12 @@ fstring_compile_expr(const char *expr_start, const char *expr_end, str[len+1] = ')'; str[len+2] = 0; - PyCompilerFlags cf = _PyCompilerFlags_INIT; + PyCompilerFlags cf = _PyCompilerFlags_INIT; cf.cf_flags = PyCF_ONLY_AST; mod_n = PyParser_SimpleParseStringFlagsFilename(str, "<fstring>", Py_eval_input, 0); if (!mod_n) { - PyMem_Free(str); + PyMem_Free(str); return NULL; } /* Reuse str to find the correct column offset. */ @@ -4790,7 +4790,7 @@ fstring_compile_expr(const char *expr_start, const char *expr_end, str[len+1] = '}'; fstring_fix_node_location(n, mod_n, str); mod = PyAST_FromNode(mod_n, &cf, "<fstring>", c->c_arena); - PyMem_Free(str); + PyMem_Free(str); PyNode_Free(mod_n); if (!mod) return NULL; @@ -4888,24 +4888,24 @@ fstring_parse(const char **str, const char *end, int raw, int recurse_lvl, struct compiling *c, const node *n); /* Parse the f-string at *str, ending at end. We know *str starts an - expression (so it must be a '{'). Returns the FormattedValue node, which - includes the expression, conversion character, format_spec expression, and - optionally the text of the expression (if = is used). + expression (so it must be a '{'). Returns the FormattedValue node, which + includes the expression, conversion character, format_spec expression, and + optionally the text of the expression (if = is used). Note that I don't do a perfect job here: I don't make sure that a closing brace doesn't match an opening paren, for example. It doesn't need to error on all invalid expressions, just correctly find the end of all valid ones. Any errors inside the expression - will be caught when we parse it later. - - *expression is set to the expression. For an '=' "debug" expression, - *expr_text is set to the debug text (the original text of the expression, - including the '=' and any whitespace around it, as a string object). If - not a debug expression, *expr_text set to NULL. */ + will be caught when we parse it later. + + *expression is set to the expression. For an '=' "debug" expression, + *expr_text is set to the debug text (the original text of the expression, + including the '=' and any whitespace around it, as a string object). If + not a debug expression, *expr_text set to NULL. */ static int fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, - PyObject **expr_text, expr_ty *expression, - struct compiling *c, const node *n) + PyObject **expr_text, expr_ty *expression, + struct compiling *c, const node *n) { /* Return -1 on error, else 0. */ @@ -4913,9 +4913,9 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, const char *expr_end; expr_ty simple_expression; expr_ty format_spec = NULL; /* Optional format specifier. */ - int conversion = -1; /* The conversion char. Use default if not - specified, or !r if using = and no format - spec. */ + int conversion = -1; /* The conversion char. Use default if not + specified, or !r if using = and no format + spec. */ /* 0 if we're not in a string, else the quote char we're trying to match (single or double quote). */ @@ -4927,14 +4927,14 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, /* Keep track of nesting level for braces/parens/brackets in expressions. */ Py_ssize_t nested_depth = 0; - char parenstack[MAXLEVEL]; + char parenstack[MAXLEVEL]; + + *expr_text = NULL; - *expr_text = NULL; - /* Can only nest one level deep. */ if (recurse_lvl >= 2) { ast_error(c, n, "f-string: expressions nested too deeply"); - goto error; + goto error; } /* The first char must be a left brace, or we wouldn't have gotten @@ -4959,10 +4959,10 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, if (ch == '\\') { /* Error: can't include a backslash character, inside parens or strings or not. */ - ast_error(c, n, - "f-string expression part " - "cannot include a backslash"); - goto error; + ast_error(c, n, + "f-string expression part " + "cannot include a backslash"); + goto error; } if (quote_char) { /* We're inside a string. See if we're at the end. */ @@ -5005,61 +5005,61 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, /* Start looking for the end of the string. */ quote_char = ch; } else if (ch == '[' || ch == '{' || ch == '(') { - if (nested_depth >= MAXLEVEL) { - ast_error(c, n, "f-string: too many nested parenthesis"); - goto error; - } - parenstack[nested_depth] = ch; + if (nested_depth >= MAXLEVEL) { + ast_error(c, n, "f-string: too many nested parenthesis"); + goto error; + } + parenstack[nested_depth] = ch; nested_depth++; } else if (ch == '#') { /* Error: can't include a comment character, inside parens or not. */ ast_error(c, n, "f-string expression part cannot include '#'"); - goto error; + goto error; } else if (nested_depth == 0 && - (ch == '!' || ch == ':' || ch == '}' || - ch == '=' || ch == '>' || ch == '<')) { - /* See if there's a next character. */ - if (*str+1 < end) { - char next = *(*str+1); - - /* For "!=". since '=' is not an allowed conversion character, - nothing is lost in this test. */ - if ((ch == '!' && next == '=') || /* != */ - (ch == '=' && next == '=') || /* == */ - (ch == '<' && next == '=') || /* <= */ - (ch == '>' && next == '=') /* >= */ - ) { - *str += 1; - continue; - } - /* Don't get out of the loop for these, if they're single - chars (not part of 2-char tokens). If by themselves, they - don't end an expression (unlike say '!'). */ - if (ch == '>' || ch == '<') { - continue; - } + (ch == '!' || ch == ':' || ch == '}' || + ch == '=' || ch == '>' || ch == '<')) { + /* See if there's a next character. */ + if (*str+1 < end) { + char next = *(*str+1); + + /* For "!=". since '=' is not an allowed conversion character, + nothing is lost in this test. */ + if ((ch == '!' && next == '=') || /* != */ + (ch == '=' && next == '=') || /* == */ + (ch == '<' && next == '=') || /* <= */ + (ch == '>' && next == '=') /* >= */ + ) { + *str += 1; + continue; + } + /* Don't get out of the loop for these, if they're single + chars (not part of 2-char tokens). If by themselves, they + don't end an expression (unlike say '!'). */ + if (ch == '>' || ch == '<') { + continue; + } } - + /* Normal way out of this loop. */ break; - } else if (ch == ']' || ch == '}' || ch == ')') { - if (!nested_depth) { - ast_error(c, n, "f-string: unmatched '%c'", ch); - goto error; - } - nested_depth--; - int opening = parenstack[nested_depth]; - if (!((opening == '(' && ch == ')') || - (opening == '[' && ch == ']') || - (opening == '{' && ch == '}'))) - { - ast_error(c, n, - "f-string: closing parenthesis '%c' " - "does not match opening parenthesis '%c'", - ch, opening); - goto error; - } + } else if (ch == ']' || ch == '}' || ch == ')') { + if (!nested_depth) { + ast_error(c, n, "f-string: unmatched '%c'", ch); + goto error; + } + nested_depth--; + int opening = parenstack[nested_depth]; + if (!((opening == '(' && ch == ')') || + (opening == '[' && ch == ']') || + (opening == '{' && ch == '}'))) + { + ast_error(c, n, + "f-string: closing parenthesis '%c' " + "does not match opening parenthesis '%c'", + ch, opening); + goto error; + } } else { /* Just consume this char and loop around. */ } @@ -5071,12 +5071,12 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, let's just do that.*/ if (quote_char) { ast_error(c, n, "f-string: unterminated string"); - goto error; + goto error; } if (nested_depth) { - int opening = parenstack[nested_depth - 1]; - ast_error(c, n, "f-string: unmatched '%c'", opening); - goto error; + int opening = parenstack[nested_depth - 1]; + ast_error(c, n, "f-string: unmatched '%c'", opening); + goto error; } if (*str >= end) @@ -5087,33 +5087,33 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, conversion or format_spec. */ simple_expression = fstring_compile_expr(expr_start, expr_end, c, n); if (!simple_expression) - goto error; - - /* Check for =, which puts the text value of the expression in - expr_text. */ - if (**str == '=') { - if (c->c_feature_version < 8) { - ast_error(c, n, - "f-string: self documenting expressions are " - "only supported in Python 3.8 and greater"); - goto error; - } - *str += 1; - - /* Skip over ASCII whitespace. No need to test for end of string - here, since we know there's at least a trailing quote somewhere - ahead. */ - while (Py_ISSPACE(**str)) { - *str += 1; - } - - /* Set *expr_text to the text of the expression. */ - *expr_text = PyUnicode_FromStringAndSize(expr_start, *str-expr_start); - if (!*expr_text) { - goto error; - } - } - + goto error; + + /* Check for =, which puts the text value of the expression in + expr_text. */ + if (**str == '=') { + if (c->c_feature_version < 8) { + ast_error(c, n, + "f-string: self documenting expressions are " + "only supported in Python 3.8 and greater"); + goto error; + } + *str += 1; + + /* Skip over ASCII whitespace. No need to test for end of string + here, since we know there's at least a trailing quote somewhere + ahead. */ + while (Py_ISSPACE(**str)) { + *str += 1; + } + + /* Set *expr_text to the text of the expression. */ + *expr_text = PyUnicode_FromStringAndSize(expr_start, *str-expr_start); + if (!*expr_text) { + goto error; + } + } + /* Check for a conversion char, if present. */ if (**str == '!') { *str += 1; @@ -5124,13 +5124,13 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, *str += 1; /* Validate the conversion. */ - if (!(conversion == 's' || conversion == 'r' || conversion == 'a')) { - ast_error(c, n, - "f-string: invalid conversion character: " - "expected 's', 'r', or 'a'"); - goto error; + if (!(conversion == 's' || conversion == 'r' || conversion == 'a')) { + ast_error(c, n, + "f-string: invalid conversion character: " + "expected 's', 'r', or 'a'"); + goto error; } - + } /* Check for the format spec, if present. */ @@ -5144,7 +5144,7 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, /* Parse the format spec. */ format_spec = fstring_parse(str, end, raw, recurse_lvl+1, c, n); if (!format_spec) - goto error; + goto error; } if (*str >= end || **str != '}') @@ -5155,31 +5155,31 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl, assert(**str == '}'); *str += 1; - /* If we're in = mode (detected by non-NULL expr_text), and have no format - spec and no explicit conversion, set the conversion to 'r'. */ - if (*expr_text && format_spec == NULL && conversion == -1) { - conversion = 'r'; - } - + /* If we're in = mode (detected by non-NULL expr_text), and have no format + spec and no explicit conversion, set the conversion to 'r'. */ + if (*expr_text && format_spec == NULL && conversion == -1) { + conversion = 'r'; + } + /* And now create the FormattedValue node that represents this entire expression with the conversion and format spec. */ *expression = FormattedValue(simple_expression, conversion, - format_spec, LINENO(n), - n->n_col_offset, n->n_end_lineno, - n->n_end_col_offset, c->c_arena); + format_spec, LINENO(n), + n->n_col_offset, n->n_end_lineno, + n->n_end_col_offset, c->c_arena); if (!*expression) - goto error; + goto error; return 0; unexpected_end_of_string: ast_error(c, n, "f-string: expecting '}'"); - /* Falls through to error. */ - -error: - Py_XDECREF(*expr_text); + /* Falls through to error. */ + +error: + Py_XDECREF(*expr_text); return -1; - + } /* Return -1 on error. @@ -5208,7 +5208,7 @@ error: static int fstring_find_literal_and_expr(const char **str, const char *end, int raw, int recurse_lvl, PyObject **literal, - PyObject **expr_text, expr_ty *expression, + PyObject **expr_text, expr_ty *expression, struct compiling *c, const node *n) { int result; @@ -5236,8 +5236,8 @@ fstring_find_literal_and_expr(const char **str, const char *end, int raw, /* We must now be the start of an expression, on a '{'. */ assert(**str == '{'); - if (fstring_find_expr(str, end, raw, recurse_lvl, expr_text, - expression, c, n) < 0) + if (fstring_find_expr(str, end, raw, recurse_lvl, expr_text, + expression, c, n) < 0) goto error; return 0; @@ -5255,8 +5255,8 @@ typedef struct { expr_ty's, and then after that start dynamically allocating, doubling the number allocated each time. Note that the f-string f'{0}a{1}' contains 3 expr_ty's: 2 FormattedValue's, and one - Constant for the literal 'a'. So you add expr_ty's about twice as - fast as you add expressions in an f-string. */ + Constant for the literal 'a'. So you add expr_ty's about twice as + fast as you add expressions in an f-string. */ Py_ssize_t allocated; /* Number we've allocated. */ Py_ssize_t size; /* Number we've used. */ @@ -5306,7 +5306,7 @@ ExprList_Append(ExprList *l, expr_ty exp) Py_ssize_t i; /* We're still using the cached data. Switch to alloc-ing. */ - l->p = PyMem_Malloc(sizeof(expr_ty) * new_size); + l->p = PyMem_Malloc(sizeof(expr_ty) * new_size); if (!l->p) return -1; /* Copy the cached data into the new buffer. */ @@ -5314,9 +5314,9 @@ ExprList_Append(ExprList *l, expr_ty exp) l->p[i] = l->data[i]; } else { /* Just realloc. */ - expr_ty *tmp = PyMem_Realloc(l->p, sizeof(expr_ty) * new_size); + expr_ty *tmp = PyMem_Realloc(l->p, sizeof(expr_ty) * new_size); if (!tmp) { - PyMem_Free(l->p); + PyMem_Free(l->p); l->p = NULL; return -1; } @@ -5344,7 +5344,7 @@ ExprList_Dealloc(ExprList *l) /* Do nothing. */ } else { /* We have dynamically allocated. Free the memory. */ - PyMem_Free(l->p); + PyMem_Free(l->p); } l->p = NULL; l->size = -1; @@ -5407,58 +5407,58 @@ FstringParser_Dealloc(FstringParser *state) ExprList_Dealloc(&state->expr_list); } -/* Constants for the following */ -static PyObject *u_kind; - -/* Compute 'kind' field for string Constant (either 'u' or None) */ -static PyObject * -make_kind(struct compiling *c, const node *n) -{ - char *s = NULL; - PyObject *kind = NULL; - - /* Find the first string literal, if any */ - while (TYPE(n) != STRING) { - if (NCH(n) == 0) - return NULL; - n = CHILD(n, 0); - } - REQ(n, STRING); - - /* If it starts with 'u', return a PyUnicode "u" string */ - s = STR(n); - if (s && *s == 'u') { - if (!u_kind) { - u_kind = PyUnicode_InternFromString("u"); - if (!u_kind) - return NULL; - } - kind = u_kind; - if (PyArena_AddPyObject(c->c_arena, kind) < 0) { - return NULL; - } - Py_INCREF(kind); - } - return kind; -} - -/* Make a Constant node, but decref the PyUnicode object being added. */ +/* Constants for the following */ +static PyObject *u_kind; + +/* Compute 'kind' field for string Constant (either 'u' or None) */ +static PyObject * +make_kind(struct compiling *c, const node *n) +{ + char *s = NULL; + PyObject *kind = NULL; + + /* Find the first string literal, if any */ + while (TYPE(n) != STRING) { + if (NCH(n) == 0) + return NULL; + n = CHILD(n, 0); + } + REQ(n, STRING); + + /* If it starts with 'u', return a PyUnicode "u" string */ + s = STR(n); + if (s && *s == 'u') { + if (!u_kind) { + u_kind = PyUnicode_InternFromString("u"); + if (!u_kind) + return NULL; + } + kind = u_kind; + if (PyArena_AddPyObject(c->c_arena, kind) < 0) { + return NULL; + } + Py_INCREF(kind); + } + return kind; +} + +/* Make a Constant node, but decref the PyUnicode object being added. */ static expr_ty make_str_node_and_del(PyObject **str, struct compiling *c, const node* n) { PyObject *s = *str; - PyObject *kind = NULL; + PyObject *kind = NULL; *str = NULL; assert(PyUnicode_CheckExact(s)); if (PyArena_AddPyObject(c->c_arena, s) < 0) { Py_DECREF(s); return NULL; } - kind = make_kind(c, n); - if (kind == NULL && PyErr_Occurred()) - return NULL; - return Constant(s, kind, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + kind = make_kind(c, n); + if (kind == NULL && PyErr_Occurred()) + return NULL; + return Constant(s, kind, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } /* Add a non-f-string (that is, a regular literal string). str is @@ -5501,7 +5501,7 @@ FstringParser_ConcatFstring(FstringParser *state, const char **str, /* Parse the f-string. */ while (1) { PyObject *literal = NULL; - PyObject *expr_text = NULL; + PyObject *expr_text = NULL; expr_ty expression = NULL; /* If there's a zero length literal in front of the @@ -5509,23 +5509,23 @@ FstringParser_ConcatFstring(FstringParser *state, const char **str, the f-string, expression will be NULL (unless result == 1, see below). */ int result = fstring_find_literal_and_expr(str, end, raw, recurse_lvl, - &literal, &expr_text, - &expression, c, n); + &literal, &expr_text, + &expression, c, n); if (result < 0) return -1; /* Add the literal, if any. */ - if (literal && FstringParser_ConcatAndDel(state, literal) < 0) { - Py_XDECREF(expr_text); - return -1; + if (literal && FstringParser_ConcatAndDel(state, literal) < 0) { + Py_XDECREF(expr_text); + return -1; + } + /* Add the expr_text, if any. */ + if (expr_text && FstringParser_ConcatAndDel(state, expr_text) < 0) { + return -1; } - /* Add the expr_text, if any. */ - if (expr_text && FstringParser_ConcatAndDel(state, expr_text) < 0) { - return -1; - } - /* We've dealt with the literal and expr_text, their ownership has - been transferred to the state object. Don't look at them again. */ + /* We've dealt with the literal and expr_text, their ownership has + been transferred to the state object. Don't look at them again. */ /* See if we should just loop around to get the next literal and expression, while ignoring the expression this @@ -5539,11 +5539,11 @@ FstringParser_ConcatFstring(FstringParser *state, const char **str, break; /* We know we have an expression. Convert any existing string - to a Constant node. */ + to a Constant node. */ if (!state->last_str) { /* Do nothing. No previous literal. */ } else { - /* Convert the existing last_str literal to a Constant node. */ + /* Convert the existing last_str literal to a Constant node. */ expr_ty str = make_str_node_and_del(&state->last_str, c, n); if (!str || ExprList_Append(&state->expr_list, str) < 0) return -1; @@ -5570,7 +5570,7 @@ FstringParser_ConcatFstring(FstringParser *state, const char **str, } /* Convert the partial state reflected in last_str and expr_list to an - expr_ty. The expr_ty can be a Constant, or a JoinedStr. */ + expr_ty. The expr_ty can be a Constant, or a JoinedStr. */ static expr_ty FstringParser_Finish(FstringParser *state, struct compiling *c, const node *n) @@ -5592,7 +5592,7 @@ FstringParser_Finish(FstringParser *state, struct compiling *c, return make_str_node_and_del(&state->last_str, c, n); } - /* Create a Constant node out of last_str, if needed. It will be the + /* Create a Constant node out of last_str, if needed. It will be the last node in our expression list. */ if (state->last_str) { expr_ty str = make_str_node_and_del(&state->last_str, c, n); @@ -5606,8 +5606,8 @@ FstringParser_Finish(FstringParser *state, struct compiling *c, if (!seq) goto error; - return JoinedStr(seq, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return JoinedStr(seq, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); error: FstringParser_Dealloc(state); @@ -5674,13 +5674,13 @@ parsestr(struct compiling *c, const node *n, int *bytesmode, int *rawmode, } } } - - /* fstrings are only allowed in Python 3.6 and greater */ - if (fmode && c->c_feature_version < 6) { - ast_error(c, n, "Format strings are only supported in Python 3.6 and greater"); - return -1; - } - + + /* fstrings are only allowed in Python 3.6 and greater */ + if (fmode && c->c_feature_version < 6) { + ast_error(c, n, "Format strings are only supported in Python 3.6 and greater"); + return -1; + } + if (fmode && *bytesmode) { PyErr_BadInternalCall(); return -1; @@ -5731,8 +5731,8 @@ parsestr(struct compiling *c, const node *n, int *bytesmode, int *rawmode, const char *ch; for (ch = s; *ch; ch++) { if (Py_CHARMASK(*ch) >= 0x80) { - ast_error(c, n, - "bytes can only contain ASCII " + ast_error(c, n, + "bytes can only contain ASCII " "literal characters."); return -1; } @@ -5752,9 +5752,9 @@ parsestr(struct compiling *c, const node *n, int *bytesmode, int *rawmode, /* Accepts a STRING+ atom, and produces an expr_ty node. Run through each STRING atom, and process it as needed. For bytes, just - concatenate them together, and the result will be a Constant node. For + concatenate them together, and the result will be a Constant node. For normal strings and f-strings, concatenate them together. The result - will be a Constant node if there were no f-strings; a FormattedValue + will be a Constant node if there were no f-strings; a FormattedValue node if there's just an f-string (with no leading or trailing literals), or a JoinedStr node if there are multiple f-strings or any literals involved. */ @@ -5825,8 +5825,8 @@ parsestrplus(struct compiling *c, const node *n) /* Just return the bytes object and we're done. */ if (PyArena_AddPyObject(c->c_arena, bytes_str) < 0) goto error; - return Constant(bytes_str, NULL, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + return Constant(bytes_str, NULL, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } /* We're not a bytes string, bytes_str should never have been set. */ @@ -5839,20 +5839,20 @@ error: FstringParser_Dealloc(&state); return NULL; } - -PyObject * -_PyAST_GetDocString(asdl_seq *body) -{ - if (!asdl_seq_LEN(body)) { - return NULL; - } - stmt_ty st = (stmt_ty)asdl_seq_GET(body, 0); - if (st->kind != Expr_kind) { - return NULL; - } - expr_ty e = st->v.Expr.value; - if (e->kind == Constant_kind && PyUnicode_CheckExact(e->v.Constant.value)) { - return e->v.Constant.value; - } - return NULL; -} + +PyObject * +_PyAST_GetDocString(asdl_seq *body) +{ + if (!asdl_seq_LEN(body)) { + return NULL; + } + stmt_ty st = (stmt_ty)asdl_seq_GET(body, 0); + if (st->kind != Expr_kind) { + return NULL; + } + expr_ty e = st->v.Expr.value; + if (e->kind == Constant_kind && PyUnicode_CheckExact(e->v.Constant.value)) { + return e->v.Constant.value; + } + return NULL; +} diff --git a/contrib/tools/python3/src/Python/ast_opt.c b/contrib/tools/python3/src/Python/ast_opt.c index 36e1d64f2e..ff786d6f8d 100644 --- a/contrib/tools/python3/src/Python/ast_opt.c +++ b/contrib/tools/python3/src/Python/ast_opt.c @@ -1,7 +1,7 @@ /* AST Optimizer */ #include "Python.h" #include "Python-ast.h" -#include "ast.h" +#include "ast.h" static int @@ -19,7 +19,7 @@ make_const(expr_ty node, PyObject *val, PyArena *arena) return 0; } node->kind = Constant_kind; - node->v.Constant.kind = NULL; + node->v.Constant.kind = NULL; node->v.Constant.value = val; return 1; } @@ -36,11 +36,11 @@ unary_not(PyObject *v) } static int -fold_unaryop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) +fold_unaryop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) { expr_ty arg = node->v.UnaryOp.operand; - if (arg->kind != Constant_kind) { + if (arg->kind != Constant_kind) { /* Fold not into comparison */ if (node->v.UnaryOp.op == Not && arg->kind == Compare_kind && asdl_seq_LEN(arg->v.Compare.ops) == 1) { @@ -82,7 +82,7 @@ fold_unaryop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) [UAdd] = PyNumber_Positive, [USub] = PyNumber_Negative, }; - PyObject *newval = ops[node->v.UnaryOp.op](arg->v.Constant.value); + PyObject *newval = ops[node->v.UnaryOp.op](arg->v.Constant.value); return make_const(node, newval, arena); } @@ -213,17 +213,17 @@ safe_mod(PyObject *v, PyObject *w) } static int -fold_binop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) +fold_binop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) { expr_ty lhs, rhs; lhs = node->v.BinOp.left; rhs = node->v.BinOp.right; - if (lhs->kind != Constant_kind || rhs->kind != Constant_kind) { + if (lhs->kind != Constant_kind || rhs->kind != Constant_kind) { return 1; } - PyObject *lv = lhs->v.Constant.value; - PyObject *rv = rhs->v.Constant.value; + PyObject *lv = lhs->v.Constant.value; + PyObject *rv = rhs->v.Constant.value; PyObject *newval; switch (node->v.BinOp.op) { @@ -275,7 +275,7 @@ make_const_tuple(asdl_seq *elts) { for (int i = 0; i < asdl_seq_LEN(elts); i++) { expr_ty e = (expr_ty)asdl_seq_GET(elts, i); - if (e->kind != Constant_kind) { + if (e->kind != Constant_kind) { return NULL; } } @@ -287,7 +287,7 @@ make_const_tuple(asdl_seq *elts) for (int i = 0; i < asdl_seq_LEN(elts); i++) { expr_ty e = (expr_ty)asdl_seq_GET(elts, i); - PyObject *v = e->v.Constant.value; + PyObject *v = e->v.Constant.value; Py_INCREF(v); PyTuple_SET_ITEM(newval, i, v); } @@ -295,7 +295,7 @@ make_const_tuple(asdl_seq *elts) } static int -fold_tuple(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) +fold_tuple(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) { PyObject *newval; @@ -307,50 +307,50 @@ fold_tuple(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) } static int -fold_subscr(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) +fold_subscr(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) { PyObject *newval; expr_ty arg, idx; arg = node->v.Subscript.value; - idx = node->v.Subscript.slice; + idx = node->v.Subscript.slice; if (node->v.Subscript.ctx != Load || - arg->kind != Constant_kind || - idx->kind != Constant_kind) + arg->kind != Constant_kind || + idx->kind != Constant_kind) { return 1; } - newval = PyObject_GetItem(arg->v.Constant.value, idx->v.Constant.value); + newval = PyObject_GetItem(arg->v.Constant.value, idx->v.Constant.value); return make_const(node, newval, arena); } /* Change literal list or set of constants into constant - tuple or frozenset respectively. Change literal list of - non-constants into tuple. + tuple or frozenset respectively. Change literal list of + non-constants into tuple. Used for right operand of "in" and "not in" tests and for iterable in "for" loop and comprehensions. */ static int -fold_iter(expr_ty arg, PyArena *arena, _PyASTOptimizeState *state) +fold_iter(expr_ty arg, PyArena *arena, _PyASTOptimizeState *state) { PyObject *newval; if (arg->kind == List_kind) { - /* First change a list into tuple. */ - asdl_seq *elts = arg->v.List.elts; - Py_ssize_t n = asdl_seq_LEN(elts); - for (Py_ssize_t i = 0; i < n; i++) { - expr_ty e = (expr_ty)asdl_seq_GET(elts, i); - if (e->kind == Starred_kind) { - return 1; - } - } - expr_context_ty ctx = arg->v.List.ctx; - arg->kind = Tuple_kind; - arg->v.Tuple.elts = elts; - arg->v.Tuple.ctx = ctx; - /* Try to create a constant tuple. */ - newval = make_const_tuple(elts); + /* First change a list into tuple. */ + asdl_seq *elts = arg->v.List.elts; + Py_ssize_t n = asdl_seq_LEN(elts); + for (Py_ssize_t i = 0; i < n; i++) { + expr_ty e = (expr_ty)asdl_seq_GET(elts, i); + if (e->kind == Starred_kind) { + return 1; + } + } + expr_context_ty ctx = arg->v.List.ctx; + arg->kind = Tuple_kind; + arg->v.Tuple.elts = elts; + arg->v.Tuple.ctx = ctx; + /* Try to create a constant tuple. */ + newval = make_const_tuple(elts); } else if (arg->kind == Set_kind) { newval = make_const_tuple(arg->v.Set.elts); @@ -365,7 +365,7 @@ fold_iter(expr_ty arg, PyArena *arena, _PyASTOptimizeState *state) } static int -fold_compare(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) +fold_compare(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) { asdl_int_seq *ops; asdl_seq *args; @@ -379,28 +379,28 @@ fold_compare(expr_ty node, PyArena *arena, _PyASTOptimizeState *state) i = asdl_seq_LEN(ops) - 1; int op = asdl_seq_GET(ops, i); if (op == In || op == NotIn) { - if (!fold_iter((expr_ty)asdl_seq_GET(args, i), arena, state)) { + if (!fold_iter((expr_ty)asdl_seq_GET(args, i), arena, state)) { return 0; } } return 1; } -static int astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); -static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); #define CALL(FUNC, TYPE, ARG) \ - if (!FUNC((ARG), ctx_, state)) \ + if (!FUNC((ARG), ctx_, state)) \ return 0; #define CALL_OPT(FUNC, TYPE, ARG) \ - if ((ARG) != NULL && !FUNC((ARG), ctx_, state)) \ + if ((ARG) != NULL && !FUNC((ARG), ctx_, state)) \ return 0; #define CALL_SEQ(FUNC, TYPE, ARG) { \ @@ -408,7 +408,7 @@ static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOp asdl_seq *seq = (ARG); /* avoid variable capture */ \ for (i = 0; i < asdl_seq_LEN(seq); i++) { \ TYPE elt = (TYPE)asdl_seq_GET(seq, i); \ - if (elt != NULL && !FUNC(elt, ctx_, state)) \ + if (elt != NULL && !FUNC(elt, ctx_, state)) \ return 0; \ } \ } @@ -418,25 +418,25 @@ static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOp asdl_int_seq *seq = (ARG); /* avoid variable capture */ \ for (i = 0; i < asdl_seq_LEN(seq); i++) { \ TYPE elt = (TYPE)asdl_seq_GET(seq, i); \ - if (!FUNC(elt, ctx_, state)) \ + if (!FUNC(elt, ctx_, state)) \ return 0; \ } \ } static int -astfold_body(asdl_seq *stmts, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_body(asdl_seq *stmts, PyArena *ctx_, _PyASTOptimizeState *state) { - int docstring = _PyAST_GetDocString(stmts) != NULL; + int docstring = _PyAST_GetDocString(stmts) != NULL; CALL_SEQ(astfold_stmt, stmt_ty, stmts); - if (!docstring && _PyAST_GetDocString(stmts) != NULL) { - stmt_ty st = (stmt_ty)asdl_seq_GET(stmts, 0); + if (!docstring && _PyAST_GetDocString(stmts) != NULL) { + stmt_ty st = (stmt_ty)asdl_seq_GET(stmts, 0); asdl_seq *values = _Py_asdl_seq_new(1, ctx_); if (!values) { return 0; } asdl_seq_SET(values, 0, st->v.Expr.value); - expr_ty expr = JoinedStr(values, st->lineno, st->col_offset, - st->end_lineno, st->end_col_offset, ctx_); + expr_ty expr = JoinedStr(values, st->lineno, st->col_offset, + st->end_lineno, st->end_col_offset, ctx_); if (!expr) { return 0; } @@ -446,7 +446,7 @@ astfold_body(asdl_seq *stmts, PyArena *ctx_, _PyASTOptimizeState *state) } static int -astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { switch (node_->kind) { case Module_kind: @@ -465,7 +465,7 @@ astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) } static int -astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { switch (node_->kind) { case BoolOp_kind: @@ -544,17 +544,17 @@ astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) break; case Subscript_kind: CALL(astfold_expr, expr_ty, node_->v.Subscript.value); - CALL(astfold_expr, expr_ty, node_->v.Subscript.slice); + CALL(astfold_expr, expr_ty, node_->v.Subscript.slice); CALL(fold_subscr, expr_ty, node_); break; case Starred_kind: CALL(astfold_expr, expr_ty, node_->v.Starred.value); break; - case Slice_kind: - CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.lower); - CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.upper); - CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.step); - break; + case Slice_kind: + CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.lower); + CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.upper); + CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.step); + break; case List_kind: CALL_SEQ(astfold_expr, expr_ty, node_->v.List.elts); break; @@ -563,9 +563,9 @@ astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) CALL(fold_tuple, expr_ty, node_); break; case Name_kind: - if (node_->v.Name.ctx == Load && - _PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) { - return make_const(node_, PyBool_FromLong(!state->optimize), ctx_); + if (node_->v.Name.ctx == Load && + _PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) { + return make_const(node_, PyBool_FromLong(!state->optimize), ctx_); } break; default: @@ -575,14 +575,14 @@ astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) } static int -astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { CALL(astfold_expr, expr_ty, node_->value); return 1; } static int -astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { CALL(astfold_expr, expr_ty, node_->target); CALL(astfold_expr, expr_ty, node_->iter); @@ -593,9 +593,9 @@ astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState } static int -astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { - CALL_SEQ(astfold_arg, arg_ty, node_->posonlyargs); + CALL_SEQ(astfold_arg, arg_ty, node_->posonlyargs); CALL_SEQ(astfold_arg, arg_ty, node_->args); CALL_OPT(astfold_arg, arg_ty, node_->vararg); CALL_SEQ(astfold_arg, arg_ty, node_->kwonlyargs); @@ -606,33 +606,33 @@ astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) } static int -astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { - if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { - CALL_OPT(astfold_expr, expr_ty, node_->annotation); - } + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->annotation); + } return 1; } static int -astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { switch (node_->kind) { case FunctionDef_kind: CALL(astfold_arguments, arguments_ty, node_->v.FunctionDef.args); CALL(astfold_body, asdl_seq, node_->v.FunctionDef.body); CALL_SEQ(astfold_expr, expr_ty, node_->v.FunctionDef.decorator_list); - if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { - CALL_OPT(astfold_expr, expr_ty, node_->v.FunctionDef.returns); - } + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->v.FunctionDef.returns); + } break; case AsyncFunctionDef_kind: CALL(astfold_arguments, arguments_ty, node_->v.AsyncFunctionDef.args); CALL(astfold_body, asdl_seq, node_->v.AsyncFunctionDef.body); CALL_SEQ(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.decorator_list); - if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { - CALL_OPT(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.returns); - } + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.returns); + } break; case ClassDef_kind: CALL_SEQ(astfold_expr, expr_ty, node_->v.ClassDef.bases); @@ -656,9 +656,9 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) break; case AnnAssign_kind: CALL(astfold_expr, expr_ty, node_->v.AnnAssign.target); - if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { - CALL(astfold_expr, expr_ty, node_->v.AnnAssign.annotation); - } + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL(astfold_expr, expr_ty, node_->v.AnnAssign.annotation); + } CALL_OPT(astfold_expr, expr_ty, node_->v.AnnAssign.value); break; case For_kind: @@ -717,7 +717,7 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) } static int -astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { switch (node_->kind) { case ExceptHandler_kind: @@ -731,7 +731,7 @@ astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState } static int -astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { CALL(astfold_expr, expr_ty, node_->context_expr); CALL_OPT(astfold_expr, expr_ty, node_->optional_vars); @@ -744,9 +744,9 @@ astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) #undef CALL_INT_SEQ int -_PyAST_Optimize(mod_ty mod, PyArena *arena, _PyASTOptimizeState *state) +_PyAST_Optimize(mod_ty mod, PyArena *arena, _PyASTOptimizeState *state) { - int ret = astfold_mod(mod, arena, state); + int ret = astfold_mod(mod, arena, state); assert(ret || PyErr_Occurred()); return ret; } diff --git a/contrib/tools/python3/src/Python/ast_unparse.c b/contrib/tools/python3/src/Python/ast_unparse.c index 99610d2661..e699751a05 100644 --- a/contrib/tools/python3/src/Python/ast_unparse.c +++ b/contrib/tools/python3/src/Python/ast_unparse.c @@ -1,4 +1,4 @@ -#include <float.h> /* DBL_MAX_10_EXP */ +#include <float.h> /* DBL_MAX_10_EXP */ #include <stdbool.h> #include "Python.h" #include "Python-ast.h" @@ -7,8 +7,8 @@ static PyObject *_str_open_br; static PyObject *_str_dbl_open_br; static PyObject *_str_close_br; static PyObject *_str_dbl_close_br; -static PyObject *_str_inf; -static PyObject *_str_replace_inf; +static PyObject *_str_inf; +static PyObject *_str_replace_inf; /* Forward declarations for recursion via helper functions. */ static PyObject * @@ -18,9 +18,9 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level); static int append_joinedstr(_PyUnicodeWriter *writer, expr_ty e, bool is_format_spec); static int -append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e); +append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e); static int -append_ast_slice(_PyUnicodeWriter *writer, expr_ty e); +append_ast_slice(_PyUnicodeWriter *writer, expr_ty e); static int append_charp(_PyUnicodeWriter *writer, const char *charp) @@ -64,28 +64,28 @@ append_charp(_PyUnicodeWriter *writer, const char *charp) static int append_repr(_PyUnicodeWriter *writer, PyObject *obj) { - PyObject *repr = PyObject_Repr(obj); - + PyObject *repr = PyObject_Repr(obj); + if (!repr) { return -1; } - - if ((PyFloat_CheckExact(obj) && Py_IS_INFINITY(PyFloat_AS_DOUBLE(obj))) || - PyComplex_CheckExact(obj)) - { - PyObject *new_repr = PyUnicode_Replace( - repr, - _str_inf, - _str_replace_inf, - -1 - ); - Py_DECREF(repr); - if (!new_repr) { - return -1; - } - repr = new_repr; - } - int ret = _PyUnicodeWriter_WriteStr(writer, repr); + + if ((PyFloat_CheckExact(obj) && Py_IS_INFINITY(PyFloat_AS_DOUBLE(obj))) || + PyComplex_CheckExact(obj)) + { + PyObject *new_repr = PyUnicode_Replace( + repr, + _str_inf, + _str_replace_inf, + -1 + ); + Py_DECREF(repr); + if (!new_repr) { + return -1; + } + repr = new_repr; + } + int ret = _PyUnicodeWriter_WriteStr(writer, repr); Py_DECREF(repr); return ret; } @@ -211,30 +211,30 @@ static int append_ast_args(_PyUnicodeWriter *writer, arguments_ty args) { bool first; - Py_ssize_t i, di, arg_count, posonlyarg_count, default_count; + Py_ssize_t i, di, arg_count, posonlyarg_count, default_count; first = true; - /* positional-only and positional arguments with defaults */ - posonlyarg_count = asdl_seq_LEN(args->posonlyargs); + /* positional-only and positional arguments with defaults */ + posonlyarg_count = asdl_seq_LEN(args->posonlyargs); arg_count = asdl_seq_LEN(args->args); default_count = asdl_seq_LEN(args->defaults); - for (i = 0; i < posonlyarg_count + arg_count; i++) { + for (i = 0; i < posonlyarg_count + arg_count; i++) { APPEND_STR_IF_NOT_FIRST(", "); - if (i < posonlyarg_count){ - APPEND(arg, (arg_ty)asdl_seq_GET(args->posonlyargs, i)); - } else { - APPEND(arg, (arg_ty)asdl_seq_GET(args->args, i-posonlyarg_count)); - } + if (i < posonlyarg_count){ + APPEND(arg, (arg_ty)asdl_seq_GET(args->posonlyargs, i)); + } else { + APPEND(arg, (arg_ty)asdl_seq_GET(args->args, i-posonlyarg_count)); + } - di = i - posonlyarg_count - arg_count + default_count; + di = i - posonlyarg_count - arg_count + default_count; if (di >= 0) { APPEND_STR("="); APPEND_EXPR((expr_ty)asdl_seq_GET(args->defaults, di), PR_TEST); } - if (posonlyarg_count && i + 1 == posonlyarg_count) { - APPEND_STR(", /"); - } + if (posonlyarg_count && i + 1 == posonlyarg_count) { + APPEND_STR(", /"); + } } /* vararg, or bare '*' if no varargs but keyword-only arguments present */ @@ -277,9 +277,9 @@ static int append_ast_lambda(_PyUnicodeWriter *writer, expr_ty e, int level) { APPEND_STR_IF(level > PR_TEST, "("); - Py_ssize_t n_positional = (asdl_seq_LEN(e->v.Lambda.args->args) + - asdl_seq_LEN(e->v.Lambda.args->posonlyargs)); - APPEND_STR(n_positional ? "lambda " : "lambda"); + Py_ssize_t n_positional = (asdl_seq_LEN(e->v.Lambda.args->args) + + asdl_seq_LEN(e->v.Lambda.args->posonlyargs)); + APPEND_STR(n_positional ? "lambda " : "lambda"); APPEND(args, e->v.Lambda.args); APPEND_STR(": "); APPEND_EXPR(e->v.Lambda.body, PR_TEST); @@ -601,7 +601,7 @@ append_fstring_element(_PyUnicodeWriter *writer, expr_ty e, bool is_format_spec) case JoinedStr_kind: return append_joinedstr(writer, e, is_format_spec); case FormattedValue_kind: - return append_formattedvalue(writer, e); + return append_formattedvalue(writer, e); default: PyErr_SetString(PyExc_SystemError, "unknown expression kind inside f-string"); @@ -658,7 +658,7 @@ append_joinedstr(_PyUnicodeWriter *writer, expr_ty e, bool is_format_spec) } static int -append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e) +append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e) { const char *conversion; const char *outer_brace = "{"; @@ -716,37 +716,37 @@ append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e) } static int -append_ast_constant(_PyUnicodeWriter *writer, PyObject *constant) -{ - if (PyTuple_CheckExact(constant)) { - Py_ssize_t i, elem_count; - - elem_count = PyTuple_GET_SIZE(constant); - APPEND_STR("("); - for (i = 0; i < elem_count; i++) { - APPEND_STR_IF(i > 0, ", "); - if (append_ast_constant(writer, PyTuple_GET_ITEM(constant, i)) < 0) { - return -1; - } - } - - APPEND_STR_IF(elem_count == 1, ","); - APPEND_STR(")"); - return 0; - } - return append_repr(writer, constant); -} - -static int +append_ast_constant(_PyUnicodeWriter *writer, PyObject *constant) +{ + if (PyTuple_CheckExact(constant)) { + Py_ssize_t i, elem_count; + + elem_count = PyTuple_GET_SIZE(constant); + APPEND_STR("("); + for (i = 0; i < elem_count; i++) { + APPEND_STR_IF(i > 0, ", "); + if (append_ast_constant(writer, PyTuple_GET_ITEM(constant, i)) < 0) { + return -1; + } + } + + APPEND_STR_IF(elem_count == 1, ","); + APPEND_STR(")"); + return 0; + } + return append_repr(writer, constant); +} + +static int append_ast_attribute(_PyUnicodeWriter *writer, expr_ty e) { const char *period; - expr_ty v = e->v.Attribute.value; - APPEND_EXPR(v, PR_ATOM); + expr_ty v = e->v.Attribute.value; + APPEND_EXPR(v, PR_ATOM); /* Special case: integers require a space for attribute access to be - unambiguous. */ - if (v->kind == Constant_kind && PyLong_CheckExact(v->v.Constant.value)) { + unambiguous. */ + if (v->kind == Constant_kind && PyLong_CheckExact(v->v.Constant.value)) { period = " ."; } else { @@ -758,42 +758,42 @@ append_ast_attribute(_PyUnicodeWriter *writer, expr_ty e) } static int -append_ast_slice(_PyUnicodeWriter *writer, expr_ty e) +append_ast_slice(_PyUnicodeWriter *writer, expr_ty e) { - if (e->v.Slice.lower) { - APPEND_EXPR(e->v.Slice.lower, PR_TEST); + if (e->v.Slice.lower) { + APPEND_EXPR(e->v.Slice.lower, PR_TEST); } APPEND_STR(":"); - if (e->v.Slice.upper) { - APPEND_EXPR(e->v.Slice.upper, PR_TEST); + if (e->v.Slice.upper) { + APPEND_EXPR(e->v.Slice.upper, PR_TEST); } - if (e->v.Slice.step) { + if (e->v.Slice.step) { APPEND_STR(":"); - APPEND_EXPR(e->v.Slice.step, PR_TEST); + APPEND_EXPR(e->v.Slice.step, PR_TEST); } return 0; } static int -append_ast_subscript(_PyUnicodeWriter *writer, expr_ty e) +append_ast_subscript(_PyUnicodeWriter *writer, expr_ty e) { - APPEND_EXPR(e->v.Subscript.value, PR_ATOM); - int level = PR_TUPLE; - expr_ty slice = e->v.Subscript.slice; - if (slice->kind == Tuple_kind) { - for (Py_ssize_t i = 0; i < asdl_seq_LEN(slice->v.Tuple.elts); i++) { - expr_ty element = asdl_seq_GET(slice->v.Tuple.elts, i); - if (element->kind == Starred_kind) { - ++level; - break; - } - } - } + APPEND_EXPR(e->v.Subscript.value, PR_ATOM); + int level = PR_TUPLE; + expr_ty slice = e->v.Subscript.slice; + if (slice->kind == Tuple_kind) { + for (Py_ssize_t i = 0; i < asdl_seq_LEN(slice->v.Tuple.elts); i++) { + expr_ty element = asdl_seq_GET(slice->v.Tuple.elts, i); + if (element->kind == Starred_kind) { + ++level; + break; + } + } + } APPEND_STR("["); - APPEND_EXPR(e->v.Subscript.slice, level); + APPEND_EXPR(e->v.Subscript.slice, level); APPEND_STR_FINISH("]"); } @@ -836,17 +836,17 @@ append_ast_await(_PyUnicodeWriter *writer, expr_ty e, int level) } static int -append_named_expr(_PyUnicodeWriter *writer, expr_ty e, int level) -{ - APPEND_STR_IF(level > PR_TUPLE, "("); - APPEND_EXPR(e->v.NamedExpr.target, PR_ATOM); - APPEND_STR(" := "); - APPEND_EXPR(e->v.NamedExpr.value, PR_ATOM); - APPEND_STR_IF(level > PR_TUPLE, ")"); - return 0; -} - -static int +append_named_expr(_PyUnicodeWriter *writer, expr_ty e, int level) +{ + APPEND_STR_IF(level > PR_TUPLE, "("); + APPEND_EXPR(e->v.NamedExpr.target, PR_ATOM); + APPEND_STR(" := "); + APPEND_EXPR(e->v.NamedExpr.value, PR_ATOM); + APPEND_STR_IF(level > PR_TUPLE, ")"); + return 0; +} + +static int append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level) { switch (e->kind) { @@ -883,18 +883,18 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level) case Call_kind: return append_ast_call(writer, e); case Constant_kind: - if (e->v.Constant.value == Py_Ellipsis) { - APPEND_STR_FINISH("..."); - } - if (e->v.Constant.kind != NULL - && -1 == _PyUnicodeWriter_WriteStr(writer, e->v.Constant.kind)) { - return -1; - } - return append_ast_constant(writer, e->v.Constant.value); + if (e->v.Constant.value == Py_Ellipsis) { + APPEND_STR_FINISH("..."); + } + if (e->v.Constant.kind != NULL + && -1 == _PyUnicodeWriter_WriteStr(writer, e->v.Constant.kind)) { + return -1; + } + return append_ast_constant(writer, e->v.Constant.value); case JoinedStr_kind: return append_joinedstr(writer, e, false); case FormattedValue_kind: - return append_formattedvalue(writer, e); + return append_formattedvalue(writer, e); /* The following exprs can be assignment targets. */ case Attribute_kind: return append_ast_attribute(writer, e); @@ -902,16 +902,16 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level) return append_ast_subscript(writer, e); case Starred_kind: return append_ast_starred(writer, e); - case Slice_kind: - return append_ast_slice(writer, e); + case Slice_kind: + return append_ast_slice(writer, e); case Name_kind: return _PyUnicodeWriter_WriteStr(writer, e->v.Name.id); case List_kind: return append_ast_list(writer, e); case Tuple_kind: return append_ast_tuple(writer, e, level); - case NamedExpr_kind: - return append_named_expr(writer, e, level); + case NamedExpr_kind: + return append_named_expr(writer, e, level); default: PyErr_SetString(PyExc_SystemError, "unknown expression kind"); @@ -938,14 +938,14 @@ maybe_init_static_strings(void) !(_str_dbl_close_br = PyUnicode_InternFromString("}}"))) { return -1; } - if (!_str_inf && - !(_str_inf = PyUnicode_FromString("inf"))) { - return -1; - } - if (!_str_replace_inf && - !(_str_replace_inf = PyUnicode_FromFormat("1e%d", 1 + DBL_MAX_10_EXP))) { - return -1; - } + if (!_str_inf && + !(_str_inf = PyUnicode_FromString("inf"))) { + return -1; + } + if (!_str_replace_inf && + !(_str_replace_inf = PyUnicode_FromFormat("1e%d", 1 + DBL_MAX_10_EXP))) { + return -1; + } return 0; } diff --git a/contrib/tools/python3/src/Python/bltinmodule.c b/contrib/tools/python3/src/Python/bltinmodule.c index f2495b2578..21c70f9a6c 100644 --- a/contrib/tools/python3/src/Python/bltinmodule.c +++ b/contrib/tools/python3/src/Python/bltinmodule.c @@ -1,13 +1,13 @@ /* Built-in functions */ #include "Python.h" -#include <ctype.h> +#include <ctype.h> #include "ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" +#undef Yield /* undefine macro conflicting with <winbase.h> */ +#include "pycore_object.h" +#include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tupleobject.h" _Py_IDENTIFIER(__builtins__); _Py_IDENTIFIER(__dict__); @@ -56,7 +56,7 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) } continue; } - new_base = PyObject_CallOneArg(meth, bases); + new_base = PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; @@ -71,7 +71,7 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) /* If this is a first successful replacement, create new_bases list and copy previously encountered bases. */ if (!(new_bases = PyList_New(i))) { - Py_DECREF(new_base); + Py_DECREF(new_base); goto error; } for (j = 0; j < i; j++) { @@ -82,7 +82,7 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { - Py_DECREF(new_base); + Py_DECREF(new_base); goto error; } Py_DECREF(new_base); @@ -104,9 +104,9 @@ static PyObject * builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *func, *name, *winner, *prep; - PyObject *cls = NULL, *cell = NULL, *ns = NULL, *meta = NULL, *orig_bases = NULL; - PyObject *mkw = NULL, *bases = NULL; + PyObject *func, *name, *winner, *prep; + PyObject *cls = NULL, *cell = NULL, *ns = NULL, *meta = NULL, *orig_bases = NULL; + PyObject *mkw = NULL, *bases = NULL; int isclass = 0; /* initialize to prevent gcc warning */ if (nargs < 2) { @@ -126,7 +126,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, "__build_class__: name is not a string"); return NULL; } - orig_bases = _PyTuple_FromArray(args + 2, nargs - 2); + orig_bases = _PyTuple_FromArray(args + 2, nargs - 2); if (orig_bases == NULL) return NULL; @@ -143,21 +143,21 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, else { mkw = _PyStack_AsDict(args + nargs, kwnames); if (mkw == NULL) { - goto error; + goto error; } - meta = _PyDict_GetItemIdWithError(mkw, &PyId_metaclass); + meta = _PyDict_GetItemIdWithError(mkw, &PyId_metaclass); if (meta != NULL) { Py_INCREF(meta); if (_PyDict_DelItemId(mkw, &PyId_metaclass) < 0) { - goto error; + goto error; } /* metaclass is explicitly given, check if it's indeed a class */ isclass = PyType_Check(meta); } - else if (PyErr_Occurred()) { - goto error; - } + else if (PyErr_Occurred()) { + goto error; + } } if (meta == NULL) { /* if there are no bases, use type: */ @@ -167,7 +167,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, /* else get the type of the first base */ else { PyObject *base0 = PyTuple_GET_ITEM(bases, 0); - meta = (PyObject *)Py_TYPE(base0); + meta = (PyObject *)Py_TYPE(base0); } Py_INCREF(meta); isclass = 1; /* meta is really a class */ @@ -179,7 +179,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, winner = (PyObject *)_PyType_CalculateMetaclass((PyTypeObject *)meta, bases); if (winner == NULL) { - goto error; + goto error; } if (winner != meta) { Py_DECREF(meta); @@ -197,11 +197,11 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, } else { PyObject *pargs[2] = {name, bases}; - ns = PyObject_VectorcallDict(prep, pargs, 2, mkw); + ns = PyObject_VectorcallDict(prep, pargs, 2, mkw); Py_DECREF(prep); } if (ns == NULL) { - goto error; + goto error; } if (!PyMapping_Check(ns)) { PyErr_Format(PyExc_TypeError, @@ -220,7 +220,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, } } PyObject *margs[3] = {name, bases, ns}; - cls = PyObject_VectorcallDict(meta, margs, 3, mkw); + cls = PyObject_VectorcallDict(meta, margs, 3, mkw); if (cls != NULL && PyType_Check(cls) && PyCell_Check(cell)) { PyObject *cell_cls = PyCell_GET(cell); if (cell_cls != cls) { @@ -228,32 +228,32 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, const char *msg = "__class__ not set defining %.200R as %.200R. " "Was __classcell__ propagated to type.__new__?"; - PyErr_Format(PyExc_RuntimeError, msg, name, cls); + PyErr_Format(PyExc_RuntimeError, msg, name, cls); } else { const char *msg = "__class__ set to %.200R defining %.200R as %.200R"; PyErr_Format(PyExc_TypeError, msg, cell_cls, name, cls); } - Py_DECREF(cls); - cls = NULL; - goto error; + Py_DECREF(cls); + cls = NULL; + goto error; } } } error: Py_XDECREF(cell); - Py_XDECREF(ns); - Py_XDECREF(meta); + Py_XDECREF(ns); + Py_XDECREF(meta); Py_XDECREF(mkw); if (bases != orig_bases) { Py_DECREF(orig_bases); } - Py_DECREF(bases); + Py_DECREF(bases); return cls; } PyDoc_STRVAR(build_class_doc, -"__build_class__(func, name, /, *bases, [metaclass], **kwds) -> class\n\ +"__build_class__(func, name, /, *bases, [metaclass], **kwds) -> class\n\ \n\ Internal helper function used by the class statement."); @@ -474,13 +474,13 @@ builtin_breakpoint(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb PyErr_SetString(PyExc_RuntimeError, "lost sys.breakpointhook"); return NULL; } - - if (PySys_Audit("builtins.breakpoint", "O", hook) < 0) { - return NULL; - } - + + if (PySys_Audit("builtins.breakpoint", "O", hook) < 0) { + return NULL; + } + Py_INCREF(hook); - PyObject *retval = PyObject_Vectorcall(hook, args, nargs, keywords); + PyObject *retval = PyObject_Vectorcall(hook, args, nargs, keywords); Py_DECREF(hook); return retval; } @@ -566,7 +566,7 @@ filter_next(filterobject *lz) ok = PyObject_IsTrue(item); } else { PyObject *good; - good = PyObject_CallOneArg(lz->func, item); + good = PyObject_CallOneArg(lz->func, item); if (good == NULL) { Py_DECREF(item); return NULL; @@ -583,7 +583,7 @@ filter_next(filterobject *lz) } static PyObject * -filter_reduce(filterobject *lz, PyObject *Py_UNUSED(ignored)) +filter_reduce(filterobject *lz, PyObject *Py_UNUSED(ignored)) { return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->func, lz->it); } @@ -608,10 +608,10 @@ PyTypeObject PyFilter_Type = { 0, /* tp_itemsize */ /* methods */ (destructor)filter_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ + 0, /* tp_vectorcall_offset */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_as_async */ + 0, /* tp_as_async */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -693,8 +693,8 @@ compile as builtin_compile flags: int = 0 dont_inherit: bool(accept={int}) = False optimize: int = -1 - * - _feature_version as feature_version: int = -1 + * + _feature_version as feature_version: int = -1 Compile source into a code object that can be executed by exec() or eval(). @@ -713,24 +713,24 @@ in addition to any features explicitly specified. static PyObject * builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, const char *mode, int flags, int dont_inherit, - int optimize, int feature_version) -/*[clinic end generated code: output=b0c09c84f116d3d7 input=40171fb92c1d580d]*/ + int optimize, int feature_version) +/*[clinic end generated code: output=b0c09c84f116d3d7 input=40171fb92c1d580d]*/ { PyObject *source_copy; const char *str; int compile_mode = -1; int is_ast; - int start[] = {Py_file_input, Py_eval_input, Py_single_input, Py_func_type_input}; + int start[] = {Py_file_input, Py_eval_input, Py_single_input, Py_func_type_input}; PyObject *result; - PyCompilerFlags cf = _PyCompilerFlags_INIT; + PyCompilerFlags cf = _PyCompilerFlags_INIT; cf.cf_flags = flags | PyCF_SOURCE_IS_UTF8; - if (feature_version >= 0 && (flags & PyCF_ONLY_AST)) { - cf.cf_feature_version = feature_version; - } + if (feature_version >= 0 && (flags & PyCF_ONLY_AST)) { + cf.cf_feature_version = feature_version; + } if (flags & - ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_COMPILE_MASK)) + ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_COMPILE_MASK)) { PyErr_SetString(PyExc_ValueError, "compile(): unrecognised flags"); @@ -754,21 +754,21 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, compile_mode = 1; else if (strcmp(mode, "single") == 0) compile_mode = 2; - else if (strcmp(mode, "func_type") == 0) { - if (!(flags & PyCF_ONLY_AST)) { - PyErr_SetString(PyExc_ValueError, - "compile() mode 'func_type' requires flag PyCF_ONLY_AST"); - goto error; - } - compile_mode = 3; - } + else if (strcmp(mode, "func_type") == 0) { + if (!(flags & PyCF_ONLY_AST)) { + PyErr_SetString(PyExc_ValueError, + "compile() mode 'func_type' requires flag PyCF_ONLY_AST"); + goto error; + } + compile_mode = 3; + } else { - const char *msg; - if (flags & PyCF_ONLY_AST) - msg = "compile() mode must be 'exec', 'eval', 'single' or 'func_type'"; - else - msg = "compile() mode must be 'exec', 'eval' or 'single'"; - PyErr_SetString(PyExc_ValueError, msg); + const char *msg; + if (flags & PyCF_ONLY_AST) + msg = "compile() mode must be 'exec', 'eval', 'single' or 'func_type'"; + else + msg = "compile() mode must be 'exec', 'eval' or 'single'"; + PyErr_SetString(PyExc_ValueError, msg); goto error; } @@ -803,12 +803,12 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, goto finally; } - str = _Py_SourceAsString(source, "compile", "string, bytes or AST", &cf, &source_copy); + str = _Py_SourceAsString(source, "compile", "string, bytes or AST", &cf, &source_copy); if (str == NULL) goto error; result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize); - + Py_XDECREF(source_copy); goto finally; @@ -915,31 +915,31 @@ builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals, return NULL; } - if (_PyDict_GetItemIdWithError(globals, &PyId___builtins__) == NULL) { + if (_PyDict_GetItemIdWithError(globals, &PyId___builtins__) == NULL) { if (_PyDict_SetItemId(globals, &PyId___builtins__, PyEval_GetBuiltins()) != 0) return NULL; } - else if (PyErr_Occurred()) { - return NULL; - } + else if (PyErr_Occurred()) { + return NULL; + } if (PyCode_Check(source)) { - if (PySys_Audit("exec", "O", source) < 0) { - return NULL; - } - + if (PySys_Audit("exec", "O", source) < 0) { + return NULL; + } + if (PyCode_GetNumFree((PyCodeObject *)source) > 0) { PyErr_SetString(PyExc_TypeError, - "code object passed to eval() may not contain free variables"); + "code object passed to eval() may not contain free variables"); return NULL; } return PyEval_EvalCode(source, globals, locals); } - PyCompilerFlags cf = _PyCompilerFlags_INIT; + PyCompilerFlags cf = _PyCompilerFlags_INIT; cf.cf_flags = PyCF_SOURCE_IS_UTF8; - str = _Py_SourceAsString(source, "eval", "string, bytes or code", &cf, &source_copy); + str = _Py_SourceAsString(source, "eval", "string, bytes or code", &cf, &source_copy); if (str == NULL) return NULL; @@ -994,29 +994,29 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, if (!PyDict_Check(globals)) { PyErr_Format(PyExc_TypeError, "exec() globals must be a dict, not %.100s", - Py_TYPE(globals)->tp_name); + Py_TYPE(globals)->tp_name); return NULL; } if (!PyMapping_Check(locals)) { PyErr_Format(PyExc_TypeError, "locals must be a mapping or None, not %.100s", - Py_TYPE(locals)->tp_name); + Py_TYPE(locals)->tp_name); return NULL; } - if (_PyDict_GetItemIdWithError(globals, &PyId___builtins__) == NULL) { + if (_PyDict_GetItemIdWithError(globals, &PyId___builtins__) == NULL) { if (_PyDict_SetItemId(globals, &PyId___builtins__, PyEval_GetBuiltins()) != 0) return NULL; } - else if (PyErr_Occurred()) { - return NULL; - } + else if (PyErr_Occurred()) { + return NULL; + } if (PyCode_Check(source)) { - if (PySys_Audit("exec", "O", source) < 0) { - return NULL; - } - + if (PySys_Audit("exec", "O", source) < 0) { + return NULL; + } + if (PyCode_GetNumFree((PyCodeObject *)source) > 0) { PyErr_SetString(PyExc_TypeError, "code object passed to exec() may not " @@ -1028,9 +1028,9 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, else { PyObject *source_copy; const char *str; - PyCompilerFlags cf = _PyCompilerFlags_INIT; + PyCompilerFlags cf = _PyCompilerFlags_INIT; cf.cf_flags = PyCF_SOURCE_IS_UTF8; - str = _Py_SourceAsString(source, "exec", + str = _Py_SourceAsString(source, "exec", "string, bytes or code", &cf, &source_copy); if (str == NULL) @@ -1053,21 +1053,21 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, static PyObject * builtin_getattr(PyObject *self, PyObject *const *args, Py_ssize_t nargs) { - PyObject *v, *name, *result; + PyObject *v, *name, *result; - if (!_PyArg_CheckPositional("getattr", nargs, 2, 3)) + if (!_PyArg_CheckPositional("getattr", nargs, 2, 3)) return NULL; - v = args[0]; - name = args[1]; + v = args[0]; + name = args[1]; if (!PyUnicode_Check(name)) { PyErr_SetString(PyExc_TypeError, "getattr(): attribute name must be string"); return NULL; } - if (nargs > 2) { + if (nargs > 2) { if (_PyObject_LookupAttr(v, name, &result) == 0) { - PyObject *dflt = args[2]; + PyObject *dflt = args[2]; Py_INCREF(dflt); return dflt; } @@ -1162,14 +1162,14 @@ static PyObject * builtin_id(PyModuleDef *self, PyObject *v) /*[clinic end generated code: output=0aa640785f697f65 input=5a534136419631f4]*/ { - PyObject *id = PyLong_FromVoidPtr(v); - - if (id && PySys_Audit("builtins.id", "O", id) < 0) { - Py_DECREF(id); - return NULL; - } - - return id; + PyObject *id = PyLong_FromVoidPtr(v); + + if (id && PySys_Audit("builtins.id", "O", id) < 0) { + Py_DECREF(id); + return NULL; + } + + return id; } @@ -1249,22 +1249,22 @@ map_next(mapobject *lz) PyObject *small_stack[_PY_FASTCALL_SMALL_STACK]; PyObject **stack; PyObject *result = NULL; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); - const Py_ssize_t niters = PyTuple_GET_SIZE(lz->iters); + const Py_ssize_t niters = PyTuple_GET_SIZE(lz->iters); if (niters <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) { stack = small_stack; } else { stack = PyMem_Malloc(niters * sizeof(stack[0])); if (stack == NULL) { - _PyErr_NoMemory(tstate); + _PyErr_NoMemory(tstate); return NULL; } } - Py_ssize_t nargs = 0; - for (Py_ssize_t i=0; i < niters; i++) { + Py_ssize_t nargs = 0; + for (Py_ssize_t i=0; i < niters; i++) { PyObject *it = PyTuple_GET_ITEM(lz->iters, i); PyObject *val = Py_TYPE(it)->tp_iternext(it); if (val == NULL) { @@ -1274,10 +1274,10 @@ map_next(mapobject *lz) nargs++; } - result = _PyObject_VectorcallTstate(tstate, lz->func, stack, nargs, NULL); + result = _PyObject_VectorcallTstate(tstate, lz->func, stack, nargs, NULL); exit: - for (Py_ssize_t i=0; i < nargs; i++) { + for (Py_ssize_t i=0; i < nargs; i++) { Py_DECREF(stack[i]); } if (stack != small_stack) { @@ -1287,7 +1287,7 @@ exit: } static PyObject * -map_reduce(mapobject *lz, PyObject *Py_UNUSED(ignored)) +map_reduce(mapobject *lz, PyObject *Py_UNUSED(ignored)) { Py_ssize_t numargs = PyTuple_GET_SIZE(lz->iters); PyObject *args = PyTuple_New(numargs+1); @@ -1324,10 +1324,10 @@ PyTypeObject PyMap_Type = { 0, /* tp_itemsize */ /* methods */ (destructor)map_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ + 0, /* tp_vectorcall_offset */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_as_async */ + 0, /* tp_as_async */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1368,22 +1368,22 @@ builtin_next(PyObject *self, PyObject *const *args, Py_ssize_t nargs) { PyObject *it, *res; - if (!_PyArg_CheckPositional("next", nargs, 1, 2)) + if (!_PyArg_CheckPositional("next", nargs, 1, 2)) return NULL; - it = args[0]; + it = args[0]; if (!PyIter_Check(it)) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not an iterator", - Py_TYPE(it)->tp_name); + Py_TYPE(it)->tp_name); return NULL; } - res = (*Py_TYPE(it)->tp_iternext)(it); + res = (*Py_TYPE(it)->tp_iternext)(it); if (res != NULL) { return res; - } else if (nargs > 1) { - PyObject *def = args[1]; + } else if (nargs > 1) { + PyObject *def = args[1]; if (PyErr_Occurred()) { if(!PyErr_ExceptionMatches(PyExc_StopIteration)) return NULL; @@ -1499,22 +1499,22 @@ builtin_hex(PyObject *module, PyObject *number) /* AC: cannot convert yet, as needs PEP 457 group support in inspect */ static PyObject * -builtin_iter(PyObject *self, PyObject *const *args, Py_ssize_t nargs) +builtin_iter(PyObject *self, PyObject *const *args, Py_ssize_t nargs) { - PyObject *v; + PyObject *v; - if (!_PyArg_CheckPositional("iter", nargs, 1, 2)) + if (!_PyArg_CheckPositional("iter", nargs, 1, 2)) return NULL; - v = args[0]; - if (nargs == 1) + v = args[0]; + if (nargs == 1) return PyObject_GetIter(v); if (!PyCallable_Check(v)) { PyErr_SetString(PyExc_TypeError, "iter(v, w): v must be callable"); return NULL; } - PyObject *sentinel = args[1]; - return PyCallIter_New(v, sentinel); + PyObject *sentinel = args[1]; + return PyCallIter_New(v, sentinel); } PyDoc_STRVAR(iter_doc, @@ -1582,15 +1582,15 @@ min_max(PyObject *args, PyObject *kwds, int op) const int positional = PyTuple_Size(args) > 1; int ret; - if (positional) { + if (positional) { v = args; - } - else if (!PyArg_UnpackTuple(args, name, 1, 1, &v)) { - if (PyExceptionClass_Check(PyExc_TypeError)) { - PyErr_Format(PyExc_TypeError, "%s expected at least 1 argument, got 0", name); - } + } + else if (!PyArg_UnpackTuple(args, name, 1, 1, &v)) { + if (PyExceptionClass_Check(PyExc_TypeError)) { + PyErr_Format(PyExc_TypeError, "%s expected at least 1 argument, got 0", name); + } return NULL; - } + } emptytuple = PyTuple_New(0); if (emptytuple == NULL) @@ -1614,16 +1614,16 @@ min_max(PyObject *args, PyObject *kwds, int op) return NULL; } - if (keyfunc == Py_None) { - keyfunc = NULL; - } - + if (keyfunc == Py_None) { + keyfunc = NULL; + } + maxitem = NULL; /* the result */ maxval = NULL; /* the value associated with the result */ while (( item = PyIter_Next(it) )) { /* get the value from the key function */ if (keyfunc != NULL) { - val = PyObject_CallOneArg(keyfunc, item); + val = PyObject_CallOneArg(keyfunc, item); if (val == NULL) goto Fail_it_item; } @@ -1780,7 +1780,7 @@ builtin_ord(PyObject *module, PyObject *c) else { PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but " \ - "%.200s found", Py_TYPE(c)->tp_name); + "%.200s found", Py_TYPE(c)->tp_name); return NULL; } @@ -1795,22 +1795,22 @@ builtin_ord(PyObject *module, PyObject *c) /*[clinic input] pow as builtin_pow - base: object - exp: object - mod: object = None + base: object + exp: object + mod: object = None -Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments +Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments Some types, such as ints, are able to use a more efficient algorithm when invoked using the three argument form. [clinic start generated code]*/ static PyObject * -builtin_pow_impl(PyObject *module, PyObject *base, PyObject *exp, - PyObject *mod) -/*[clinic end generated code: output=3ca1538221bbf15f input=435dbd48a12efb23]*/ +builtin_pow_impl(PyObject *module, PyObject *base, PyObject *exp, + PyObject *mod) +/*[clinic end generated code: output=3ca1538221bbf15f input=435dbd48a12efb23]*/ { - return PyNumber_Power(base, exp, mod); + return PyNumber_Power(base, exp, mod); } @@ -1819,9 +1819,9 @@ static PyObject * builtin_print(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { static const char * const _keywords[] = {"sep", "end", "file", "flush", 0}; - static struct _PyArg_Parser _parser = {"|OOOp:print", _keywords, 0}; - PyObject *sep = NULL, *end = NULL, *file = NULL; - int flush = 0; + static struct _PyArg_Parser _parser = {"|OOOp:print", _keywords, 0}; + PyObject *sep = NULL, *end = NULL, *file = NULL; + int flush = 0; int i, err; if (kwnames != NULL && @@ -1848,7 +1848,7 @@ builtin_print(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject else if (sep && !PyUnicode_Check(sep)) { PyErr_Format(PyExc_TypeError, "sep must be None or a string, not %.200s", - Py_TYPE(sep)->tp_name); + Py_TYPE(sep)->tp_name); return NULL; } if (end == Py_None) { @@ -1857,7 +1857,7 @@ builtin_print(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject else if (end && !PyUnicode_Check(end)) { PyErr_Format(PyExc_TypeError, "end must be None or a string, not %.200s", - Py_TYPE(end)->tp_name); + Py_TYPE(end)->tp_name); return NULL; } @@ -1883,11 +1883,11 @@ builtin_print(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject if (err) return NULL; - if (flush) { - PyObject *tmp = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); - if (tmp == NULL) + if (flush) { + PyObject *tmp = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); + if (tmp == NULL) return NULL; - Py_DECREF(tmp); + Py_DECREF(tmp); } Py_RETURN_NONE; @@ -1947,12 +1947,12 @@ builtin_input_impl(PyObject *module, PyObject *prompt) return NULL; } - if (PySys_Audit("builtins.input", "O", prompt ? prompt : Py_None) < 0) { - return NULL; - } - + if (PySys_Audit("builtins.input", "O", prompt ? prompt : Py_None) < 0) { + return NULL; + } + /* First of all, flush stderr */ - tmp = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); + tmp = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); if (tmp == NULL) PyErr_Clear(); else @@ -1961,7 +1961,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) /* We should only use (GNU) readline if Python's sys.stdin and sys.stdout are the same as C's stdin and stdout, because we need to pass it those. */ - tmp = _PyObject_CallMethodIdNoArgs(fin, &PyId_fileno); + tmp = _PyObject_CallMethodIdNoArgs(fin, &PyId_fileno); if (tmp == NULL) { PyErr_Clear(); tty = 0; @@ -1974,7 +1974,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) tty = fd == fileno(stdin) && isatty(fd); } if (tty) { - tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_fileno); + tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_fileno); if (tmp == NULL) { PyErr_Clear(); tty = 0; @@ -2012,7 +2012,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) stdin_errors_str = PyUnicode_AsUTF8(stdin_errors); if (!stdin_encoding_str || !stdin_errors_str) goto _readline_errors; - tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); + tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); if (tmp == NULL) PyErr_Clear(); else @@ -2081,13 +2081,13 @@ builtin_input_impl(PyObject *module, PyObject *prompt) Py_DECREF(stdin_errors); Py_XDECREF(po); PyMem_FREE(s); - - if (result != NULL) { - if (PySys_Audit("builtins.input/result", "O", result) < 0) { - return NULL; - } - } - + + if (result != NULL) { + if (PySys_Audit("builtins.input/result", "O", result) < 0) { + return NULL; + } + } + return result; _readline_errors: @@ -2107,7 +2107,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) if (PyFile_WriteObject(prompt, fout, Py_PRINT_RAW) != 0) return NULL; } - tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); + tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); if (tmp == NULL) PyErr_Clear(); else @@ -2139,7 +2139,7 @@ builtin_repr(PyObject *module, PyObject *obj) round as builtin_round number: object - ndigits: object = None + ndigits: object = None Round a number to a given precision in decimal digits. @@ -2149,7 +2149,7 @@ the return value has the same type as the number. ndigits may be negative. static PyObject * builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits) -/*[clinic end generated code: output=ff0d9dd176c02ede input=275678471d7aca15]*/ +/*[clinic end generated code: output=ff0d9dd176c02ede input=275678471d7aca15]*/ { PyObject *round, *result; @@ -2167,10 +2167,10 @@ builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits) return NULL; } - if (ndigits == Py_None) + if (ndigits == Py_None) result = _PyObject_CallNoArg(round); else - result = PyObject_CallOneArg(round, ndigits); + result = PyObject_CallOneArg(round, ndigits); Py_DECREF(round); return result; } @@ -2203,7 +2203,7 @@ PyDoc_STRVAR(builtin_sorted__doc__, "reverse flag can be set to request the result in descending order."); #define BUILTIN_SORTED_METHODDEF \ - {"sorted", (PyCFunction)(void(*)(void))builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__}, + {"sorted", (PyCFunction)(void(*)(void))builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__}, static PyObject * builtin_sorted(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -2226,7 +2226,7 @@ builtin_sorted(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } assert(nargs >= 1); - v = PyObject_Vectorcall(callable, args + 1, nargs - 1, kwnames); + v = PyObject_Vectorcall(callable, args + 1, nargs - 1, kwnames); Py_DECREF(callable); if (v == NULL) { Py_DECREF(newlist); @@ -2248,10 +2248,10 @@ builtin_vars(PyObject *self, PyObject *args) return NULL; if (v == NULL) { d = PyEval_GetLocals(); - Py_XINCREF(d); + Py_XINCREF(d); } else { - if (_PyObject_LookupAttrId(v, &PyId___dict__, &d) == 0) { + if (_PyObject_LookupAttrId(v, &PyId___dict__, &d) == 0) { PyErr_SetString(PyExc_TypeError, "vars() argument must have __dict__ attribute"); } @@ -2270,7 +2270,7 @@ With an argument, equivalent to object.__dict__."); sum as builtin_sum iterable: object - / + / start: object(c_default="NULL") = 0 Return the sum of a 'start' value (default: 0) plus an iterable of numbers @@ -2282,7 +2282,7 @@ reject non-numeric types. static PyObject * builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) -/*[clinic end generated code: output=df758cec7d1d302f input=162b50765250d222]*/ +/*[clinic end generated code: output=df758cec7d1d302f input=162b50765250d222]*/ { PyObject *result = start; PyObject *temp, *item, *iter; @@ -2341,13 +2341,13 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) return NULL; return PyLong_FromLong(i_result); } - if (PyLong_CheckExact(item) || PyBool_Check(item)) { + if (PyLong_CheckExact(item) || PyBool_Check(item)) { long b = PyLong_AsLongAndOverflow(item, &overflow); - if (overflow == 0 && - (i_result >= 0 ? (b <= LONG_MAX - i_result) - : (b >= LONG_MIN - i_result))) - { - i_result += b; + if (overflow == 0 && + (i_result >= 0 ? (b <= LONG_MAX - i_result) + : (b >= LONG_MIN - i_result))) + { + i_result += b; Py_DECREF(item); continue; } @@ -2387,7 +2387,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) Py_DECREF(item); continue; } - if (PyLong_Check(item)) { + if (PyLong_Check(item)) { long value; int overflow; value = PyLong_AsLongAndOverflow(item, &overflow); @@ -2433,11 +2433,11 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) empty = [] sum([[x] for x in range(10)], empty) - would change the value of empty. In fact, using - in-place addition rather that binary addition for - any of the steps introduces subtle behavior changes: - - https://bugs.python.org/issue18305 */ + would change the value of empty. In fact, using + in-place addition rather that binary addition for + any of the steps introduces subtle behavior changes: + + https://bugs.python.org/issue18305 */ temp = PyNumber_Add(result, item); Py_DECREF(result); Py_DECREF(item); @@ -2610,11 +2610,11 @@ zip_next(zipobject *lz) PyTuple_SET_ITEM(result, i, item); Py_DECREF(olditem); } - // bpo-42536: The GC may have untracked this result tuple. Since we're - // recycling it, make sure it's tracked again: - if (!_PyObject_GC_IS_TRACKED(result)) { - _PyObject_GC_TRACK(result); - } + // bpo-42536: The GC may have untracked this result tuple. Since we're + // recycling it, make sure it's tracked again: + if (!_PyObject_GC_IS_TRACKED(result)) { + _PyObject_GC_TRACK(result); + } } else { result = PyTuple_New(tuplesize); if (result == NULL) @@ -2633,7 +2633,7 @@ zip_next(zipobject *lz) } static PyObject * -zip_reduce(zipobject *lz, PyObject *Py_UNUSED(ignored)) +zip_reduce(zipobject *lz, PyObject *Py_UNUSED(ignored)) { /* Just recreate the zip with the internal iterator tuple */ return Py_BuildValue("OO", Py_TYPE(lz), lz->ittuple); @@ -2645,15 +2645,15 @@ static PyMethodDef zip_methods[] = { }; PyDoc_STRVAR(zip_doc, -"zip(*iterables) --> A zip object yielding tuples until an input is exhausted.\n\ +"zip(*iterables) --> A zip object yielding tuples until an input is exhausted.\n\ +\n\ + >>> list(zip('abcdefg', range(3), range(4)))\n\ + [('a', 0, 0), ('b', 1, 1), ('c', 2, 2)]\n\ \n\ - >>> list(zip('abcdefg', range(3), range(4)))\n\ - [('a', 0, 0), ('b', 1, 1), ('c', 2, 2)]\n\ -\n\ -The zip object yields n-length tuples, where n is the number of iterables\n\ -passed as positional arguments to zip(). The i-th element in every tuple\n\ -comes from the i-th iterable argument to zip(). This continues until the\n\ -shortest argument is exhausted."); +The zip object yields n-length tuples, where n is the number of iterables\n\ +passed as positional arguments to zip(). The i-th element in every tuple\n\ +comes from the i-th iterable argument to zip(). This continues until the\n\ +shortest argument is exhausted."); PyTypeObject PyZip_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) @@ -2662,10 +2662,10 @@ PyTypeObject PyZip_Type = { 0, /* tp_itemsize */ /* methods */ (destructor)zip_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ + 0, /* tp_vectorcall_offset */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_as_async */ + 0, /* tp_as_async */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2701,15 +2701,15 @@ PyTypeObject PyZip_Type = { static PyMethodDef builtin_methods[] = { - {"__build_class__", (PyCFunction)(void(*)(void))builtin___build_class__, + {"__build_class__", (PyCFunction)(void(*)(void))builtin___build_class__, METH_FASTCALL | METH_KEYWORDS, build_class_doc}, - {"__import__", (PyCFunction)(void(*)(void))builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc}, + {"__import__", (PyCFunction)(void(*)(void))builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc}, BUILTIN_ABS_METHODDEF BUILTIN_ALL_METHODDEF BUILTIN_ANY_METHODDEF BUILTIN_ASCII_METHODDEF BUILTIN_BIN_METHODDEF - {"breakpoint", (PyCFunction)(void(*)(void))builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc}, + {"breakpoint", (PyCFunction)(void(*)(void))builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc}, BUILTIN_CALLABLE_METHODDEF BUILTIN_CHR_METHODDEF BUILTIN_COMPILE_METHODDEF @@ -2719,7 +2719,7 @@ static PyMethodDef builtin_methods[] = { BUILTIN_EVAL_METHODDEF BUILTIN_EXEC_METHODDEF BUILTIN_FORMAT_METHODDEF - {"getattr", (PyCFunction)(void(*)(void))builtin_getattr, METH_FASTCALL, getattr_doc}, + {"getattr", (PyCFunction)(void(*)(void))builtin_getattr, METH_FASTCALL, getattr_doc}, BUILTIN_GLOBALS_METHODDEF BUILTIN_HASATTR_METHODDEF BUILTIN_HASH_METHODDEF @@ -2728,16 +2728,16 @@ static PyMethodDef builtin_methods[] = { BUILTIN_INPUT_METHODDEF BUILTIN_ISINSTANCE_METHODDEF BUILTIN_ISSUBCLASS_METHODDEF - {"iter", (PyCFunction)(void(*)(void))builtin_iter, METH_FASTCALL, iter_doc}, + {"iter", (PyCFunction)(void(*)(void))builtin_iter, METH_FASTCALL, iter_doc}, BUILTIN_LEN_METHODDEF BUILTIN_LOCALS_METHODDEF - {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, - {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, - {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc}, + {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, + {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, + {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc}, BUILTIN_OCT_METHODDEF BUILTIN_ORD_METHODDEF BUILTIN_POW_METHODDEF - {"print", (PyCFunction)(void(*)(void))builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc}, + {"print", (PyCFunction)(void(*)(void))builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc}, BUILTIN_REPR_METHODDEF BUILTIN_ROUND_METHODDEF BUILTIN_SETATTR_METHODDEF @@ -2766,12 +2766,12 @@ static struct PyModuleDef builtinsmodule = { PyObject * -_PyBuiltin_Init(PyThreadState *tstate) +_PyBuiltin_Init(PyThreadState *tstate) { PyObject *mod, *dict, *debug; - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + if (PyType_Ready(&PyFilter_Type) < 0 || PyType_Ready(&PyMap_Type) < 0 || PyType_Ready(&PyZip_Type) < 0) @@ -2830,7 +2830,7 @@ _PyBuiltin_Init(PyThreadState *tstate) SETBUILTIN("tuple", &PyTuple_Type); SETBUILTIN("type", &PyType_Type); SETBUILTIN("zip", &PyZip_Type); - debug = PyBool_FromLong(config->optimization_level == 0); + debug = PyBool_FromLong(config->optimization_level == 0); if (PyDict_SetItemString(dict, "__debug__", debug) < 0) { Py_DECREF(debug); return NULL; diff --git a/contrib/tools/python3/src/Python/bootstrap_hash.c b/contrib/tools/python3/src/Python/bootstrap_hash.c index a1a9e07799..e189ce0d90 100644 --- a/contrib/tools/python3/src/Python/bootstrap_hash.c +++ b/contrib/tools/python3/src/Python/bootstrap_hash.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "pycore_initconfig.h" +#include "pycore_initconfig.h" #ifdef MS_WINDOWS # include <windows.h> /* All sample MSDN wincrypt programs include the header below. It is at least @@ -25,16 +25,16 @@ # include <sanitizer/msan_interface.h> #endif -#if defined(__APPLE__) && defined(__has_builtin) -# if __has_builtin(__builtin_available) -# define HAVE_GETENTRYPY_GETRANDOM_RUNTIME __builtin_available(macOS 10.12, iOS 10.10, tvOS 10.0, watchOS 3.0, *) -# endif -#endif -#ifndef HAVE_GETENTRYPY_GETRANDOM_RUNTIME -# define HAVE_GETENTRYPY_GETRANDOM_RUNTIME 1 -#endif - - +#if defined(__APPLE__) && defined(__has_builtin) +# if __has_builtin(__builtin_available) +# define HAVE_GETENTRYPY_GETRANDOM_RUNTIME __builtin_available(macOS 10.12, iOS 10.10, tvOS 10.0, watchOS 3.0, *) +# endif +#endif +#ifndef HAVE_GETENTRYPY_GETRANDOM_RUNTIME +# define HAVE_GETENTRYPY_GETRANDOM_RUNTIME 1 +#endif + + #ifdef Py_DEBUG int _Py_HashSecret_Initialized = 0; #else @@ -48,8 +48,8 @@ static int win32_urandom_init(int raise) { /* Acquire context */ - if (!CryptAcquireContextW(&hCryptProv, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) + if (!CryptAcquireContextW(&hCryptProv, NULL, NULL, + PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) goto error; return 0; @@ -75,8 +75,8 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) while (size > 0) { - DWORD chunk = (DWORD)Py_MIN(size, PY_DWORD_MAX); - if (!CryptGenRandom(hCryptProv, chunk, buffer)) + DWORD chunk = (DWORD)Py_MIN(size, PY_DWORD_MAX); + if (!CryptGenRandom(hCryptProv, chunk, buffer)) { /* CryptGenRandom() failed */ if (raise) { @@ -173,7 +173,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) } /* getrandom(GRND_NONBLOCK) fails with EAGAIN if the system urandom - is not initialized yet. For _PyRandom_Init(), we ignore the + is not initialized yet. For _PyRandom_Init(), we ignore the error and fall back on reading /dev/urandom which never blocks, even if the system urandom is not initialized yet: see the PEP 524. */ @@ -218,17 +218,17 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) error. getentropy() is retried if it failed with EINTR: interrupted by a signal. */ - -#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability) + +#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability) +static int +py_getentropy(char *buffer, Py_ssize_t size, int raise) + __attribute__((availability(macos,introduced=10.12))) + __attribute__((availability(ios,introduced=10.0))) + __attribute__((availability(tvos,introduced=10.0))) + __attribute__((availability(watchos,introduced=3.0))); +#endif + static int -py_getentropy(char *buffer, Py_ssize_t size, int raise) - __attribute__((availability(macos,introduced=10.12))) - __attribute__((availability(ios,introduced=10.0))) - __attribute__((availability(tvos,introduced=10.0))) - __attribute__((availability(watchos,introduced=3.0))); -#endif - -static int py_getentropy(char *buffer, Py_ssize_t size, int raise) { /* Is getentropy() supported by the running kernel? Set to 0 if @@ -518,21 +518,21 @@ pyurandom(void *buffer, Py_ssize_t size, int blocking, int raise) #else #if defined(PY_GETRANDOM) || defined(PY_GETENTROPY) - if (HAVE_GETENTRYPY_GETRANDOM_RUNTIME) { + if (HAVE_GETENTRYPY_GETRANDOM_RUNTIME) { #ifdef PY_GETRANDOM - res = py_getrandom(buffer, size, blocking, raise); + res = py_getrandom(buffer, size, blocking, raise); #else - res = py_getentropy(buffer, size, raise); + res = py_getentropy(buffer, size, raise); #endif - if (res < 0) { - return -1; - } - if (res == 1) { - return 0; - } - /* getrandom() or getentropy() function is not available: failed with - ENOSYS or EPERM. Fall back on reading from /dev/urandom. */ - } /* end of availability block */ + if (res < 0) { + return -1; + } + if (res == 1) { + return 0; + } + /* getrandom() or getentropy() function is not available: failed with + ENOSYS or EPERM. Fall back on reading from /dev/urandom. */ + } /* end of availability block */ #endif return dev_urandom(buffer, size, raise); @@ -569,14 +569,14 @@ _PyOS_URandomNonblock(void *buffer, Py_ssize_t size) } -PyStatus -_Py_HashRandomization_Init(const PyConfig *config) +PyStatus +_Py_HashRandomization_Init(const PyConfig *config) { void *secret = &_Py_HashSecret; Py_ssize_t secret_size = sizeof(_Py_HashSecret_t); if (_Py_HashSecret_Initialized) { - return _PyStatus_OK(); + return _PyStatus_OK(); } _Py_HashSecret_Initialized = 1; @@ -601,11 +601,11 @@ _Py_HashRandomization_Init(const PyConfig *config) pyurandom() is non-blocking mode (blocking=0): see the PEP 524. */ res = pyurandom(secret, secret_size, 0, 0); if (res < 0) { - return _PyStatus_ERR("failed to get random numbers " - "to initialize Python"); + return _PyStatus_ERR("failed to get random numbers " + "to initialize Python"); } } - return _PyStatus_OK(); + return _PyStatus_OK(); } diff --git a/contrib/tools/python3/src/Python/ceval.c b/contrib/tools/python3/src/Python/ceval.c index e07adf6e19..9a61f8a3c3 100644 --- a/contrib/tools/python3/src/Python/ceval.c +++ b/contrib/tools/python3/src/Python/ceval.c @@ -10,18 +10,18 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_call.h" -#include "pycore_ceval.h" -#include "pycore_code.h" -#include "pycore_initconfig.h" -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" -#include "pycore_pymem.h" // _PyMem_IsPtrFreed() -#include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_sysmodule.h" -#include "pycore_tupleobject.h" +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_call.h" +#include "pycore_ceval.h" +#include "pycore_code.h" +#include "pycore_initconfig.h" +#include "pycore_object.h" +#include "pycore_pyerrors.h" +#include "pycore_pylifecycle.h" +#include "pycore_pymem.h" // _PyMem_IsPtrFreed() +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_sysmodule.h" +#include "pycore_tupleobject.h" #include "code.h" #include "dictobject.h" @@ -38,23 +38,23 @@ #define CHECKEXC 1 /* Double-check exception checking */ #endif -#if !defined(Py_BUILD_CORE) -# error "ceval.c must be build with Py_BUILD_CORE define for best performance" -#endif - -_Py_IDENTIFIER(__name__); +#if !defined(Py_BUILD_CORE) +# error "ceval.c must be build with Py_BUILD_CORE define for best performance" +#endif + +_Py_IDENTIFIER(__name__); /* Forward declarations */ -Py_LOCAL_INLINE(PyObject *) call_function( - PyThreadState *tstate, PyObject ***pp_stack, - Py_ssize_t oparg, PyObject *kwnames); -static PyObject * do_call_core( - PyThreadState *tstate, PyObject *func, - PyObject *callargs, PyObject *kwdict); +Py_LOCAL_INLINE(PyObject *) call_function( + PyThreadState *tstate, PyObject ***pp_stack, + Py_ssize_t oparg, PyObject *kwnames); +static PyObject * do_call_core( + PyThreadState *tstate, PyObject *func, + PyObject *callargs, PyObject *kwdict); #ifdef LLTRACE static int lltrace; -static int prtrace(PyThreadState *, PyObject *, const char *); +static int prtrace(PyThreadState *, PyObject *, const char *); #endif static int call_trace(Py_tracefunc, PyObject *, PyThreadState *, PyFrameObject *, @@ -71,18 +71,18 @@ static void maybe_dtrace_line(PyFrameObject *, int *, int *, int *); static void dtrace_function_entry(PyFrameObject *); static void dtrace_function_return(PyFrameObject *); -static PyObject * import_name(PyThreadState *, PyFrameObject *, - PyObject *, PyObject *, PyObject *); -static PyObject * import_from(PyThreadState *, PyObject *, PyObject *); -static int import_all_from(PyThreadState *, PyObject *, PyObject *); -static void format_exc_check_arg(PyThreadState *, PyObject *, const char *, PyObject *); -static void format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg); -static PyObject * unicode_concatenate(PyThreadState *, PyObject *, PyObject *, +static PyObject * import_name(PyThreadState *, PyFrameObject *, + PyObject *, PyObject *, PyObject *); +static PyObject * import_from(PyThreadState *, PyObject *, PyObject *); +static int import_all_from(PyThreadState *, PyObject *, PyObject *); +static void format_exc_check_arg(PyThreadState *, PyObject *, const char *, PyObject *); +static void format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg); +static PyObject * unicode_concatenate(PyThreadState *, PyObject *, PyObject *, PyFrameObject *, const _Py_CODEUNIT *); -static PyObject * special_lookup(PyThreadState *, PyObject *, _Py_Identifier *); -static int check_args_iterable(PyThreadState *, PyObject *func, PyObject *vararg); -static void format_kwargs_error(PyThreadState *, PyObject *func, PyObject *kwargs); -static void format_awaitable_error(PyThreadState *, PyTypeObject *, int, int); +static PyObject * special_lookup(PyThreadState *, PyObject *, _Py_Identifier *); +static int check_args_iterable(PyThreadState *, PyObject *func, PyObject *vararg); +static void format_kwargs_error(PyThreadState *, PyObject *func, PyObject *kwargs); +static void format_awaitable_error(PyThreadState *, PyTypeObject *, int, int); #define NAME_ERROR_MSG \ "name '%.200s' is not defined" @@ -102,372 +102,372 @@ static long dxp[256]; #endif #endif -/* per opcode cache */ -#ifdef Py_DEBUG -// --with-pydebug is used to find memory leak. opcache makes it harder. -// So we disable opcache when Py_DEBUG is defined. -// See bpo-37146 -#define OPCACHE_MIN_RUNS 0 /* disable opcache */ -#else -#define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */ -#endif -#define OPCACHE_STATS 0 /* Enable stats */ - -#if OPCACHE_STATS -static size_t opcache_code_objects = 0; -static size_t opcache_code_objects_extra_mem = 0; - -static size_t opcache_global_opts = 0; -static size_t opcache_global_hits = 0; -static size_t opcache_global_misses = 0; -#endif - - -#ifndef NDEBUG -/* Ensure that tstate is valid: sanity check for PyEval_AcquireThread() and - PyEval_RestoreThread(). Detect if tstate memory was freed. It can happen - when a thread continues to run after Python finalization, especially - daemon threads. */ -static int -is_tstate_valid(PyThreadState *tstate) -{ - assert(!_PyMem_IsPtrFreed(tstate)); - assert(!_PyMem_IsPtrFreed(tstate->interp)); - return 1; -} -#endif - - +/* per opcode cache */ +#ifdef Py_DEBUG +// --with-pydebug is used to find memory leak. opcache makes it harder. +// So we disable opcache when Py_DEBUG is defined. +// See bpo-37146 +#define OPCACHE_MIN_RUNS 0 /* disable opcache */ +#else +#define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */ +#endif +#define OPCACHE_STATS 0 /* Enable stats */ + +#if OPCACHE_STATS +static size_t opcache_code_objects = 0; +static size_t opcache_code_objects_extra_mem = 0; + +static size_t opcache_global_opts = 0; +static size_t opcache_global_hits = 0; +static size_t opcache_global_misses = 0; +#endif + + +#ifndef NDEBUG +/* Ensure that tstate is valid: sanity check for PyEval_AcquireThread() and + PyEval_RestoreThread(). Detect if tstate memory was freed. It can happen + when a thread continues to run after Python finalization, especially + daemon threads. */ +static int +is_tstate_valid(PyThreadState *tstate) +{ + assert(!_PyMem_IsPtrFreed(tstate)); + assert(!_PyMem_IsPtrFreed(tstate->interp)); + return 1; +} +#endif + + /* This can set eval_breaker to 0 even though gil_drop_request became 1. We believe this is all right because the eval loop will release the GIL eventually anyway. */ -static inline void -COMPUTE_EVAL_BREAKER(PyInterpreterState *interp, - struct _ceval_runtime_state *ceval, - struct _ceval_state *ceval2) -{ - _Py_atomic_store_relaxed(&ceval2->eval_breaker, - _Py_atomic_load_relaxed(&ceval2->gil_drop_request) - | (_Py_atomic_load_relaxed(&ceval->signals_pending) - && _Py_ThreadCanHandleSignals(interp)) - | (_Py_atomic_load_relaxed(&ceval2->pending.calls_to_do) - && _Py_ThreadCanHandlePendingCalls()) - | ceval2->pending.async_exc); -} - - -static inline void -SET_GIL_DROP_REQUEST(PyInterpreterState *interp) -{ - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval2->gil_drop_request, 1); - _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); -} - - -static inline void -RESET_GIL_DROP_REQUEST(PyInterpreterState *interp) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval2->gil_drop_request, 0); - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); -} - - -static inline void -SIGNAL_PENDING_CALLS(PyInterpreterState *interp) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 1); - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); -} - - -static inline void -UNSIGNAL_PENDING_CALLS(PyInterpreterState *interp) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 0); - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); -} - - -static inline void -SIGNAL_PENDING_SIGNALS(PyInterpreterState *interp, int force) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval->signals_pending, 1); - if (force) { - _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); - } - else { - /* eval_breaker is not set to 1 if thread_can_handle_signals() is false */ - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); - } -} - - -static inline void -UNSIGNAL_PENDING_SIGNALS(PyInterpreterState *interp) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - _Py_atomic_store_relaxed(&ceval->signals_pending, 0); - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); -} - - -static inline void -SIGNAL_ASYNC_EXC(PyInterpreterState *interp) -{ - struct _ceval_state *ceval2 = &interp->ceval; - ceval2->pending.async_exc = 1; - _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); -} - - -static inline void -UNSIGNAL_ASYNC_EXC(PyInterpreterState *interp) -{ - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - ceval2->pending.async_exc = 0; - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); -} - - +static inline void +COMPUTE_EVAL_BREAKER(PyInterpreterState *interp, + struct _ceval_runtime_state *ceval, + struct _ceval_state *ceval2) +{ + _Py_atomic_store_relaxed(&ceval2->eval_breaker, + _Py_atomic_load_relaxed(&ceval2->gil_drop_request) + | (_Py_atomic_load_relaxed(&ceval->signals_pending) + && _Py_ThreadCanHandleSignals(interp)) + | (_Py_atomic_load_relaxed(&ceval2->pending.calls_to_do) + && _Py_ThreadCanHandlePendingCalls()) + | ceval2->pending.async_exc); +} + + +static inline void +SET_GIL_DROP_REQUEST(PyInterpreterState *interp) +{ + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval2->gil_drop_request, 1); + _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); +} + + +static inline void +RESET_GIL_DROP_REQUEST(PyInterpreterState *interp) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval2->gil_drop_request, 0); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); +} + + +static inline void +SIGNAL_PENDING_CALLS(PyInterpreterState *interp) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 1); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); +} + + +static inline void +UNSIGNAL_PENDING_CALLS(PyInterpreterState *interp) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 0); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); +} + + +static inline void +SIGNAL_PENDING_SIGNALS(PyInterpreterState *interp, int force) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval->signals_pending, 1); + if (force) { + _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); + } + else { + /* eval_breaker is not set to 1 if thread_can_handle_signals() is false */ + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); + } +} + + +static inline void +UNSIGNAL_PENDING_SIGNALS(PyInterpreterState *interp) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + _Py_atomic_store_relaxed(&ceval->signals_pending, 0); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); +} + + +static inline void +SIGNAL_ASYNC_EXC(PyInterpreterState *interp) +{ + struct _ceval_state *ceval2 = &interp->ceval; + ceval2->pending.async_exc = 1; + _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); +} + + +static inline void +UNSIGNAL_ASYNC_EXC(PyInterpreterState *interp) +{ + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + ceval2->pending.async_exc = 0; + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); +} + + #ifdef HAVE_ERRNO_H #include <errno.h> #endif #include "ceval_gil.h" -void _Py_NO_RETURN -_Py_FatalError_TstateNULL(const char *func) -{ - _Py_FatalErrorFunc(func, - "the function must be called with the GIL held, " - "but the GIL is released " - "(the current Python thread state is NULL)"); -} - - +void _Py_NO_RETURN +_Py_FatalError_TstateNULL(const char *func) +{ + _Py_FatalErrorFunc(func, + "the function must be called with the GIL held, " + "but the GIL is released " + "(the current Python thread state is NULL)"); +} + + +int +_PyEval_ThreadsInitialized(_PyRuntimeState *runtime) +{ + return gil_created(&runtime->ceval.gil); +} + int -_PyEval_ThreadsInitialized(_PyRuntimeState *runtime) -{ - return gil_created(&runtime->ceval.gil); -} - -int PyEval_ThreadsInitialized(void) { - _PyRuntimeState *runtime = &_PyRuntime; - return _PyEval_ThreadsInitialized(runtime); + _PyRuntimeState *runtime = &_PyRuntime; + return _PyEval_ThreadsInitialized(runtime); } -PyStatus -_PyEval_InitGIL(PyThreadState *tstate) +PyStatus +_PyEval_InitGIL(PyThreadState *tstate) { - if (!_Py_IsMainInterpreter(tstate)) { - /* Currently, the GIL is shared by all interpreters, - and only the main interpreter is responsible to create - and destroy it. */ - return _PyStatus_OK(); - } - - struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; - assert(!gil_created(gil)); - - PyThread_init_thread(); - create_gil(gil); - - take_gil(tstate); - - assert(gil_created(gil)); - return _PyStatus_OK(); + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, the GIL is shared by all interpreters, + and only the main interpreter is responsible to create + and destroy it. */ + return _PyStatus_OK(); + } + + struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; + assert(!gil_created(gil)); + + PyThread_init_thread(); + create_gil(gil); + + take_gil(tstate); + + assert(gil_created(gil)); + return _PyStatus_OK(); } void -_PyEval_FiniGIL(PyThreadState *tstate) +_PyEval_FiniGIL(PyThreadState *tstate) { - if (!_Py_IsMainInterpreter(tstate)) { - /* Currently, the GIL is shared by all interpreters, - and only the main interpreter is responsible to create - and destroy it. */ - return; - } - - struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; - if (!gil_created(gil)) { - /* First Py_InitializeFromConfig() call: the GIL doesn't exist - yet: do nothing. */ + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, the GIL is shared by all interpreters, + and only the main interpreter is responsible to create + and destroy it. */ return; - } - - destroy_gil(gil); - assert(!gil_created(gil)); + } + + struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; + if (!gil_created(gil)) { + /* First Py_InitializeFromConfig() call: the GIL doesn't exist + yet: do nothing. */ + return; + } + + destroy_gil(gil); + assert(!gil_created(gil)); +} + +void +PyEval_InitThreads(void) +{ + /* Do nothing: kept for backward compatibility */ +} + +void +_PyEval_Fini(void) +{ +#if OPCACHE_STATS + fprintf(stderr, "-- Opcode cache number of objects = %zd\n", + opcache_code_objects); + + fprintf(stderr, "-- Opcode cache total extra mem = %zd\n", + opcache_code_objects_extra_mem); + + fprintf(stderr, "\n"); + + fprintf(stderr, "-- Opcode cache LOAD_GLOBAL hits = %zd (%d%%)\n", + opcache_global_hits, + (int) (100.0 * opcache_global_hits / + (opcache_global_hits + opcache_global_misses))); + + fprintf(stderr, "-- Opcode cache LOAD_GLOBAL misses = %zd (%d%%)\n", + opcache_global_misses, + (int) (100.0 * opcache_global_misses / + (opcache_global_hits + opcache_global_misses))); + + fprintf(stderr, "-- Opcode cache LOAD_GLOBAL opts = %zd\n", + opcache_global_opts); + + fprintf(stderr, "\n"); +#endif } -void -PyEval_InitThreads(void) -{ - /* Do nothing: kept for backward compatibility */ -} - void -_PyEval_Fini(void) -{ -#if OPCACHE_STATS - fprintf(stderr, "-- Opcode cache number of objects = %zd\n", - opcache_code_objects); - - fprintf(stderr, "-- Opcode cache total extra mem = %zd\n", - opcache_code_objects_extra_mem); - - fprintf(stderr, "\n"); - - fprintf(stderr, "-- Opcode cache LOAD_GLOBAL hits = %zd (%d%%)\n", - opcache_global_hits, - (int) (100.0 * opcache_global_hits / - (opcache_global_hits + opcache_global_misses))); - - fprintf(stderr, "-- Opcode cache LOAD_GLOBAL misses = %zd (%d%%)\n", - opcache_global_misses, - (int) (100.0 * opcache_global_misses / - (opcache_global_hits + opcache_global_misses))); - - fprintf(stderr, "-- Opcode cache LOAD_GLOBAL opts = %zd\n", - opcache_global_opts); - - fprintf(stderr, "\n"); -#endif -} - -void PyEval_AcquireLock(void) { - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - _Py_EnsureTstateNotNULL(tstate); - - take_gil(tstate); + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + _Py_EnsureTstateNotNULL(tstate); + + take_gil(tstate); } void PyEval_ReleaseLock(void) { - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); /* This function must succeed when the current thread state is NULL. - We therefore avoid PyThreadState_Get() which dumps a fatal error - in debug mode. */ - struct _ceval_runtime_state *ceval = &runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; - drop_gil(ceval, ceval2, tstate); + We therefore avoid PyThreadState_Get() which dumps a fatal error + in debug mode. */ + struct _ceval_runtime_state *ceval = &runtime->ceval; + struct _ceval_state *ceval2 = &tstate->interp->ceval; + drop_gil(ceval, ceval2, tstate); +} + +void +_PyEval_ReleaseLock(PyThreadState *tstate) +{ + struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; + struct _ceval_state *ceval2 = &tstate->interp->ceval; + drop_gil(ceval, ceval2, tstate); } void -_PyEval_ReleaseLock(PyThreadState *tstate) -{ - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; - drop_gil(ceval, ceval2, tstate); -} - -void PyEval_AcquireThread(PyThreadState *tstate) { - _Py_EnsureTstateNotNULL(tstate); - - take_gil(tstate); - - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - if (_PyThreadState_Swap(gilstate, tstate) != NULL) { - Py_FatalError("non-NULL old thread state"); - } + _Py_EnsureTstateNotNULL(tstate); + + take_gil(tstate); + + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + if (_PyThreadState_Swap(gilstate, tstate) != NULL) { + Py_FatalError("non-NULL old thread state"); + } } void PyEval_ReleaseThread(PyThreadState *tstate) { - assert(is_tstate_valid(tstate)); - - _PyRuntimeState *runtime = tstate->interp->runtime; - PyThreadState *new_tstate = _PyThreadState_Swap(&runtime->gilstate, NULL); - if (new_tstate != tstate) { - Py_FatalError("wrong thread state"); - } - struct _ceval_runtime_state *ceval = &runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; - drop_gil(ceval, ceval2, tstate); + assert(is_tstate_valid(tstate)); + + _PyRuntimeState *runtime = tstate->interp->runtime; + PyThreadState *new_tstate = _PyThreadState_Swap(&runtime->gilstate, NULL); + if (new_tstate != tstate) { + Py_FatalError("wrong thread state"); + } + struct _ceval_runtime_state *ceval = &runtime->ceval; + struct _ceval_state *ceval2 = &tstate->interp->ceval; + drop_gil(ceval, ceval2, tstate); } -#ifdef HAVE_FORK +#ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child to destroy all threads * which are not running in the child process, and clear internal locks * which might be held by those threads. */ void -_PyEval_ReInitThreads(_PyRuntimeState *runtime) +_PyEval_ReInitThreads(_PyRuntimeState *runtime) { - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - _Py_EnsureTstateNotNULL(tstate); - - struct _gil_runtime_state *gil = &runtime->ceval.gil; - if (!gil_created(gil)) { + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + _Py_EnsureTstateNotNULL(tstate); + + struct _gil_runtime_state *gil = &runtime->ceval.gil; + if (!gil_created(gil)) { return; - } - recreate_gil(gil); - - take_gil(tstate); - - struct _pending_calls *pending = &tstate->interp->ceval.pending; - if (_PyThread_at_fork_reinit(&pending->lock) < 0) { - Py_FatalError("Can't initialize threads for pending calls"); - } - + } + recreate_gil(gil); + + take_gil(tstate); + + struct _pending_calls *pending = &tstate->interp->ceval.pending; + if (_PyThread_at_fork_reinit(&pending->lock) < 0) { + Py_FatalError("Can't initialize threads for pending calls"); + } + /* Destroy all threads except the current one */ - _PyThreadState_DeleteExcept(runtime, tstate); + _PyThreadState_DeleteExcept(runtime, tstate); } -#endif +#endif /* This function is used to signal that async exceptions are waiting to be - raised. */ + raised. */ void -_PyEval_SignalAsyncExc(PyThreadState *tstate) +_PyEval_SignalAsyncExc(PyThreadState *tstate) { - assert(is_tstate_valid(tstate)); - SIGNAL_ASYNC_EXC(tstate->interp); + assert(is_tstate_valid(tstate)); + SIGNAL_ASYNC_EXC(tstate->interp); } PyThreadState * PyEval_SaveThread(void) { - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate = _PyThreadState_Swap(&runtime->gilstate, NULL); - _Py_EnsureTstateNotNULL(tstate); - - struct _ceval_runtime_state *ceval = &runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; - assert(gil_created(&ceval->gil)); - drop_gil(ceval, ceval2, tstate); + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate = _PyThreadState_Swap(&runtime->gilstate, NULL); + _Py_EnsureTstateNotNULL(tstate); + + struct _ceval_runtime_state *ceval = &runtime->ceval; + struct _ceval_state *ceval2 = &tstate->interp->ceval; + assert(gil_created(&ceval->gil)); + drop_gil(ceval, ceval2, tstate); return tstate; } void PyEval_RestoreThread(PyThreadState *tstate) { - _Py_EnsureTstateNotNULL(tstate); - - take_gil(tstate); + _Py_EnsureTstateNotNULL(tstate); + + take_gil(tstate); - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - _PyThreadState_Swap(gilstate, tstate); + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + _PyThreadState_Swap(gilstate, tstate); } @@ -494,225 +494,225 @@ PyEval_RestoreThread(PyThreadState *tstate) */ void -_PyEval_SignalReceived(PyInterpreterState *interp) +_PyEval_SignalReceived(PyInterpreterState *interp) { -#ifdef MS_WINDOWS - // bpo-42296: On Windows, _PyEval_SignalReceived() is called from a signal - // handler which can run in a thread different than the Python thread, in - // which case _Py_ThreadCanHandleSignals() is wrong. Ignore - // _Py_ThreadCanHandleSignals() and always set eval_breaker to 1. - // - // The next eval_frame_handle_pending() call will call - // _Py_ThreadCanHandleSignals() to recompute eval_breaker. - int force = 1; -#else - int force = 0; -#endif +#ifdef MS_WINDOWS + // bpo-42296: On Windows, _PyEval_SignalReceived() is called from a signal + // handler which can run in a thread different than the Python thread, in + // which case _Py_ThreadCanHandleSignals() is wrong. Ignore + // _Py_ThreadCanHandleSignals() and always set eval_breaker to 1. + // + // The next eval_frame_handle_pending() call will call + // _Py_ThreadCanHandleSignals() to recompute eval_breaker. + int force = 1; +#else + int force = 0; +#endif /* bpo-30703: Function called when the C signal handler of Python gets a - signal. We cannot queue a callback using _PyEval_AddPendingCall() since + signal. We cannot queue a callback using _PyEval_AddPendingCall() since that function is not async-signal-safe. */ - SIGNAL_PENDING_SIGNALS(interp, force); + SIGNAL_PENDING_SIGNALS(interp, force); +} + +/* Push one item onto the queue while holding the lock. */ +static int +_push_pending_call(struct _pending_calls *pending, + int (*func)(void *), void *arg) +{ + int i = pending->last; + int j = (i + 1) % NPENDINGCALLS; + if (j == pending->first) { + return -1; /* Queue full */ + } + pending->calls[i].func = func; + pending->calls[i].arg = arg; + pending->last = j; + return 0; +} + +/* Pop one item off the queue while holding the lock. */ +static void +_pop_pending_call(struct _pending_calls *pending, + int (**func)(void *), void **arg) +{ + int i = pending->first; + if (i == pending->last) { + return; /* Queue empty */ + } + + *func = pending->calls[i].func; + *arg = pending->calls[i].arg; + pending->first = (i + 1) % NPENDINGCALLS; } -/* Push one item onto the queue while holding the lock. */ -static int -_push_pending_call(struct _pending_calls *pending, - int (*func)(void *), void *arg) -{ - int i = pending->last; - int j = (i + 1) % NPENDINGCALLS; - if (j == pending->first) { - return -1; /* Queue full */ - } - pending->calls[i].func = func; - pending->calls[i].arg = arg; - pending->last = j; - return 0; -} - -/* Pop one item off the queue while holding the lock. */ -static void -_pop_pending_call(struct _pending_calls *pending, - int (**func)(void *), void **arg) -{ - int i = pending->first; - if (i == pending->last) { - return; /* Queue empty */ - } - - *func = pending->calls[i].func; - *arg = pending->calls[i].arg; - pending->first = (i + 1) % NPENDINGCALLS; -} - /* This implementation is thread-safe. It allows scheduling to be made from any thread, and even from an executing callback. */ int -_PyEval_AddPendingCall(PyInterpreterState *interp, - int (*func)(void *), void *arg) +_PyEval_AddPendingCall(PyInterpreterState *interp, + int (*func)(void *), void *arg) { - struct _pending_calls *pending = &interp->ceval.pending; + struct _pending_calls *pending = &interp->ceval.pending; - /* Ensure that _PyEval_InitPendingCalls() was called - and that _PyEval_FiniPendingCalls() is not called yet. */ - assert(pending->lock != NULL); - - PyThread_acquire_lock(pending->lock, WAIT_LOCK); - int result = _push_pending_call(pending, func, arg); - PyThread_release_lock(pending->lock); + /* Ensure that _PyEval_InitPendingCalls() was called + and that _PyEval_FiniPendingCalls() is not called yet. */ + assert(pending->lock != NULL); + + PyThread_acquire_lock(pending->lock, WAIT_LOCK); + int result = _push_pending_call(pending, func, arg); + PyThread_release_lock(pending->lock); /* signal main loop */ - SIGNAL_PENDING_CALLS(interp); + SIGNAL_PENDING_CALLS(interp); return result; } int -Py_AddPendingCall(int (*func)(void *), void *arg) +Py_AddPendingCall(int (*func)(void *), void *arg) +{ + /* Best-effort to support subinterpreters and calls with the GIL released. + + First attempt _PyThreadState_GET() since it supports subinterpreters. + + If the GIL is released, _PyThreadState_GET() returns NULL . In this + case, use PyGILState_GetThisThreadState() which works even if the GIL + is released. + + Sadly, PyGILState_GetThisThreadState() doesn't support subinterpreters: + see bpo-10915 and bpo-15751. + + Py_AddPendingCall() doesn't require the caller to hold the GIL. */ + PyThreadState *tstate = _PyThreadState_GET(); + if (tstate == NULL) { + tstate = PyGILState_GetThisThreadState(); + } + + PyInterpreterState *interp; + if (tstate != NULL) { + interp = tstate->interp; + } + else { + /* Last resort: use the main interpreter */ + interp = _PyRuntime.interpreters.main; + } + return _PyEval_AddPendingCall(interp, func, arg); +} + +static int +handle_signals(PyThreadState *tstate) { - /* Best-effort to support subinterpreters and calls with the GIL released. - - First attempt _PyThreadState_GET() since it supports subinterpreters. - - If the GIL is released, _PyThreadState_GET() returns NULL . In this - case, use PyGILState_GetThisThreadState() which works even if the GIL - is released. - - Sadly, PyGILState_GetThisThreadState() doesn't support subinterpreters: - see bpo-10915 and bpo-15751. - - Py_AddPendingCall() doesn't require the caller to hold the GIL. */ - PyThreadState *tstate = _PyThreadState_GET(); - if (tstate == NULL) { - tstate = PyGILState_GetThisThreadState(); - } - - PyInterpreterState *interp; - if (tstate != NULL) { - interp = tstate->interp; - } - else { - /* Last resort: use the main interpreter */ - interp = _PyRuntime.interpreters.main; - } - return _PyEval_AddPendingCall(interp, func, arg); -} - -static int -handle_signals(PyThreadState *tstate) -{ - assert(is_tstate_valid(tstate)); - if (!_Py_ThreadCanHandleSignals(tstate->interp)) { - return 0; - } - - UNSIGNAL_PENDING_SIGNALS(tstate->interp); - if (_PyErr_CheckSignalsTstate(tstate) < 0) { - /* On failure, re-schedule a call to handle_signals(). */ - SIGNAL_PENDING_SIGNALS(tstate->interp, 0); - return -1; - } - return 0; -} - -static int -make_pending_calls(PyThreadState *tstate) -{ - assert(is_tstate_valid(tstate)); - - /* only execute pending calls on main thread */ - if (!_Py_ThreadCanHandlePendingCalls()) { + assert(is_tstate_valid(tstate)); + if (!_Py_ThreadCanHandleSignals(tstate->interp)) { return 0; } - + + UNSIGNAL_PENDING_SIGNALS(tstate->interp); + if (_PyErr_CheckSignalsTstate(tstate) < 0) { + /* On failure, re-schedule a call to handle_signals(). */ + SIGNAL_PENDING_SIGNALS(tstate->interp, 0); + return -1; + } + return 0; +} + +static int +make_pending_calls(PyThreadState *tstate) +{ + assert(is_tstate_valid(tstate)); + + /* only execute pending calls on main thread */ + if (!_Py_ThreadCanHandlePendingCalls()) { + return 0; + } + /* don't perform recursive pending calls */ - static int busy = 0; - if (busy) { + static int busy = 0; + if (busy) { return 0; - } + } busy = 1; - + /* unsignal before starting to call callbacks, so that any callback added in-between re-signals */ - UNSIGNAL_PENDING_CALLS(tstate->interp); - int res = 0; + UNSIGNAL_PENDING_CALLS(tstate->interp); + int res = 0; /* perform a bounded number of calls, in case of recursion */ - struct _pending_calls *pending = &tstate->interp->ceval.pending; - for (int i=0; i<NPENDINGCALLS; i++) { - int (*func)(void *) = NULL; + struct _pending_calls *pending = &tstate->interp->ceval.pending; + for (int i=0; i<NPENDINGCALLS; i++) { + int (*func)(void *) = NULL; void *arg = NULL; /* pop one item off the queue while holding the lock */ - PyThread_acquire_lock(pending->lock, WAIT_LOCK); - _pop_pending_call(pending, &func, &arg); - PyThread_release_lock(pending->lock); - + PyThread_acquire_lock(pending->lock, WAIT_LOCK); + _pop_pending_call(pending, &func, &arg); + PyThread_release_lock(pending->lock); + /* having released the lock, perform the callback */ - if (func == NULL) { + if (func == NULL) { break; - } - res = func(arg); - if (res) { + } + res = func(arg); + if (res) { goto error; } } busy = 0; - return res; + return res; error: busy = 0; - SIGNAL_PENDING_CALLS(tstate->interp); - return res; + SIGNAL_PENDING_CALLS(tstate->interp); + return res; +} + +void +_Py_FinishPendingCalls(PyThreadState *tstate) +{ + assert(PyGILState_Check()); + + struct _pending_calls *pending = &tstate->interp->ceval.pending; + + if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) { + return; + } + + if (make_pending_calls(tstate) < 0) { + PyObject *exc, *val, *tb; + _PyErr_Fetch(tstate, &exc, &val, &tb); + PyErr_BadInternalCall(); + _PyErr_ChainExceptions(exc, val, tb); + _PyErr_Print(tstate); + } +} + +/* Py_MakePendingCalls() is a simple wrapper for the sake + of backward-compatibility. */ +int +Py_MakePendingCalls(void) +{ + assert(PyGILState_Check()); + + PyThreadState *tstate = _PyThreadState_GET(); + + /* Python signal handler doesn't really queue a callback: it only signals + that a signal was received, see _PyEval_SignalReceived(). */ + int res = handle_signals(tstate); + if (res != 0) { + return res; + } + + res = make_pending_calls(tstate); + if (res != 0) { + return res; + } + + return 0; } -void -_Py_FinishPendingCalls(PyThreadState *tstate) -{ - assert(PyGILState_Check()); - - struct _pending_calls *pending = &tstate->interp->ceval.pending; - - if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) { - return; - } - - if (make_pending_calls(tstate) < 0) { - PyObject *exc, *val, *tb; - _PyErr_Fetch(tstate, &exc, &val, &tb); - PyErr_BadInternalCall(); - _PyErr_ChainExceptions(exc, val, tb); - _PyErr_Print(tstate); - } -} - -/* Py_MakePendingCalls() is a simple wrapper for the sake - of backward-compatibility. */ -int -Py_MakePendingCalls(void) -{ - assert(PyGILState_Check()); - - PyThreadState *tstate = _PyThreadState_GET(); - - /* Python signal handler doesn't really queue a callback: it only signals - that a signal was received, see _PyEval_SignalReceived(). */ - int res = handle_signals(tstate); - if (res != 0) { - return res; - } - - res = make_pending_calls(tstate); - if (res != 0) { - return res; - } - - return 0; -} - /* The interpreter's recursion limit */ #ifndef Py_DEFAULT_RECURSION_LIMIT @@ -722,104 +722,104 @@ Py_MakePendingCalls(void) int _Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT; void -_PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval) +_PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval) { _Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT; - _gil_initialize(&ceval->gil); + _gil_initialize(&ceval->gil); +} + +int +_PyEval_InitState(struct _ceval_state *ceval) +{ + ceval->recursion_limit = Py_DEFAULT_RECURSION_LIMIT; + + struct _pending_calls *pending = &ceval->pending; + assert(pending->lock == NULL); + + pending->lock = PyThread_allocate_lock(); + if (pending->lock == NULL) { + return -1; + } + + return 0; +} + +void +_PyEval_FiniState(struct _ceval_state *ceval) +{ + struct _pending_calls *pending = &ceval->pending; + if (pending->lock != NULL) { + PyThread_free_lock(pending->lock); + pending->lock = NULL; + } } int -_PyEval_InitState(struct _ceval_state *ceval) -{ - ceval->recursion_limit = Py_DEFAULT_RECURSION_LIMIT; - - struct _pending_calls *pending = &ceval->pending; - assert(pending->lock == NULL); - - pending->lock = PyThread_allocate_lock(); - if (pending->lock == NULL) { - return -1; - } - - return 0; -} - -void -_PyEval_FiniState(struct _ceval_state *ceval) -{ - struct _pending_calls *pending = &ceval->pending; - if (pending->lock != NULL) { - PyThread_free_lock(pending->lock); - pending->lock = NULL; - } -} - -int Py_GetRecursionLimit(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return tstate->interp->ceval.recursion_limit; + PyThreadState *tstate = _PyThreadState_GET(); + return tstate->interp->ceval.recursion_limit; } void Py_SetRecursionLimit(int new_limit) { - PyThreadState *tstate = _PyThreadState_GET(); - tstate->interp->ceval.recursion_limit = new_limit; - if (_Py_IsMainInterpreter(tstate)) { - _Py_CheckRecursionLimit = new_limit; - } + PyThreadState *tstate = _PyThreadState_GET(); + tstate->interp->ceval.recursion_limit = new_limit; + if (_Py_IsMainInterpreter(tstate)) { + _Py_CheckRecursionLimit = new_limit; + } } -/* The function _Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall() +/* The function _Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall() if the recursion_depth reaches _Py_CheckRecursionLimit. If USE_STACKCHECK, the macro decrements _Py_CheckRecursionLimit to guarantee that _Py_CheckRecursiveCall() is regularly called. Without USE_STACKCHECK, there is no need for this. */ int -_Py_CheckRecursiveCall(PyThreadState *tstate, const char *where) +_Py_CheckRecursiveCall(PyThreadState *tstate, const char *where) { - int recursion_limit = tstate->interp->ceval.recursion_limit; + int recursion_limit = tstate->interp->ceval.recursion_limit; #ifdef USE_STACKCHECK tstate->stackcheck_counter = 0; if (PyOS_CheckStack()) { --tstate->recursion_depth; - _PyErr_SetString(tstate, PyExc_MemoryError, "Stack overflow"); + _PyErr_SetString(tstate, PyExc_MemoryError, "Stack overflow"); return -1; } - if (_Py_IsMainInterpreter(tstate)) { - /* Needed for ABI backwards-compatibility (see bpo-31857) */ - _Py_CheckRecursionLimit = recursion_limit; - } + if (_Py_IsMainInterpreter(tstate)) { + /* Needed for ABI backwards-compatibility (see bpo-31857) */ + _Py_CheckRecursionLimit = recursion_limit; + } #endif - if (tstate->recursion_critical) - /* Somebody asked that we don't check for recursion. */ - return 0; - if (tstate->overflowed) { - if (tstate->recursion_depth > recursion_limit + 50 || tstate->overflowed > 50) { + if (tstate->recursion_critical) + /* Somebody asked that we don't check for recursion. */ + return 0; + if (tstate->overflowed) { + if (tstate->recursion_depth > recursion_limit + 50 || tstate->overflowed > 50) { /* Overflowing while handling an overflow. Give up. */ Py_FatalError("Cannot recover from stack overflow."); } } - else { - if (tstate->recursion_depth > recursion_limit) { - tstate->overflowed++; - _PyErr_Format(tstate, PyExc_RecursionError, - "maximum recursion depth exceeded%s", - where); - tstate->overflowed--; - --tstate->recursion_depth; - return -1; - } + else { + if (tstate->recursion_depth > recursion_limit) { + tstate->overflowed++; + _PyErr_Format(tstate, PyExc_RecursionError, + "maximum recursion depth exceeded%s", + where); + tstate->overflowed--; + --tstate->recursion_depth; + return -1; + } } return 0; } -static int do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause); -static int unpack_iterable(PyThreadState *, PyObject *, int, int, PyObject **); +static int do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause); +static int unpack_iterable(PyThreadState *, PyObject *, int, int, PyObject **); -#define _Py_TracingPossible(ceval) ((ceval)->tracing_possible) +#define _Py_TracingPossible(ceval) ((ceval)->tracing_possible) PyObject * @@ -837,90 +837,90 @@ PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals) /* Interpreter main loop */ PyObject * -PyEval_EvalFrame(PyFrameObject *f) -{ - /* Function kept for backward compatibility */ - PyThreadState *tstate = _PyThreadState_GET(); - return _PyEval_EvalFrame(tstate, f, 0); +PyEval_EvalFrame(PyFrameObject *f) +{ + /* Function kept for backward compatibility */ + PyThreadState *tstate = _PyThreadState_GET(); + return _PyEval_EvalFrame(tstate, f, 0); } PyObject * PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) { - PyThreadState *tstate = _PyThreadState_GET(); - return _PyEval_EvalFrame(tstate, f, throwflag); + PyThreadState *tstate = _PyThreadState_GET(); + return _PyEval_EvalFrame(tstate, f, throwflag); +} + + +/* Handle signals, pending calls, GIL drop request + and asynchronous exception */ +static int +eval_frame_handle_pending(PyThreadState *tstate) +{ + _PyRuntimeState * const runtime = &_PyRuntime; + struct _ceval_runtime_state *ceval = &runtime->ceval; + + /* Pending signals */ + if (_Py_atomic_load_relaxed(&ceval->signals_pending)) { + if (handle_signals(tstate) != 0) { + return -1; + } + } + + /* Pending calls */ + struct _ceval_state *ceval2 = &tstate->interp->ceval; + if (_Py_atomic_load_relaxed(&ceval2->pending.calls_to_do)) { + if (make_pending_calls(tstate) != 0) { + return -1; + } + } + + /* GIL drop request */ + if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request)) { + /* Give another thread a chance */ + if (_PyThreadState_Swap(&runtime->gilstate, NULL) != tstate) { + Py_FatalError("tstate mix-up"); + } + drop_gil(ceval, ceval2, tstate); + + /* Other threads may run now */ + + take_gil(tstate); + + if (_PyThreadState_Swap(&runtime->gilstate, tstate) != NULL) { + Py_FatalError("orphan tstate"); + } + } + + /* Check for asynchronous exception. */ + if (tstate->async_exc != NULL) { + PyObject *exc = tstate->async_exc; + tstate->async_exc = NULL; + UNSIGNAL_ASYNC_EXC(tstate->interp); + _PyErr_SetNone(tstate, exc); + Py_DECREF(exc); + return -1; + } + +#ifdef MS_WINDOWS + // bpo-42296: On Windows, _PyEval_SignalReceived() can be called in a + // different thread than the Python thread, in which case + // _Py_ThreadCanHandleSignals() is wrong. Recompute eval_breaker in the + // current Python thread with the correct _Py_ThreadCanHandleSignals() + // value. It prevents to interrupt the eval loop at every instruction if + // the current Python thread cannot handle signals (if + // _Py_ThreadCanHandleSignals() is false). + COMPUTE_EVAL_BREAKER(tstate->interp, ceval, ceval2); +#endif + + return 0; } - -/* Handle signals, pending calls, GIL drop request - and asynchronous exception */ -static int -eval_frame_handle_pending(PyThreadState *tstate) -{ - _PyRuntimeState * const runtime = &_PyRuntime; - struct _ceval_runtime_state *ceval = &runtime->ceval; - - /* Pending signals */ - if (_Py_atomic_load_relaxed(&ceval->signals_pending)) { - if (handle_signals(tstate) != 0) { - return -1; - } - } - - /* Pending calls */ - struct _ceval_state *ceval2 = &tstate->interp->ceval; - if (_Py_atomic_load_relaxed(&ceval2->pending.calls_to_do)) { - if (make_pending_calls(tstate) != 0) { - return -1; - } - } - - /* GIL drop request */ - if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request)) { - /* Give another thread a chance */ - if (_PyThreadState_Swap(&runtime->gilstate, NULL) != tstate) { - Py_FatalError("tstate mix-up"); - } - drop_gil(ceval, ceval2, tstate); - - /* Other threads may run now */ - - take_gil(tstate); - - if (_PyThreadState_Swap(&runtime->gilstate, tstate) != NULL) { - Py_FatalError("orphan tstate"); - } - } - - /* Check for asynchronous exception. */ - if (tstate->async_exc != NULL) { - PyObject *exc = tstate->async_exc; - tstate->async_exc = NULL; - UNSIGNAL_ASYNC_EXC(tstate->interp); - _PyErr_SetNone(tstate, exc); - Py_DECREF(exc); - return -1; - } - -#ifdef MS_WINDOWS - // bpo-42296: On Windows, _PyEval_SignalReceived() can be called in a - // different thread than the Python thread, in which case - // _Py_ThreadCanHandleSignals() is wrong. Recompute eval_breaker in the - // current Python thread with the correct _Py_ThreadCanHandleSignals() - // value. It prevents to interrupt the eval loop at every instruction if - // the current Python thread cannot handle signals (if - // _Py_ThreadCanHandleSignals() is false). - COMPUTE_EVAL_BREAKER(tstate->interp, ceval, ceval2); -#endif - - return 0; -} - PyObject* _Py_HOT_FUNCTION -_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) +_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) { - _Py_EnsureTstateNotNULL(tstate); - + _Py_EnsureTstateNotNULL(tstate); + #ifdef DXPAIRS int lastopcode = 0; #endif @@ -930,8 +930,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) int oparg; /* Current opcode argument, if any */ PyObject **fastlocals, **freevars; PyObject *retval = NULL; /* Return value */ - struct _ceval_state * const ceval2 = &tstate->interp->ceval; - _Py_atomic_int * const eval_breaker = &ceval2->eval_breaker; + struct _ceval_state * const ceval2 = &tstate->interp->ceval; + _Py_atomic_int * const eval_breaker = &ceval2->eval_breaker; PyCodeObject *co; /* when tracing we set things up so that @@ -946,7 +946,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) const _Py_CODEUNIT *first_instr; PyObject *names; PyObject *consts; - _PyOpcache *co_opcache; + _PyOpcache *co_opcache; #ifdef LLTRACE _Py_IDENTIFIER(__ltrace__); @@ -1013,13 +1013,13 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) #include "opcode_targets.h" #define TARGET(op) \ - op: \ - TARGET_##op + op: \ + TARGET_##op #ifdef LLTRACE #define FAST_DISPATCH() \ { \ - if (!lltrace && !_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ + if (!lltrace && !_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ f->f_lasti = INSTR_OFFSET(); \ NEXTOPARG(); \ goto *opcode_targets[opcode]; \ @@ -1029,7 +1029,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) #else #define FAST_DISPATCH() \ { \ - if (!_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ + if (!_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ f->f_lasti = INSTR_OFFSET(); \ NEXTOPARG(); \ goto *opcode_targets[opcode]; \ @@ -1038,17 +1038,17 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } #endif -#define DISPATCH() \ - { \ - if (!_Py_atomic_load_relaxed(eval_breaker)) { \ - FAST_DISPATCH(); \ - } \ - continue; \ - } - +#define DISPATCH() \ + { \ + if (!_Py_atomic_load_relaxed(eval_breaker)) { \ + FAST_DISPATCH(); \ + } \ + continue; \ + } + #else -#define TARGET(op) op -#define FAST_DISPATCH() goto fast_next_opcode +#define TARGET(op) op +#define FAST_DISPATCH() goto fast_next_opcode #define DISPATCH() continue #endif @@ -1101,23 +1101,23 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) */ -#define PREDICT_ID(op) PRED_##op - +#define PREDICT_ID(op) PRED_##op + #if defined(DYNAMIC_EXECUTION_PROFILE) || USE_COMPUTED_GOTOS -#define PREDICT(op) if (0) goto PREDICT_ID(op) +#define PREDICT(op) if (0) goto PREDICT_ID(op) #else #define PREDICT(op) \ - do { \ + do { \ _Py_CODEUNIT word = *next_instr; \ opcode = _Py_OPCODE(word); \ - if (opcode == op) { \ + if (opcode == op) { \ oparg = _Py_OPARG(word); \ next_instr++; \ - goto PREDICT_ID(op); \ + goto PREDICT_ID(op); \ } \ } while(0) #endif -#define PREDICTED(op) PREDICT_ID(op): +#define PREDICTED(op) PREDICT_ID(op): /* Stack manipulation macros */ @@ -1142,30 +1142,30 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) #ifdef LLTRACE #define PUSH(v) { (void)(BASIC_PUSH(v), \ - lltrace && prtrace(tstate, TOP(), "push")); \ + lltrace && prtrace(tstate, TOP(), "push")); \ assert(STACK_LEVEL() <= co->co_stacksize); } -#define POP() ((void)(lltrace && prtrace(tstate, TOP(), "pop")), \ +#define POP() ((void)(lltrace && prtrace(tstate, TOP(), "pop")), \ BASIC_POP()) -#define STACK_GROW(n) do { \ - assert(n >= 0); \ - (void)(BASIC_STACKADJ(n), \ - lltrace && prtrace(tstate, TOP(), "stackadj")); \ - assert(STACK_LEVEL() <= co->co_stacksize); \ - } while (0) -#define STACK_SHRINK(n) do { \ - assert(n >= 0); \ - (void)(lltrace && prtrace(tstate, TOP(), "stackadj")); \ - (void)(BASIC_STACKADJ(-n)); \ - assert(STACK_LEVEL() <= co->co_stacksize); \ - } while (0) +#define STACK_GROW(n) do { \ + assert(n >= 0); \ + (void)(BASIC_STACKADJ(n), \ + lltrace && prtrace(tstate, TOP(), "stackadj")); \ + assert(STACK_LEVEL() <= co->co_stacksize); \ + } while (0) +#define STACK_SHRINK(n) do { \ + assert(n >= 0); \ + (void)(lltrace && prtrace(tstate, TOP(), "stackadj")); \ + (void)(BASIC_STACKADJ(-n)); \ + assert(STACK_LEVEL() <= co->co_stacksize); \ + } while (0) #define EXT_POP(STACK_POINTER) ((void)(lltrace && \ - prtrace(tstate, (STACK_POINTER)[-1], "ext_pop")), \ + prtrace(tstate, (STACK_POINTER)[-1], "ext_pop")), \ *--(STACK_POINTER)) #else #define PUSH(v) BASIC_PUSH(v) #define POP() BASIC_POP() -#define STACK_GROW(n) BASIC_STACKADJ(n) -#define STACK_SHRINK(n) BASIC_STACKADJ(-n) +#define STACK_GROW(n) BASIC_STACKADJ(n) +#define STACK_SHRINK(n) BASIC_STACKADJ(-n) #define EXT_POP(STACK_POINTER) (*--(STACK_POINTER)) #endif @@ -1211,52 +1211,52 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) Py_XDECREF(traceback); \ } while(0) - /* macros for opcode cache */ -#define OPCACHE_CHECK() \ - do { \ - co_opcache = NULL; \ - if (co->co_opcache != NULL) { \ - unsigned char co_opt_offset = \ - co->co_opcache_map[next_instr - first_instr]; \ - if (co_opt_offset > 0) { \ - assert(co_opt_offset <= co->co_opcache_size); \ - co_opcache = &co->co_opcache[co_opt_offset - 1]; \ - assert(co_opcache != NULL); \ - } \ - } \ - } while (0) - -#if OPCACHE_STATS - -#define OPCACHE_STAT_GLOBAL_HIT() \ - do { \ - if (co->co_opcache != NULL) opcache_global_hits++; \ - } while (0) - -#define OPCACHE_STAT_GLOBAL_MISS() \ - do { \ - if (co->co_opcache != NULL) opcache_global_misses++; \ - } while (0) - -#define OPCACHE_STAT_GLOBAL_OPT() \ - do { \ - if (co->co_opcache != NULL) opcache_global_opts++; \ - } while (0) - -#else /* OPCACHE_STATS */ - -#define OPCACHE_STAT_GLOBAL_HIT() -#define OPCACHE_STAT_GLOBAL_MISS() -#define OPCACHE_STAT_GLOBAL_OPT() - -#endif - + /* macros for opcode cache */ +#define OPCACHE_CHECK() \ + do { \ + co_opcache = NULL; \ + if (co->co_opcache != NULL) { \ + unsigned char co_opt_offset = \ + co->co_opcache_map[next_instr - first_instr]; \ + if (co_opt_offset > 0) { \ + assert(co_opt_offset <= co->co_opcache_size); \ + co_opcache = &co->co_opcache[co_opt_offset - 1]; \ + assert(co_opcache != NULL); \ + } \ + } \ + } while (0) + +#if OPCACHE_STATS + +#define OPCACHE_STAT_GLOBAL_HIT() \ + do { \ + if (co->co_opcache != NULL) opcache_global_hits++; \ + } while (0) + +#define OPCACHE_STAT_GLOBAL_MISS() \ + do { \ + if (co->co_opcache != NULL) opcache_global_misses++; \ + } while (0) + +#define OPCACHE_STAT_GLOBAL_OPT() \ + do { \ + if (co->co_opcache != NULL) opcache_global_opts++; \ + } while (0) + +#else /* OPCACHE_STATS */ + +#define OPCACHE_STAT_GLOBAL_HIT() +#define OPCACHE_STAT_GLOBAL_MISS() +#define OPCACHE_STAT_GLOBAL_OPT() + +#endif + /* Start of code */ /* push frame */ - if (_Py_EnterRecursiveCall(tstate, "")) { + if (_Py_EnterRecursiveCall(tstate, "")) { return NULL; - } + } tstate->frame = f; @@ -1333,20 +1333,20 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ f->f_executing = 1; - if (co->co_opcache_flag < OPCACHE_MIN_RUNS) { - co->co_opcache_flag++; - if (co->co_opcache_flag == OPCACHE_MIN_RUNS) { - if (_PyCode_InitOpcache(co) < 0) { - goto exit_eval_frame; - } -#if OPCACHE_STATS - opcache_code_objects_extra_mem += - PyBytes_Size(co->co_code) / sizeof(_Py_CODEUNIT) + - sizeof(_PyOpcache) * co->co_opcache_size; - opcache_code_objects++; -#endif - } - } + if (co->co_opcache_flag < OPCACHE_MIN_RUNS) { + co->co_opcache_flag++; + if (co->co_opcache_flag == OPCACHE_MIN_RUNS) { + if (_PyCode_InitOpcache(co) < 0) { + goto exit_eval_frame; + } +#if OPCACHE_STATS + opcache_code_objects_extra_mem += + PyBytes_Size(co->co_code) / sizeof(_Py_CODEUNIT) + + sizeof(_PyOpcache) * co->co_opcache_size; + opcache_code_objects++; +#endif + } + } #ifdef LLTRACE lltrace = _PyDict_GetItemId(f->f_globals, &PyId___ltrace__) != NULL; @@ -1356,27 +1356,27 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) goto error; #ifdef Py_DEBUG - /* _PyEval_EvalFrameDefault() must not be called with an exception set, + /* _PyEval_EvalFrameDefault() must not be called with an exception set, because it can clear it (directly or indirectly) and so the caller loses its exception */ - assert(!_PyErr_Occurred(tstate)); + assert(!_PyErr_Occurred(tstate)); #endif -main_loop: +main_loop: for (;;) { assert(stack_pointer >= f->f_valuestack); /* else underflow */ assert(STACK_LEVEL() <= co->co_stacksize); /* else overflow */ - assert(!_PyErr_Occurred(tstate)); + assert(!_PyErr_Occurred(tstate)); /* Do periodic things. Doing this every time through the loop would add too much overhead, so we do it only every Nth instruction. We also do it if - ``pending.calls_to_do'' is set, i.e. when an asynchronous + ``pending.calls_to_do'' is set, i.e. when an asynchronous event needs attention (e.g. a signal handler or async I/O handler); see Py_AddPendingCall() and Py_MakePendingCalls() above. */ - if (_Py_atomic_load_relaxed(eval_breaker)) { + if (_Py_atomic_load_relaxed(eval_breaker)) { opcode = _Py_OPCODE(*next_instr); if (opcode == SETUP_FINALLY || opcode == SETUP_WITH || @@ -1400,8 +1400,8 @@ main_loop: */ goto fast_next_opcode; } - - if (eval_frame_handle_pending(tstate) != 0) { + + if (eval_frame_handle_pending(tstate) != 0) { goto error; } } @@ -1414,7 +1414,7 @@ main_loop: /* line-by-line tracing support */ - if (_Py_TracingPossible(ceval2) && + if (_Py_TracingPossible(ceval2) && tstate->c_tracefunc != NULL && !tstate->tracing) { int err; /* see maybe_call_line_trace @@ -1466,17 +1466,17 @@ main_loop: switch (opcode) { /* BEWARE! - It is essential that any operation that fails must goto error - and that all operation that succeed call [FAST_]DISPATCH() ! */ + It is essential that any operation that fails must goto error + and that all operation that succeed call [FAST_]DISPATCH() ! */ - case TARGET(NOP): { + case TARGET(NOP): { FAST_DISPATCH(); - } + } - case TARGET(LOAD_FAST): { + case TARGET(LOAD_FAST): { PyObject *value = GETLOCAL(oparg); if (value == NULL) { - format_exc_check_arg(tstate, PyExc_UnboundLocalError, + format_exc_check_arg(tstate, PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, PyTuple_GetItem(co->co_varnames, oparg)); goto error; @@ -1486,28 +1486,28 @@ main_loop: FAST_DISPATCH(); } - case TARGET(LOAD_CONST): { - PREDICTED(LOAD_CONST); + case TARGET(LOAD_CONST): { + PREDICTED(LOAD_CONST); PyObject *value = GETITEM(consts, oparg); Py_INCREF(value); PUSH(value); FAST_DISPATCH(); } - case TARGET(STORE_FAST): { - PREDICTED(STORE_FAST); + case TARGET(STORE_FAST): { + PREDICTED(STORE_FAST); PyObject *value = POP(); SETLOCAL(oparg, value); FAST_DISPATCH(); } - case TARGET(POP_TOP): { + case TARGET(POP_TOP): { PyObject *value = POP(); Py_DECREF(value); FAST_DISPATCH(); } - case TARGET(ROT_TWO): { + case TARGET(ROT_TWO): { PyObject *top = TOP(); PyObject *second = SECOND(); SET_TOP(second); @@ -1515,7 +1515,7 @@ main_loop: FAST_DISPATCH(); } - case TARGET(ROT_THREE): { + case TARGET(ROT_THREE): { PyObject *top = TOP(); PyObject *second = SECOND(); PyObject *third = THIRD(); @@ -1525,37 +1525,37 @@ main_loop: FAST_DISPATCH(); } - case TARGET(ROT_FOUR): { + case TARGET(ROT_FOUR): { + PyObject *top = TOP(); + PyObject *second = SECOND(); + PyObject *third = THIRD(); + PyObject *fourth = FOURTH(); + SET_TOP(second); + SET_SECOND(third); + SET_THIRD(fourth); + SET_FOURTH(top); + FAST_DISPATCH(); + } + + case TARGET(DUP_TOP): { PyObject *top = TOP(); - PyObject *second = SECOND(); - PyObject *third = THIRD(); - PyObject *fourth = FOURTH(); - SET_TOP(second); - SET_SECOND(third); - SET_THIRD(fourth); - SET_FOURTH(top); - FAST_DISPATCH(); - } - - case TARGET(DUP_TOP): { - PyObject *top = TOP(); Py_INCREF(top); PUSH(top); FAST_DISPATCH(); } - case TARGET(DUP_TOP_TWO): { + case TARGET(DUP_TOP_TWO): { PyObject *top = TOP(); PyObject *second = SECOND(); Py_INCREF(top); Py_INCREF(second); - STACK_GROW(2); + STACK_GROW(2); SET_TOP(top); SET_SECOND(second); FAST_DISPATCH(); } - case TARGET(UNARY_POSITIVE): { + case TARGET(UNARY_POSITIVE): { PyObject *value = TOP(); PyObject *res = PyNumber_Positive(value); Py_DECREF(value); @@ -1565,7 +1565,7 @@ main_loop: DISPATCH(); } - case TARGET(UNARY_NEGATIVE): { + case TARGET(UNARY_NEGATIVE): { PyObject *value = TOP(); PyObject *res = PyNumber_Negative(value); Py_DECREF(value); @@ -1575,7 +1575,7 @@ main_loop: DISPATCH(); } - case TARGET(UNARY_NOT): { + case TARGET(UNARY_NOT): { PyObject *value = TOP(); int err = PyObject_IsTrue(value); Py_DECREF(value); @@ -1589,11 +1589,11 @@ main_loop: SET_TOP(Py_False); DISPATCH(); } - STACK_SHRINK(1); + STACK_SHRINK(1); goto error; } - case TARGET(UNARY_INVERT): { + case TARGET(UNARY_INVERT): { PyObject *value = TOP(); PyObject *res = PyNumber_Invert(value); Py_DECREF(value); @@ -1603,7 +1603,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_POWER): { + case TARGET(BINARY_POWER): { PyObject *exp = POP(); PyObject *base = TOP(); PyObject *res = PyNumber_Power(base, exp, Py_None); @@ -1615,7 +1615,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_MULTIPLY): { + case TARGET(BINARY_MULTIPLY): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_Multiply(left, right); @@ -1627,7 +1627,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_MATRIX_MULTIPLY): { + case TARGET(BINARY_MATRIX_MULTIPLY): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_MatrixMultiply(left, right); @@ -1639,7 +1639,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_TRUE_DIVIDE): { + case TARGET(BINARY_TRUE_DIVIDE): { PyObject *divisor = POP(); PyObject *dividend = TOP(); PyObject *quotient = PyNumber_TrueDivide(dividend, divisor); @@ -1651,7 +1651,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_FLOOR_DIVIDE): { + case TARGET(BINARY_FLOOR_DIVIDE): { PyObject *divisor = POP(); PyObject *dividend = TOP(); PyObject *quotient = PyNumber_FloorDivide(dividend, divisor); @@ -1663,7 +1663,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_MODULO): { + case TARGET(BINARY_MODULO): { PyObject *divisor = POP(); PyObject *dividend = TOP(); PyObject *res; @@ -1683,7 +1683,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_ADD): { + case TARGET(BINARY_ADD): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *sum; @@ -1695,7 +1695,7 @@ main_loop: speedup on microbenchmarks. */ if (PyUnicode_CheckExact(left) && PyUnicode_CheckExact(right)) { - sum = unicode_concatenate(tstate, left, right, f, next_instr); + sum = unicode_concatenate(tstate, left, right, f, next_instr); /* unicode_concatenate consumed the ref to left */ } else { @@ -1709,7 +1709,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_SUBTRACT): { + case TARGET(BINARY_SUBTRACT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *diff = PyNumber_Subtract(left, right); @@ -1721,7 +1721,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_SUBSCR): { + case TARGET(BINARY_SUBSCR): { PyObject *sub = POP(); PyObject *container = TOP(); PyObject *res = PyObject_GetItem(container, sub); @@ -1733,7 +1733,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_LSHIFT): { + case TARGET(BINARY_LSHIFT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_Lshift(left, right); @@ -1745,7 +1745,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_RSHIFT): { + case TARGET(BINARY_RSHIFT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_Rshift(left, right); @@ -1757,7 +1757,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_AND): { + case TARGET(BINARY_AND): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_And(left, right); @@ -1769,7 +1769,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_XOR): { + case TARGET(BINARY_XOR): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_Xor(left, right); @@ -1781,7 +1781,7 @@ main_loop: DISPATCH(); } - case TARGET(BINARY_OR): { + case TARGET(BINARY_OR): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_Or(left, right); @@ -1793,7 +1793,7 @@ main_loop: DISPATCH(); } - case TARGET(LIST_APPEND): { + case TARGET(LIST_APPEND): { PyObject *v = POP(); PyObject *list = PEEK(oparg); int err; @@ -1805,7 +1805,7 @@ main_loop: DISPATCH(); } - case TARGET(SET_ADD): { + case TARGET(SET_ADD): { PyObject *v = POP(); PyObject *set = PEEK(oparg); int err; @@ -1817,7 +1817,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_POWER): { + case TARGET(INPLACE_POWER): { PyObject *exp = POP(); PyObject *base = TOP(); PyObject *res = PyNumber_InPlacePower(base, exp, Py_None); @@ -1829,7 +1829,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_MULTIPLY): { + case TARGET(INPLACE_MULTIPLY): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceMultiply(left, right); @@ -1841,7 +1841,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_MATRIX_MULTIPLY): { + case TARGET(INPLACE_MATRIX_MULTIPLY): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceMatrixMultiply(left, right); @@ -1853,7 +1853,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_TRUE_DIVIDE): { + case TARGET(INPLACE_TRUE_DIVIDE): { PyObject *divisor = POP(); PyObject *dividend = TOP(); PyObject *quotient = PyNumber_InPlaceTrueDivide(dividend, divisor); @@ -1865,7 +1865,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_FLOOR_DIVIDE): { + case TARGET(INPLACE_FLOOR_DIVIDE): { PyObject *divisor = POP(); PyObject *dividend = TOP(); PyObject *quotient = PyNumber_InPlaceFloorDivide(dividend, divisor); @@ -1877,7 +1877,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_MODULO): { + case TARGET(INPLACE_MODULO): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *mod = PyNumber_InPlaceRemainder(left, right); @@ -1889,12 +1889,12 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_ADD): { + case TARGET(INPLACE_ADD): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *sum; if (PyUnicode_CheckExact(left) && PyUnicode_CheckExact(right)) { - sum = unicode_concatenate(tstate, left, right, f, next_instr); + sum = unicode_concatenate(tstate, left, right, f, next_instr); /* unicode_concatenate consumed the ref to left */ } else { @@ -1908,7 +1908,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_SUBTRACT): { + case TARGET(INPLACE_SUBTRACT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *diff = PyNumber_InPlaceSubtract(left, right); @@ -1920,7 +1920,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_LSHIFT): { + case TARGET(INPLACE_LSHIFT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceLshift(left, right); @@ -1932,7 +1932,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_RSHIFT): { + case TARGET(INPLACE_RSHIFT): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceRshift(left, right); @@ -1944,7 +1944,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_AND): { + case TARGET(INPLACE_AND): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceAnd(left, right); @@ -1956,7 +1956,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_XOR): { + case TARGET(INPLACE_XOR): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceXor(left, right); @@ -1968,7 +1968,7 @@ main_loop: DISPATCH(); } - case TARGET(INPLACE_OR): { + case TARGET(INPLACE_OR): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *res = PyNumber_InPlaceOr(left, right); @@ -1980,12 +1980,12 @@ main_loop: DISPATCH(); } - case TARGET(STORE_SUBSCR): { + case TARGET(STORE_SUBSCR): { PyObject *sub = TOP(); PyObject *container = SECOND(); PyObject *v = THIRD(); int err; - STACK_SHRINK(3); + STACK_SHRINK(3); /* container[sub] = v */ err = PyObject_SetItem(container, sub, v); Py_DECREF(v); @@ -1996,11 +1996,11 @@ main_loop: DISPATCH(); } - case TARGET(DELETE_SUBSCR): { + case TARGET(DELETE_SUBSCR): { PyObject *sub = TOP(); PyObject *container = SECOND(); int err; - STACK_SHRINK(2); + STACK_SHRINK(2); /* del container[sub] */ err = PyObject_DelItem(container, sub); Py_DECREF(container); @@ -2010,18 +2010,18 @@ main_loop: DISPATCH(); } - case TARGET(PRINT_EXPR): { + case TARGET(PRINT_EXPR): { _Py_IDENTIFIER(displayhook); PyObject *value = POP(); PyObject *hook = _PySys_GetObjectId(&PyId_displayhook); PyObject *res; if (hook == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "lost sys.displayhook"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "lost sys.displayhook"); Py_DECREF(value); goto error; } - res = PyObject_CallOneArg(hook, value); + res = PyObject_CallOneArg(hook, value); Py_DECREF(value); if (res == NULL) goto error; @@ -2029,7 +2029,7 @@ main_loop: DISPATCH(); } - case TARGET(RAISE_VARARGS): { + case TARGET(RAISE_VARARGS): { PyObject *cause = NULL, *exc = NULL; switch (oparg) { case 2: @@ -2039,26 +2039,26 @@ main_loop: exc = POP(); /* exc */ /* fall through */ case 0: - if (do_raise(tstate, exc, cause)) { - goto exception_unwind; + if (do_raise(tstate, exc, cause)) { + goto exception_unwind; } break; default: - _PyErr_SetString(tstate, PyExc_SystemError, - "bad RAISE_VARARGS oparg"); + _PyErr_SetString(tstate, PyExc_SystemError, + "bad RAISE_VARARGS oparg"); break; } goto error; } - case TARGET(RETURN_VALUE): { + case TARGET(RETURN_VALUE): { retval = POP(); - assert(f->f_iblock == 0); - assert(EMPTY()); - goto exiting; + assert(f->f_iblock == 0); + assert(EMPTY()); + goto exiting; } - case TARGET(GET_AITER): { + case TARGET(GET_AITER): { unaryfunc getter = NULL; PyObject *iter = NULL; PyObject *obj = TOP(); @@ -2078,10 +2078,10 @@ main_loop: } else { SET_TOP(NULL); - _PyErr_Format(tstate, PyExc_TypeError, - "'async for' requires an object with " - "__aiter__ method, got %.100s", - type->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "'async for' requires an object with " + "__aiter__ method, got %.100s", + type->tp_name); Py_DECREF(obj); goto error; } @@ -2090,10 +2090,10 @@ main_loop: Py_TYPE(iter)->tp_as_async->am_anext == NULL) { SET_TOP(NULL); - _PyErr_Format(tstate, PyExc_TypeError, - "'async for' received an object from __aiter__ " - "that does not implement __anext__: %.100s", - Py_TYPE(iter)->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "'async for' received an object from __aiter__ " + "that does not implement __anext__: %.100s", + Py_TYPE(iter)->tp_name); Py_DECREF(iter); goto error; } @@ -2102,7 +2102,7 @@ main_loop: DISPATCH(); } - case TARGET(GET_ANEXT): { + case TARGET(GET_ANEXT): { unaryfunc getter = NULL; PyObject *next_iter = NULL; PyObject *awaitable = NULL; @@ -2126,10 +2126,10 @@ main_loop: } } else { - _PyErr_Format(tstate, PyExc_TypeError, - "'async for' requires an iterator with " - "__anext__ method, got %.100s", - type->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "'async for' requires an iterator with " + "__anext__ method, got %.100s", + type->tp_name); goto error; } @@ -2153,18 +2153,18 @@ main_loop: DISPATCH(); } - case TARGET(GET_AWAITABLE): { - PREDICTED(GET_AWAITABLE); + case TARGET(GET_AWAITABLE): { + PREDICTED(GET_AWAITABLE); PyObject *iterable = TOP(); PyObject *iter = _PyCoro_GetAwaitableIter(iterable); if (iter == NULL) { - int opcode_at_minus_3 = 0; - if ((next_instr - first_instr) > 2) { - opcode_at_minus_3 = _Py_OPCODE(next_instr[-3]); - } - format_awaitable_error(tstate, Py_TYPE(iterable), - opcode_at_minus_3, + int opcode_at_minus_3 = 0; + if ((next_instr - first_instr) > 2) { + opcode_at_minus_3 = _Py_OPCODE(next_instr[-3]); + } + format_awaitable_error(tstate, Py_TYPE(iterable), + opcode_at_minus_3, _Py_OPCODE(next_instr[-2])); } @@ -2178,8 +2178,8 @@ main_loop: being awaited on. */ Py_DECREF(yf); Py_CLEAR(iter); - _PyErr_SetString(tstate, PyExc_RuntimeError, - "coroutine is being awaited already"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "coroutine is being awaited already"); /* The code below jumps to `error` if `iter` is NULL. */ } } @@ -2194,7 +2194,7 @@ main_loop: DISPATCH(); } - case TARGET(YIELD_FROM): { + case TARGET(YIELD_FROM): { PyObject *v = POP(); PyObject *receiver = TOP(); int err; @@ -2205,13 +2205,13 @@ main_loop: if (v == Py_None) retval = Py_TYPE(receiver)->tp_iternext(receiver); else - retval = _PyObject_CallMethodIdOneArg(receiver, &PyId_send, v); + retval = _PyObject_CallMethodIdOneArg(receiver, &PyId_send, v); } Py_DECREF(v); if (retval == NULL) { PyObject *val; if (tstate->c_tracefunc != NULL - && _PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) + && _PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); err = _PyGen_FetchStopIterationValue(&val); if (err < 0) @@ -2225,10 +2225,10 @@ main_loop: /* and repeat... */ assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT)); f->f_lasti -= sizeof(_Py_CODEUNIT); - goto exiting; + goto exiting; } - case TARGET(YIELD_VALUE): { + case TARGET(YIELD_VALUE): { retval = POP(); if (co->co_flags & CO_ASYNC_GENERATOR) { @@ -2242,86 +2242,86 @@ main_loop: } f->f_stacktop = stack_pointer; - goto exiting; + goto exiting; } - case TARGET(POP_EXCEPT): { - PyObject *type, *value, *traceback; - _PyErr_StackItem *exc_info; + case TARGET(POP_EXCEPT): { + PyObject *type, *value, *traceback; + _PyErr_StackItem *exc_info; PyTryBlock *b = PyFrame_BlockPop(f); if (b->b_type != EXCEPT_HANDLER) { - _PyErr_SetString(tstate, PyExc_SystemError, - "popped block is not an except handler"); + _PyErr_SetString(tstate, PyExc_SystemError, + "popped block is not an except handler"); goto error; } - assert(STACK_LEVEL() >= (b)->b_level + 3 && - STACK_LEVEL() <= (b)->b_level + 4); - exc_info = tstate->exc_info; - type = exc_info->exc_type; - value = exc_info->exc_value; - traceback = exc_info->exc_traceback; - exc_info->exc_type = POP(); - exc_info->exc_value = POP(); - exc_info->exc_traceback = POP(); - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); + assert(STACK_LEVEL() >= (b)->b_level + 3 && + STACK_LEVEL() <= (b)->b_level + 4); + exc_info = tstate->exc_info; + type = exc_info->exc_type; + value = exc_info->exc_value; + traceback = exc_info->exc_traceback; + exc_info->exc_type = POP(); + exc_info->exc_value = POP(); + exc_info->exc_traceback = POP(); + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); DISPATCH(); } - case TARGET(POP_BLOCK): { - PREDICTED(POP_BLOCK); - PyFrame_BlockPop(f); + case TARGET(POP_BLOCK): { + PREDICTED(POP_BLOCK); + PyFrame_BlockPop(f); DISPATCH(); } - case TARGET(RERAISE): { - PyObject *exc = POP(); - PyObject *val = POP(); - PyObject *tb = POP(); - assert(PyExceptionClass_Check(exc)); - _PyErr_Restore(tstate, exc, val, tb); - goto exception_unwind; - } - - case TARGET(END_ASYNC_FOR): { - PyObject *exc = POP(); - assert(PyExceptionClass_Check(exc)); - if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { - PyTryBlock *b = PyFrame_BlockPop(f); - assert(b->b_type == EXCEPT_HANDLER); - Py_DECREF(exc); - UNWIND_EXCEPT_HANDLER(b); - Py_DECREF(POP()); - JUMPBY(oparg); - FAST_DISPATCH(); - } - else { - PyObject *val = POP(); - PyObject *tb = POP(); - _PyErr_Restore(tstate, exc, val, tb); - goto exception_unwind; - } - } - - case TARGET(LOAD_ASSERTION_ERROR): { - PyObject *value = PyExc_AssertionError; - Py_INCREF(value); - PUSH(value); - FAST_DISPATCH(); - } - - case TARGET(LOAD_BUILD_CLASS): { + case TARGET(RERAISE): { + PyObject *exc = POP(); + PyObject *val = POP(); + PyObject *tb = POP(); + assert(PyExceptionClass_Check(exc)); + _PyErr_Restore(tstate, exc, val, tb); + goto exception_unwind; + } + + case TARGET(END_ASYNC_FOR): { + PyObject *exc = POP(); + assert(PyExceptionClass_Check(exc)); + if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { + PyTryBlock *b = PyFrame_BlockPop(f); + assert(b->b_type == EXCEPT_HANDLER); + Py_DECREF(exc); + UNWIND_EXCEPT_HANDLER(b); + Py_DECREF(POP()); + JUMPBY(oparg); + FAST_DISPATCH(); + } + else { + PyObject *val = POP(); + PyObject *tb = POP(); + _PyErr_Restore(tstate, exc, val, tb); + goto exception_unwind; + } + } + + case TARGET(LOAD_ASSERTION_ERROR): { + PyObject *value = PyExc_AssertionError; + Py_INCREF(value); + PUSH(value); + FAST_DISPATCH(); + } + + case TARGET(LOAD_BUILD_CLASS): { _Py_IDENTIFIER(__build_class__); PyObject *bc; if (PyDict_CheckExact(f->f_builtins)) { - bc = _PyDict_GetItemIdWithError(f->f_builtins, &PyId___build_class__); + bc = _PyDict_GetItemIdWithError(f->f_builtins, &PyId___build_class__); if (bc == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_SetString(tstate, PyExc_NameError, - "__build_class__ not found"); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_SetString(tstate, PyExc_NameError, + "__build_class__ not found"); + } goto error; } Py_INCREF(bc); @@ -2332,9 +2332,9 @@ main_loop: goto error; bc = PyObject_GetItem(f->f_builtins, build_class_str); if (bc == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) - _PyErr_SetString(tstate, PyExc_NameError, - "__build_class__ not found"); + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) + _PyErr_SetString(tstate, PyExc_NameError, + "__build_class__ not found"); goto error; } } @@ -2342,14 +2342,14 @@ main_loop: DISPATCH(); } - case TARGET(STORE_NAME): { + case TARGET(STORE_NAME): { PyObject *name = GETITEM(names, oparg); PyObject *v = POP(); PyObject *ns = f->f_locals; int err; if (ns == NULL) { - _PyErr_Format(tstate, PyExc_SystemError, - "no locals found when storing %R", name); + _PyErr_Format(tstate, PyExc_SystemError, + "no locals found when storing %R", name); Py_DECREF(v); goto error; } @@ -2363,18 +2363,18 @@ main_loop: DISPATCH(); } - case TARGET(DELETE_NAME): { + case TARGET(DELETE_NAME): { PyObject *name = GETITEM(names, oparg); PyObject *ns = f->f_locals; int err; if (ns == NULL) { - _PyErr_Format(tstate, PyExc_SystemError, - "no locals when deleting %R", name); + _PyErr_Format(tstate, PyExc_SystemError, + "no locals when deleting %R", name); goto error; } err = PyObject_DelItem(ns, name); if (err != 0) { - format_exc_check_arg(tstate, PyExc_NameError, + format_exc_check_arg(tstate, PyExc_NameError, NAME_ERROR_MSG, name); goto error; @@ -2382,8 +2382,8 @@ main_loop: DISPATCH(); } - case TARGET(UNPACK_SEQUENCE): { - PREDICTED(UNPACK_SEQUENCE); + case TARGET(UNPACK_SEQUENCE): { + PREDICTED(UNPACK_SEQUENCE); PyObject *seq = POP(), *item, **items; if (PyTuple_CheckExact(seq) && PyTuple_GET_SIZE(seq) == oparg) { @@ -2401,9 +2401,9 @@ main_loop: Py_INCREF(item); PUSH(item); } - } else if (unpack_iterable(tstate, seq, oparg, -1, + } else if (unpack_iterable(tstate, seq, oparg, -1, stack_pointer + oparg)) { - STACK_GROW(oparg); + STACK_GROW(oparg); } else { /* unpack_iterable() raised an exception */ Py_DECREF(seq); @@ -2413,11 +2413,11 @@ main_loop: DISPATCH(); } - case TARGET(UNPACK_EX): { + case TARGET(UNPACK_EX): { int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); PyObject *seq = POP(); - if (unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, + if (unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, stack_pointer + totalargs)) { stack_pointer += totalargs; } else { @@ -2428,12 +2428,12 @@ main_loop: DISPATCH(); } - case TARGET(STORE_ATTR): { + case TARGET(STORE_ATTR): { PyObject *name = GETITEM(names, oparg); PyObject *owner = TOP(); PyObject *v = SECOND(); int err; - STACK_SHRINK(2); + STACK_SHRINK(2); err = PyObject_SetAttr(owner, name, v); Py_DECREF(v); Py_DECREF(owner); @@ -2442,7 +2442,7 @@ main_loop: DISPATCH(); } - case TARGET(DELETE_ATTR): { + case TARGET(DELETE_ATTR): { PyObject *name = GETITEM(names, oparg); PyObject *owner = POP(); int err; @@ -2453,7 +2453,7 @@ main_loop: DISPATCH(); } - case TARGET(STORE_GLOBAL): { + case TARGET(STORE_GLOBAL): { PyObject *name = GETITEM(names, oparg); PyObject *v = POP(); int err; @@ -2464,63 +2464,63 @@ main_loop: DISPATCH(); } - case TARGET(DELETE_GLOBAL): { + case TARGET(DELETE_GLOBAL): { PyObject *name = GETITEM(names, oparg); int err; err = PyDict_DelItem(f->f_globals, name); if (err != 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - format_exc_check_arg(tstate, PyExc_NameError, - NAME_ERROR_MSG, name); - } + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + format_exc_check_arg(tstate, PyExc_NameError, + NAME_ERROR_MSG, name); + } goto error; } DISPATCH(); } - case TARGET(LOAD_NAME): { + case TARGET(LOAD_NAME): { PyObject *name = GETITEM(names, oparg); PyObject *locals = f->f_locals; PyObject *v; if (locals == NULL) { - _PyErr_Format(tstate, PyExc_SystemError, - "no locals when loading %R", name); + _PyErr_Format(tstate, PyExc_SystemError, + "no locals when loading %R", name); goto error; } if (PyDict_CheckExact(locals)) { - v = PyDict_GetItemWithError(locals, name); - if (v != NULL) { - Py_INCREF(v); - } - else if (_PyErr_Occurred(tstate)) { - goto error; - } + v = PyDict_GetItemWithError(locals, name); + if (v != NULL) { + Py_INCREF(v); + } + else if (_PyErr_Occurred(tstate)) { + goto error; + } } else { v = PyObject_GetItem(locals, name); if (v == NULL) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) + if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) goto error; - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } } if (v == NULL) { - v = PyDict_GetItemWithError(f->f_globals, name); - if (v != NULL) { - Py_INCREF(v); - } - else if (_PyErr_Occurred(tstate)) { - goto error; - } - else { + v = PyDict_GetItemWithError(f->f_globals, name); + if (v != NULL) { + Py_INCREF(v); + } + else if (_PyErr_Occurred(tstate)) { + goto error; + } + else { if (PyDict_CheckExact(f->f_builtins)) { - v = PyDict_GetItemWithError(f->f_builtins, name); + v = PyDict_GetItemWithError(f->f_builtins, name); if (v == NULL) { - if (!_PyErr_Occurred(tstate)) { - format_exc_check_arg( - tstate, PyExc_NameError, + if (!_PyErr_Occurred(tstate)) { + format_exc_check_arg( + tstate, PyExc_NameError, NAME_ERROR_MSG, name); - } + } goto error; } Py_INCREF(v); @@ -2528,11 +2528,11 @@ main_loop: else { v = PyObject_GetItem(f->f_builtins, name); if (v == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { format_exc_check_arg( - tstate, PyExc_NameError, + tstate, PyExc_NameError, NAME_ERROR_MSG, name); - } + } goto error; } } @@ -2542,31 +2542,31 @@ main_loop: DISPATCH(); } - case TARGET(LOAD_GLOBAL): { - PyObject *name; + case TARGET(LOAD_GLOBAL): { + PyObject *name; PyObject *v; if (PyDict_CheckExact(f->f_globals) && PyDict_CheckExact(f->f_builtins)) { - OPCACHE_CHECK(); - if (co_opcache != NULL && co_opcache->optimized > 0) { - _PyOpcache_LoadGlobal *lg = &co_opcache->u.lg; - - if (lg->globals_ver == - ((PyDictObject *)f->f_globals)->ma_version_tag - && lg->builtins_ver == - ((PyDictObject *)f->f_builtins)->ma_version_tag) - { - PyObject *ptr = lg->ptr; - OPCACHE_STAT_GLOBAL_HIT(); - assert(ptr != NULL); - Py_INCREF(ptr); - PUSH(ptr); - DISPATCH(); - } - } - - name = GETITEM(names, oparg); + OPCACHE_CHECK(); + if (co_opcache != NULL && co_opcache->optimized > 0) { + _PyOpcache_LoadGlobal *lg = &co_opcache->u.lg; + + if (lg->globals_ver == + ((PyDictObject *)f->f_globals)->ma_version_tag + && lg->builtins_ver == + ((PyDictObject *)f->f_builtins)->ma_version_tag) + { + PyObject *ptr = lg->ptr; + OPCACHE_STAT_GLOBAL_HIT(); + assert(ptr != NULL); + Py_INCREF(ptr); + PUSH(ptr); + DISPATCH(); + } + } + + name = GETITEM(names, oparg); v = _PyDict_LoadGlobal((PyDictObject *)f->f_globals, (PyDictObject *)f->f_builtins, name); @@ -2574,52 +2574,52 @@ main_loop: if (!_PyErr_OCCURRED()) { /* _PyDict_LoadGlobal() returns NULL without raising * an exception if the key doesn't exist */ - format_exc_check_arg(tstate, PyExc_NameError, + format_exc_check_arg(tstate, PyExc_NameError, NAME_ERROR_MSG, name); } goto error; } - - if (co_opcache != NULL) { - _PyOpcache_LoadGlobal *lg = &co_opcache->u.lg; - - if (co_opcache->optimized == 0) { - /* Wasn't optimized before. */ - OPCACHE_STAT_GLOBAL_OPT(); - } else { - OPCACHE_STAT_GLOBAL_MISS(); - } - - co_opcache->optimized = 1; - lg->globals_ver = - ((PyDictObject *)f->f_globals)->ma_version_tag; - lg->builtins_ver = - ((PyDictObject *)f->f_builtins)->ma_version_tag; - lg->ptr = v; /* borrowed */ - } - + + if (co_opcache != NULL) { + _PyOpcache_LoadGlobal *lg = &co_opcache->u.lg; + + if (co_opcache->optimized == 0) { + /* Wasn't optimized before. */ + OPCACHE_STAT_GLOBAL_OPT(); + } else { + OPCACHE_STAT_GLOBAL_MISS(); + } + + co_opcache->optimized = 1; + lg->globals_ver = + ((PyDictObject *)f->f_globals)->ma_version_tag; + lg->builtins_ver = + ((PyDictObject *)f->f_builtins)->ma_version_tag; + lg->ptr = v; /* borrowed */ + } + Py_INCREF(v); } else { /* Slow-path if globals or builtins is not a dict */ /* namespace 1: globals */ - name = GETITEM(names, oparg); + name = GETITEM(names, oparg); v = PyObject_GetItem(f->f_globals, name); if (v == NULL) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { goto error; - } - _PyErr_Clear(tstate); + } + _PyErr_Clear(tstate); /* namespace 2: builtins */ v = PyObject_GetItem(f->f_builtins, name); if (v == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { format_exc_check_arg( - tstate, PyExc_NameError, + tstate, PyExc_NameError, NAME_ERROR_MSG, name); - } + } goto error; } } @@ -2628,21 +2628,21 @@ main_loop: DISPATCH(); } - case TARGET(DELETE_FAST): { + case TARGET(DELETE_FAST): { PyObject *v = GETLOCAL(oparg); if (v != NULL) { SETLOCAL(oparg, NULL); DISPATCH(); } format_exc_check_arg( - tstate, PyExc_UnboundLocalError, + tstate, PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, PyTuple_GetItem(co->co_varnames, oparg) ); goto error; } - case TARGET(DELETE_DEREF): { + case TARGET(DELETE_DEREF): { PyObject *cell = freevars[oparg]; PyObject *oldobj = PyCell_GET(cell); if (oldobj != NULL) { @@ -2650,18 +2650,18 @@ main_loop: Py_DECREF(oldobj); DISPATCH(); } - format_exc_unbound(tstate, co, oparg); + format_exc_unbound(tstate, co, oparg); goto error; } - case TARGET(LOAD_CLOSURE): { + case TARGET(LOAD_CLOSURE): { PyObject *cell = freevars[oparg]; Py_INCREF(cell); PUSH(cell); DISPATCH(); } - case TARGET(LOAD_CLASSDEREF): { + case TARGET(LOAD_CLASSDEREF): { PyObject *name, *value, *locals = f->f_locals; Py_ssize_t idx; assert(locals); @@ -2670,28 +2670,28 @@ main_loop: assert(idx >= 0 && idx < PyTuple_GET_SIZE(co->co_freevars)); name = PyTuple_GET_ITEM(co->co_freevars, idx); if (PyDict_CheckExact(locals)) { - value = PyDict_GetItemWithError(locals, name); - if (value != NULL) { - Py_INCREF(value); - } - else if (_PyErr_Occurred(tstate)) { - goto error; - } + value = PyDict_GetItemWithError(locals, name); + if (value != NULL) { + Py_INCREF(value); + } + else if (_PyErr_Occurred(tstate)) { + goto error; + } } else { value = PyObject_GetItem(locals, name); if (value == NULL) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { goto error; - } - _PyErr_Clear(tstate); + } + _PyErr_Clear(tstate); } } if (!value) { PyObject *cell = freevars[oparg]; value = PyCell_GET(cell); if (value == NULL) { - format_exc_unbound(tstate, co, oparg); + format_exc_unbound(tstate, co, oparg); goto error; } Py_INCREF(value); @@ -2700,11 +2700,11 @@ main_loop: DISPATCH(); } - case TARGET(LOAD_DEREF): { + case TARGET(LOAD_DEREF): { PyObject *cell = freevars[oparg]; PyObject *value = PyCell_GET(cell); if (value == NULL) { - format_exc_unbound(tstate, co, oparg); + format_exc_unbound(tstate, co, oparg); goto error; } Py_INCREF(value); @@ -2712,7 +2712,7 @@ main_loop: DISPATCH(); } - case TARGET(STORE_DEREF): { + case TARGET(STORE_DEREF): { PyObject *v = POP(); PyObject *cell = freevars[oparg]; PyObject *oldobj = PyCell_GET(cell); @@ -2721,7 +2721,7 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_STRING): { + case TARGET(BUILD_STRING): { PyObject *str; PyObject *empty = PyUnicode_New(0, 0); if (empty == NULL) { @@ -2739,7 +2739,7 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_TUPLE): { + case TARGET(BUILD_TUPLE): { PyObject *tup = PyTuple_New(oparg); if (tup == NULL) goto error; @@ -2751,7 +2751,7 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_LIST): { + case TARGET(BUILD_LIST): { PyObject *list = PyList_New(oparg); if (list == NULL) goto error; @@ -2763,50 +2763,50 @@ main_loop: DISPATCH(); } - case TARGET(LIST_TO_TUPLE): { - PyObject *list = POP(); - PyObject *tuple = PyList_AsTuple(list); - Py_DECREF(list); - if (tuple == NULL) { + case TARGET(LIST_TO_TUPLE): { + PyObject *list = POP(); + PyObject *tuple = PyList_AsTuple(list); + Py_DECREF(list); + if (tuple == NULL) { goto error; - } - PUSH(tuple); - DISPATCH(); - } - - case TARGET(LIST_EXTEND): { - PyObject *iterable = POP(); - PyObject *list = PEEK(oparg); - PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); - if (none_val == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && - (Py_TYPE(iterable)->tp_iter == NULL && !PySequence_Check(iterable))) - { - _PyErr_Clear(tstate); - _PyErr_Format(tstate, PyExc_TypeError, - "Value after * must be an iterable, not %.200s", - Py_TYPE(iterable)->tp_name); + } + PUSH(tuple); + DISPATCH(); + } + + case TARGET(LIST_EXTEND): { + PyObject *iterable = POP(); + PyObject *list = PEEK(oparg); + PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); + if (none_val == NULL) { + if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && + (Py_TYPE(iterable)->tp_iter == NULL && !PySequence_Check(iterable))) + { + _PyErr_Clear(tstate); + _PyErr_Format(tstate, PyExc_TypeError, + "Value after * must be an iterable, not %.200s", + Py_TYPE(iterable)->tp_name); } - Py_DECREF(iterable); - goto error; - } - Py_DECREF(none_val); - Py_DECREF(iterable); - DISPATCH(); - } - - case TARGET(SET_UPDATE): { - PyObject *iterable = POP(); - PyObject *set = PEEK(oparg); - int err = _PySet_Update(set, iterable); - Py_DECREF(iterable); - if (err < 0) { - goto error; + Py_DECREF(iterable); + goto error; } + Py_DECREF(none_val); + Py_DECREF(iterable); DISPATCH(); } - case TARGET(BUILD_SET): { + case TARGET(SET_UPDATE): { + PyObject *iterable = POP(); + PyObject *set = PEEK(oparg); + int err = _PySet_Update(set, iterable); + Py_DECREF(iterable); + if (err < 0) { + goto error; + } + DISPATCH(); + } + + case TARGET(BUILD_SET): { PyObject *set = PySet_New(NULL); int err = 0; int i; @@ -2818,7 +2818,7 @@ main_loop: err = PySet_Add(set, item); Py_DECREF(item); } - STACK_SHRINK(oparg); + STACK_SHRINK(oparg); if (err != 0) { Py_DECREF(set); goto error; @@ -2827,7 +2827,7 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_MAP): { + case TARGET(BUILD_MAP): { Py_ssize_t i; PyObject *map = _PyDict_NewPresized((Py_ssize_t)oparg); if (map == NULL) @@ -2851,23 +2851,23 @@ main_loop: DISPATCH(); } - case TARGET(SETUP_ANNOTATIONS): { + case TARGET(SETUP_ANNOTATIONS): { _Py_IDENTIFIER(__annotations__); int err; PyObject *ann_dict; if (f->f_locals == NULL) { - _PyErr_Format(tstate, PyExc_SystemError, - "no locals found when setting up annotations"); + _PyErr_Format(tstate, PyExc_SystemError, + "no locals found when setting up annotations"); goto error; } /* check if __annotations__ in locals()... */ if (PyDict_CheckExact(f->f_locals)) { - ann_dict = _PyDict_GetItemIdWithError(f->f_locals, + ann_dict = _PyDict_GetItemIdWithError(f->f_locals, &PyId___annotations__); if (ann_dict == NULL) { - if (_PyErr_Occurred(tstate)) { - goto error; - } + if (_PyErr_Occurred(tstate)) { + goto error; + } /* ...if not, create a new one */ ann_dict = PyDict_New(); if (ann_dict == NULL) { @@ -2889,10 +2889,10 @@ main_loop: } ann_dict = PyObject_GetItem(f->f_locals, ann_str); if (ann_dict == NULL) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { goto error; } - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); ann_dict = PyDict_New(); if (ann_dict == NULL) { goto error; @@ -2910,14 +2910,14 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_CONST_KEY_MAP): { + case TARGET(BUILD_CONST_KEY_MAP): { Py_ssize_t i; PyObject *map; PyObject *keys = TOP(); if (!PyTuple_CheckExact(keys) || PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) { - _PyErr_SetString(tstate, PyExc_SystemError, - "bad BUILD_CONST_KEY_MAP keys argument"); + _PyErr_SetString(tstate, PyExc_SystemError, + "bad BUILD_CONST_KEY_MAP keys argument"); goto error; } map = _PyDict_NewPresized((Py_ssize_t)oparg); @@ -2943,42 +2943,42 @@ main_loop: DISPATCH(); } - case TARGET(DICT_UPDATE): { - PyObject *update = POP(); - PyObject *dict = PEEK(oparg); - if (PyDict_Update(dict, update) < 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { - _PyErr_Format(tstate, PyExc_TypeError, - "'%.200s' object is not a mapping", - Py_TYPE(update)->tp_name); - } - Py_DECREF(update); + case TARGET(DICT_UPDATE): { + PyObject *update = POP(); + PyObject *dict = PEEK(oparg); + if (PyDict_Update(dict, update) < 0) { + if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { + _PyErr_Format(tstate, PyExc_TypeError, + "'%.200s' object is not a mapping", + Py_TYPE(update)->tp_name); + } + Py_DECREF(update); goto error; } - Py_DECREF(update); + Py_DECREF(update); DISPATCH(); } - case TARGET(DICT_MERGE): { - PyObject *update = POP(); - PyObject *dict = PEEK(oparg); - - if (_PyDict_MergeEx(dict, update, 2) < 0) { - format_kwargs_error(tstate, PEEK(2 + oparg), update); - Py_DECREF(update); + case TARGET(DICT_MERGE): { + PyObject *update = POP(); + PyObject *dict = PEEK(oparg); + + if (_PyDict_MergeEx(dict, update, 2) < 0) { + format_kwargs_error(tstate, PEEK(2 + oparg), update); + Py_DECREF(update); goto error; } - Py_DECREF(update); - PREDICT(CALL_FUNCTION_EX); + Py_DECREF(update); + PREDICT(CALL_FUNCTION_EX); DISPATCH(); } - case TARGET(MAP_ADD): { - PyObject *value = TOP(); - PyObject *key = SECOND(); + case TARGET(MAP_ADD): { + PyObject *value = TOP(); + PyObject *key = SECOND(); PyObject *map; int err; - STACK_SHRINK(2); + STACK_SHRINK(2); map = PEEK(oparg); /* dict */ assert(PyDict_CheckExact(map)); err = PyDict_SetItem(map, key, value); /* map[key] = value */ @@ -2990,7 +2990,7 @@ main_loop: DISPATCH(); } - case TARGET(LOAD_ATTR): { + case TARGET(LOAD_ATTR): { PyObject *name = GETITEM(names, oparg); PyObject *owner = TOP(); PyObject *res = PyObject_GetAttr(owner, name); @@ -3001,12 +3001,12 @@ main_loop: DISPATCH(); } - case TARGET(COMPARE_OP): { - assert(oparg <= Py_GE); + case TARGET(COMPARE_OP): { + assert(oparg <= Py_GE); PyObject *right = POP(); PyObject *left = TOP(); - PyObject *res = PyObject_RichCompare(left, right, oparg); - SET_TOP(res); + PyObject *res = PyObject_RichCompare(left, right, oparg); + SET_TOP(res); Py_DECREF(left); Py_DECREF(right); if (res == NULL) @@ -3016,87 +3016,87 @@ main_loop: DISPATCH(); } - case TARGET(IS_OP): { - PyObject *right = POP(); - PyObject *left = TOP(); - int res = (left == right)^oparg; - PyObject *b = res ? Py_True : Py_False; - Py_INCREF(b); - SET_TOP(b); - Py_DECREF(left); - Py_DECREF(right); - PREDICT(POP_JUMP_IF_FALSE); - PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); - } - - case TARGET(CONTAINS_OP): { - PyObject *right = POP(); - PyObject *left = POP(); - int res = PySequence_Contains(right, left); - Py_DECREF(left); - Py_DECREF(right); - if (res < 0) { - goto error; - } - PyObject *b = (res^oparg) ? Py_True : Py_False; - Py_INCREF(b); - PUSH(b); - PREDICT(POP_JUMP_IF_FALSE); - PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); - } - -#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\ - "BaseException is not allowed" - - case TARGET(JUMP_IF_NOT_EXC_MATCH): { - PyObject *right = POP(); - PyObject *left = POP(); - if (PyTuple_Check(right)) { - Py_ssize_t i, length; - length = PyTuple_GET_SIZE(right); - for (i = 0; i < length; i++) { - PyObject *exc = PyTuple_GET_ITEM(right, i); - if (!PyExceptionClass_Check(exc)) { - _PyErr_SetString(tstate, PyExc_TypeError, - CANNOT_CATCH_MSG); - Py_DECREF(left); - Py_DECREF(right); - goto error; - } - } - } - else { - if (!PyExceptionClass_Check(right)) { - _PyErr_SetString(tstate, PyExc_TypeError, - CANNOT_CATCH_MSG); - Py_DECREF(left); - Py_DECREF(right); - goto error; - } - } - int res = PyErr_GivenExceptionMatches(left, right); - Py_DECREF(left); - Py_DECREF(right); - if (res > 0) { - /* Exception matches -- Do nothing */; - } - else if (res == 0) { - JUMPTO(oparg); - } - else { - goto error; - } - DISPATCH(); - } - - case TARGET(IMPORT_NAME): { + case TARGET(IS_OP): { + PyObject *right = POP(); + PyObject *left = TOP(); + int res = (left == right)^oparg; + PyObject *b = res ? Py_True : Py_False; + Py_INCREF(b); + SET_TOP(b); + Py_DECREF(left); + Py_DECREF(right); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + FAST_DISPATCH(); + } + + case TARGET(CONTAINS_OP): { + PyObject *right = POP(); + PyObject *left = POP(); + int res = PySequence_Contains(right, left); + Py_DECREF(left); + Py_DECREF(right); + if (res < 0) { + goto error; + } + PyObject *b = (res^oparg) ? Py_True : Py_False; + Py_INCREF(b); + PUSH(b); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + FAST_DISPATCH(); + } + +#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\ + "BaseException is not allowed" + + case TARGET(JUMP_IF_NOT_EXC_MATCH): { + PyObject *right = POP(); + PyObject *left = POP(); + if (PyTuple_Check(right)) { + Py_ssize_t i, length; + length = PyTuple_GET_SIZE(right); + for (i = 0; i < length; i++) { + PyObject *exc = PyTuple_GET_ITEM(right, i); + if (!PyExceptionClass_Check(exc)) { + _PyErr_SetString(tstate, PyExc_TypeError, + CANNOT_CATCH_MSG); + Py_DECREF(left); + Py_DECREF(right); + goto error; + } + } + } + else { + if (!PyExceptionClass_Check(right)) { + _PyErr_SetString(tstate, PyExc_TypeError, + CANNOT_CATCH_MSG); + Py_DECREF(left); + Py_DECREF(right); + goto error; + } + } + int res = PyErr_GivenExceptionMatches(left, right); + Py_DECREF(left); + Py_DECREF(right); + if (res > 0) { + /* Exception matches -- Do nothing */; + } + else if (res == 0) { + JUMPTO(oparg); + } + else { + goto error; + } + DISPATCH(); + } + + case TARGET(IMPORT_NAME): { PyObject *name = GETITEM(names, oparg); PyObject *fromlist = POP(); PyObject *level = TOP(); PyObject *res; - res = import_name(tstate, f, name, fromlist, level); + res = import_name(tstate, f, name, fromlist, level); Py_DECREF(level); Py_DECREF(fromlist); SET_TOP(res); @@ -3105,7 +3105,7 @@ main_loop: DISPATCH(); } - case TARGET(IMPORT_STAR): { + case TARGET(IMPORT_STAR): { PyObject *from = POP(), *locals; int err; if (PyFrame_FastToLocalsWithError(f) < 0) { @@ -3115,12 +3115,12 @@ main_loop: locals = f->f_locals; if (locals == NULL) { - _PyErr_SetString(tstate, PyExc_SystemError, - "no locals found during 'import *'"); + _PyErr_SetString(tstate, PyExc_SystemError, + "no locals found during 'import *'"); Py_DECREF(from); goto error; } - err = import_all_from(tstate, locals, from); + err = import_all_from(tstate, locals, from); PyFrame_LocalsToFast(f, 0); Py_DECREF(from); if (err != 0) @@ -3128,24 +3128,24 @@ main_loop: DISPATCH(); } - case TARGET(IMPORT_FROM): { + case TARGET(IMPORT_FROM): { PyObject *name = GETITEM(names, oparg); PyObject *from = TOP(); PyObject *res; - res = import_from(tstate, from, name); + res = import_from(tstate, from, name); PUSH(res); if (res == NULL) goto error; DISPATCH(); } - case TARGET(JUMP_FORWARD): { + case TARGET(JUMP_FORWARD): { JUMPBY(oparg); FAST_DISPATCH(); } - case TARGET(POP_JUMP_IF_FALSE): { - PREDICTED(POP_JUMP_IF_FALSE); + case TARGET(POP_JUMP_IF_FALSE): { + PREDICTED(POP_JUMP_IF_FALSE); PyObject *cond = POP(); int err; if (cond == Py_True) { @@ -3168,8 +3168,8 @@ main_loop: DISPATCH(); } - case TARGET(POP_JUMP_IF_TRUE): { - PREDICTED(POP_JUMP_IF_TRUE); + case TARGET(POP_JUMP_IF_TRUE): { + PREDICTED(POP_JUMP_IF_TRUE); PyObject *cond = POP(); int err; if (cond == Py_False) { @@ -3193,11 +3193,11 @@ main_loop: DISPATCH(); } - case TARGET(JUMP_IF_FALSE_OR_POP): { + case TARGET(JUMP_IF_FALSE_OR_POP): { PyObject *cond = TOP(); int err; if (cond == Py_True) { - STACK_SHRINK(1); + STACK_SHRINK(1); Py_DECREF(cond); FAST_DISPATCH(); } @@ -3207,7 +3207,7 @@ main_loop: } err = PyObject_IsTrue(cond); if (err > 0) { - STACK_SHRINK(1); + STACK_SHRINK(1); Py_DECREF(cond); } else if (err == 0) @@ -3217,11 +3217,11 @@ main_loop: DISPATCH(); } - case TARGET(JUMP_IF_TRUE_OR_POP): { + case TARGET(JUMP_IF_TRUE_OR_POP): { PyObject *cond = TOP(); int err; if (cond == Py_False) { - STACK_SHRINK(1); + STACK_SHRINK(1); Py_DECREF(cond); FAST_DISPATCH(); } @@ -3234,7 +3234,7 @@ main_loop: JUMPTO(oparg); } else if (err == 0) { - STACK_SHRINK(1); + STACK_SHRINK(1); Py_DECREF(cond); } else @@ -3242,8 +3242,8 @@ main_loop: DISPATCH(); } - case TARGET(JUMP_ABSOLUTE): { - PREDICTED(JUMP_ABSOLUTE); + case TARGET(JUMP_ABSOLUTE): { + PREDICTED(JUMP_ABSOLUTE); JUMPTO(oparg); #if FAST_LOOPS /* Enabling this path speeds-up all while and for-loops by bypassing @@ -3259,7 +3259,7 @@ main_loop: #endif } - case TARGET(GET_ITER): { + case TARGET(GET_ITER): { /* before: [obj]; after [getiter(obj)] */ PyObject *iterable = TOP(); PyObject *iter = PyObject_GetIter(iterable); @@ -3272,7 +3272,7 @@ main_loop: DISPATCH(); } - case TARGET(GET_YIELD_FROM_ITER): { + case TARGET(GET_YIELD_FROM_ITER): { /* before: [obj]; after [getiter(obj)] */ PyObject *iterable = TOP(); PyObject *iter; @@ -3283,9 +3283,9 @@ main_loop: regular generator. */ Py_DECREF(iterable); SET_TOP(NULL); - _PyErr_SetString(tstate, PyExc_TypeError, - "cannot 'yield from' a coroutine object " - "in a non-coroutine generator"); + _PyErr_SetString(tstate, PyExc_TypeError, + "cannot 'yield from' a coroutine object " + "in a non-coroutine generator"); goto error; } } @@ -3301,54 +3301,54 @@ main_loop: DISPATCH(); } - case TARGET(FOR_ITER): { - PREDICTED(FOR_ITER); + case TARGET(FOR_ITER): { + PREDICTED(FOR_ITER); /* before: [iter]; after: [iter, iter()] *or* [] */ PyObject *iter = TOP(); - PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); + PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); if (next != NULL) { PUSH(next); PREDICT(STORE_FAST); PREDICT(UNPACK_SEQUENCE); DISPATCH(); } - if (_PyErr_Occurred(tstate)) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) { + if (_PyErr_Occurred(tstate)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) { goto error; - } - else if (tstate->c_tracefunc != NULL) { + } + else if (tstate->c_tracefunc != NULL) { call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); - } - _PyErr_Clear(tstate); + } + _PyErr_Clear(tstate); } /* iterator ended normally */ - STACK_SHRINK(1); + STACK_SHRINK(1); Py_DECREF(iter); JUMPBY(oparg); PREDICT(POP_BLOCK); DISPATCH(); } - case TARGET(SETUP_FINALLY): { - PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg, + case TARGET(SETUP_FINALLY): { + PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg, STACK_LEVEL()); DISPATCH(); } - case TARGET(BEFORE_ASYNC_WITH): { - _Py_IDENTIFIER(__aenter__); + case TARGET(BEFORE_ASYNC_WITH): { + _Py_IDENTIFIER(__aenter__); _Py_IDENTIFIER(__aexit__); PyObject *mgr = TOP(); - PyObject *enter = special_lookup(tstate, mgr, &PyId___aenter__); + PyObject *enter = special_lookup(tstate, mgr, &PyId___aenter__); PyObject *res; - if (enter == NULL) { + if (enter == NULL) { goto error; - } - PyObject *exit = special_lookup(tstate, mgr, &PyId___aexit__); - if (exit == NULL) { - Py_DECREF(enter); - goto error; - } + } + PyObject *exit = special_lookup(tstate, mgr, &PyId___aexit__); + if (exit == NULL) { + Py_DECREF(enter); + goto error; + } SET_TOP(exit); Py_DECREF(mgr); res = _PyObject_CallNoArg(enter); @@ -3360,7 +3360,7 @@ main_loop: DISPATCH(); } - case TARGET(SETUP_ASYNC_WITH): { + case TARGET(SETUP_ASYNC_WITH): { PyObject *res = POP(); /* Setup the finally block before pushing the result of __aenter__ on the stack. */ @@ -3370,16 +3370,16 @@ main_loop: DISPATCH(); } - case TARGET(SETUP_WITH): { - _Py_IDENTIFIER(__enter__); + case TARGET(SETUP_WITH): { + _Py_IDENTIFIER(__enter__); _Py_IDENTIFIER(__exit__); PyObject *mgr = TOP(); - PyObject *enter = special_lookup(tstate, mgr, &PyId___enter__); + PyObject *enter = special_lookup(tstate, mgr, &PyId___enter__); PyObject *res; - if (enter == NULL) { + if (enter == NULL) { goto error; - } - PyObject *exit = special_lookup(tstate, mgr, &PyId___exit__); + } + PyObject *exit = special_lookup(tstate, mgr, &PyId___exit__); if (exit == NULL) { Py_DECREF(enter); goto error; @@ -3399,27 +3399,27 @@ main_loop: DISPATCH(); } - case TARGET(WITH_EXCEPT_START): { - /* At the top of the stack are 7 values: + case TARGET(WITH_EXCEPT_START): { + /* At the top of the stack are 7 values: - (TOP, SECOND, THIRD) = exc_info() - - (FOURTH, FIFTH, SIXTH) = previous exception for EXCEPT_HANDLER - - SEVENTH: the context.__exit__ bound method - We call SEVENTH(TOP, SECOND, THIRD). - Then we push again the TOP exception and the __exit__ - return value. + - (FOURTH, FIFTH, SIXTH) = previous exception for EXCEPT_HANDLER + - SEVENTH: the context.__exit__ bound method + We call SEVENTH(TOP, SECOND, THIRD). + Then we push again the TOP exception and the __exit__ + return value. */ PyObject *exit_func; PyObject *exc, *val, *tb, *res; exc = TOP(); - val = SECOND(); - tb = THIRD(); - assert(exc != Py_None); - assert(!PyLong_Check(exc)); - exit_func = PEEK(7); - PyObject *stack[4] = {NULL, exc, val, tb}; - res = PyObject_Vectorcall(exit_func, stack + 1, - 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); + val = SECOND(); + tb = THIRD(); + assert(exc != Py_None); + assert(!PyLong_Check(exc)); + exit_func = PEEK(7); + PyObject *stack[4] = {NULL, exc, val, tb}; + res = PyObject_Vectorcall(exit_func, stack + 1, + 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); if (res == NULL) goto error; @@ -3427,8 +3427,8 @@ main_loop: DISPATCH(); } - case TARGET(LOAD_METHOD): { - /* Designed to work in tandem with CALL_METHOD. */ + case TARGET(LOAD_METHOD): { + /* Designed to work in tandem with CALL_METHOD. */ PyObject *name = GETITEM(names, oparg); PyObject *obj = TOP(); PyObject *meth = NULL; @@ -3464,7 +3464,7 @@ main_loop: DISPATCH(); } - case TARGET(CALL_METHOD): { + case TARGET(CALL_METHOD): { /* Designed to work in tamdem with LOAD_METHOD. */ PyObject **sp, *res, *meth; @@ -3486,7 +3486,7 @@ main_loop: `callable` will be POPed by call_function. NULL will will be POPed manually later. */ - res = call_function(tstate, &sp, oparg, NULL); + res = call_function(tstate, &sp, oparg, NULL); stack_pointer = sp; (void)POP(); /* POP the NULL. */ } @@ -3503,7 +3503,7 @@ main_loop: We'll be passing `oparg + 1` to call_function, to make it accept the `self` as a first argument. */ - res = call_function(tstate, &sp, oparg + 1, NULL); + res = call_function(tstate, &sp, oparg + 1, NULL); stack_pointer = sp; } @@ -3513,11 +3513,11 @@ main_loop: DISPATCH(); } - case TARGET(CALL_FUNCTION): { - PREDICTED(CALL_FUNCTION); + case TARGET(CALL_FUNCTION): { + PREDICTED(CALL_FUNCTION); PyObject **sp, *res; sp = stack_pointer; - res = call_function(tstate, &sp, oparg, NULL); + res = call_function(tstate, &sp, oparg, NULL); stack_pointer = sp; PUSH(res); if (res == NULL) { @@ -3526,15 +3526,15 @@ main_loop: DISPATCH(); } - case TARGET(CALL_FUNCTION_KW): { + case TARGET(CALL_FUNCTION_KW): { PyObject **sp, *res, *names; names = POP(); - assert(PyTuple_Check(names)); - assert(PyTuple_GET_SIZE(names) <= oparg); - /* We assume without checking that names contains only strings */ + assert(PyTuple_Check(names)); + assert(PyTuple_GET_SIZE(names) <= oparg); + /* We assume without checking that names contains only strings */ sp = stack_pointer; - res = call_function(tstate, &sp, oparg, names); + res = call_function(tstate, &sp, oparg, names); stack_pointer = sp; PUSH(res); Py_DECREF(names); @@ -3545,8 +3545,8 @@ main_loop: DISPATCH(); } - case TARGET(CALL_FUNCTION_EX): { - PREDICTED(CALL_FUNCTION_EX); + case TARGET(CALL_FUNCTION_EX): { + PREDICTED(CALL_FUNCTION_EX); PyObject *func, *callargs, *kwargs = NULL, *result; if (oparg & 0x01) { kwargs = POP(); @@ -3554,9 +3554,9 @@ main_loop: PyObject *d = PyDict_New(); if (d == NULL) goto error; - if (_PyDict_MergeEx(d, kwargs, 2) < 0) { + if (_PyDict_MergeEx(d, kwargs, 2) < 0) { Py_DECREF(d); - format_kwargs_error(tstate, SECOND(), kwargs); + format_kwargs_error(tstate, SECOND(), kwargs); Py_DECREF(kwargs); goto error; } @@ -3568,7 +3568,7 @@ main_loop: callargs = POP(); func = TOP(); if (!PyTuple_CheckExact(callargs)) { - if (check_args_iterable(tstate, func, callargs) < 0) { + if (check_args_iterable(tstate, func, callargs) < 0) { Py_DECREF(callargs); goto error; } @@ -3579,7 +3579,7 @@ main_loop: } assert(PyTuple_CheckExact(callargs)); - result = do_call_core(tstate, func, callargs, kwargs); + result = do_call_core(tstate, func, callargs, kwargs); Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); @@ -3591,7 +3591,7 @@ main_loop: DISPATCH(); } - case TARGET(MAKE_FUNCTION): { + case TARGET(MAKE_FUNCTION): { PyObject *qualname = POP(); PyObject *codeobj = POP(); PyFunctionObject *func = (PyFunctionObject *) @@ -3624,7 +3624,7 @@ main_loop: DISPATCH(); } - case TARGET(BUILD_SLICE): { + case TARGET(BUILD_SLICE): { PyObject *start, *stop, *step, *slice; if (oparg == 3) step = POP(); @@ -3642,7 +3642,7 @@ main_loop: DISPATCH(); } - case TARGET(FORMAT_VALUE): { + case TARGET(FORMAT_VALUE): { /* Handles f-string value formatting. */ PyObject *result; PyObject *fmt_spec; @@ -3656,15 +3656,15 @@ main_loop: /* See if any conversion is specified. */ switch (which_conversion) { - case FVC_NONE: conv_fn = NULL; break; + case FVC_NONE: conv_fn = NULL; break; case FVC_STR: conv_fn = PyObject_Str; break; case FVC_REPR: conv_fn = PyObject_Repr; break; case FVC_ASCII: conv_fn = PyObject_ASCII; break; - default: - _PyErr_Format(tstate, PyExc_SystemError, - "unexpected conversion flag %d", - which_conversion); - goto error; + default: + _PyErr_Format(tstate, PyExc_SystemError, + "unexpected conversion flag %d", + which_conversion); + goto error; } /* If there's a conversion function, call it and replace @@ -3702,7 +3702,7 @@ main_loop: DISPATCH(); } - case TARGET(EXTENDED_ARG): { + case TARGET(EXTENDED_ARG): { int oldoparg = oparg; NEXTOPARG(); oparg |= oldoparg << 8; @@ -3718,7 +3718,7 @@ main_loop: "XXX lineno: %d, opcode: %d\n", PyFrame_GetLineNumber(f), opcode); - _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); + _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); goto error; } /* switch */ @@ -3730,12 +3730,12 @@ main_loop: error: /* Double-check exception status. */ #ifdef NDEBUG - if (!_PyErr_Occurred(tstate)) { - _PyErr_SetString(tstate, PyExc_SystemError, - "error return without exception set"); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_SetString(tstate, PyExc_SystemError, + "error return without exception set"); + } #else - assert(_PyErr_Occurred(tstate)); + assert(_PyErr_Occurred(tstate)); #endif /* Log traceback info. */ @@ -3745,18 +3745,18 @@ error: call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); -exception_unwind: - /* Unwind stacks if an exception occurred */ - while (f->f_iblock > 0) { - /* Pop the current block. */ - PyTryBlock *b = &f->f_blockstack[--f->f_iblock]; +exception_unwind: + /* Unwind stacks if an exception occurred */ + while (f->f_iblock > 0) { + /* Pop the current block. */ + PyTryBlock *b = &f->f_blockstack[--f->f_iblock]; if (b->b_type == EXCEPT_HANDLER) { UNWIND_EXCEPT_HANDLER(b); continue; } UNWIND_BLOCK(b); - if (b->b_type == SETUP_FINALLY) { + if (b->b_type == SETUP_FINALLY) { PyObject *exc, *val, *tb; int handler = b->b_handler; _PyErr_StackItem *exc_info = tstate->exc_info; @@ -3771,12 +3771,12 @@ exception_unwind: Py_INCREF(Py_None); PUSH(Py_None); } - _PyErr_Fetch(tstate, &exc, &val, &tb); + _PyErr_Fetch(tstate, &exc, &val, &tb); /* Make the raw exception data available to the handler, so a program can emulate the Python main loop. */ - _PyErr_NormalizeException(tstate, &exc, &val, &tb); + _PyErr_NormalizeException(tstate, &exc, &val, &tb); if (tb != NULL) PyException_SetTraceback(val, tb); else @@ -3793,27 +3793,27 @@ exception_unwind: PUSH(val); PUSH(exc); JUMPTO(handler); - if (_Py_TracingPossible(ceval2)) { - int needs_new_execution_window = (f->f_lasti < instr_lb || f->f_lasti >= instr_ub); - int needs_line_update = (f->f_lasti == instr_lb || f->f_lasti < instr_prev); - /* Make sure that we trace line after exception if we are in a new execution - * window or we don't need a line update and we are not in the first instruction - * of the line. */ - if (needs_new_execution_window || (!needs_line_update && instr_lb > 0)) { - instr_prev = INT_MAX; - } - } - /* Resume normal execution */ - goto main_loop; + if (_Py_TracingPossible(ceval2)) { + int needs_new_execution_window = (f->f_lasti < instr_lb || f->f_lasti >= instr_ub); + int needs_line_update = (f->f_lasti == instr_lb || f->f_lasti < instr_prev); + /* Make sure that we trace line after exception if we are in a new execution + * window or we don't need a line update and we are not in the first instruction + * of the line. */ + if (needs_new_execution_window || (!needs_line_update && instr_lb > 0)) { + instr_prev = INT_MAX; + } + } + /* Resume normal execution */ + goto main_loop; } } /* unwind stack */ - /* End the loop as we still have an error */ - break; - } /* main loop */ + /* End the loop as we still have an error */ + break; + } /* main loop */ - assert(retval == NULL); - assert(_PyErr_Occurred(tstate)); + assert(retval == NULL); + assert(_PyErr_Occurred(tstate)); /* Pop remaining stack entries. */ while (!EMPTY()) { @@ -3821,17 +3821,17 @@ exception_unwind: Py_XDECREF(o); } -exiting: +exiting: if (tstate->use_tracing) { if (tstate->c_tracefunc) { - if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, - tstate, f, PyTrace_RETURN, retval)) { - Py_CLEAR(retval); + if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, + tstate, f, PyTrace_RETURN, retval)) { + Py_CLEAR(retval); } } if (tstate->c_profilefunc) { - if (call_trace_protected(tstate->c_profilefunc, tstate->c_profileobj, - tstate, f, PyTrace_RETURN, retval)) { + if (call_trace_protected(tstate->c_profilefunc, tstate->c_profileobj, + tstate, f, PyTrace_RETURN, retval)) { Py_CLEAR(retval); } } @@ -3841,16 +3841,16 @@ exiting: exit_eval_frame: if (PyDTrace_FUNCTION_RETURN_ENABLED()) dtrace_function_return(f); - _Py_LeaveRecursiveCall(tstate); + _Py_LeaveRecursiveCall(tstate); f->f_executing = 0; tstate->frame = f->f_back; - return _Py_CheckFunctionResult(tstate, NULL, retval, __func__); + return _Py_CheckFunctionResult(tstate, NULL, retval, __func__); } static void -format_missing(PyThreadState *tstate, const char *kind, - PyCodeObject *co, PyObject *names) +format_missing(PyThreadState *tstate, const char *kind, + PyCodeObject *co, PyObject *names) { int err; Py_ssize_t len = PyList_GET_SIZE(names); @@ -3901,19 +3901,19 @@ format_missing(PyThreadState *tstate, const char *kind, } if (name_str == NULL) return; - _PyErr_Format(tstate, PyExc_TypeError, - "%U() missing %i required %s argument%s: %U", - co->co_name, - len, - kind, - len == 1 ? "" : "s", - name_str); + _PyErr_Format(tstate, PyExc_TypeError, + "%U() missing %i required %s argument%s: %U", + co->co_name, + len, + kind, + len == 1 ? "" : "s", + name_str); Py_DECREF(name_str); } static void -missing_arguments(PyThreadState *tstate, PyCodeObject *co, - Py_ssize_t missing, Py_ssize_t defcount, +missing_arguments(PyThreadState *tstate, PyCodeObject *co, + Py_ssize_t missing, Py_ssize_t defcount, PyObject **fastlocals) { Py_ssize_t i, j = 0; @@ -3946,13 +3946,13 @@ missing_arguments(PyThreadState *tstate, PyCodeObject *co, } } assert(j == missing); - format_missing(tstate, kind, co, missing_names); + format_missing(tstate, kind, co, missing_names); Py_DECREF(missing_names); } static void -too_many_positional(PyThreadState *tstate, PyCodeObject *co, - Py_ssize_t given, Py_ssize_t defcount, +too_many_positional(PyThreadState *tstate, PyCodeObject *co, + Py_ssize_t given, Py_ssize_t defcount, PyObject **fastlocals) { int plural; @@ -3995,86 +3995,86 @@ too_many_positional(PyThreadState *tstate, PyCodeObject *co, kwonly_sig = PyUnicode_FromString(""); assert(kwonly_sig != NULL); } - _PyErr_Format(tstate, PyExc_TypeError, - "%U() takes %U positional argument%s but %zd%U %s given", - co->co_name, - sig, - plural ? "s" : "", - given, - kwonly_sig, - given == 1 && !kwonly_given ? "was" : "were"); + _PyErr_Format(tstate, PyExc_TypeError, + "%U() takes %U positional argument%s but %zd%U %s given", + co->co_name, + sig, + plural ? "s" : "", + given, + kwonly_sig, + given == 1 && !kwonly_given ? "was" : "were"); Py_DECREF(sig); Py_DECREF(kwonly_sig); } -static int -positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co, - Py_ssize_t kwcount, PyObject* const* kwnames) -{ - int posonly_conflicts = 0; - PyObject* posonly_names = PyList_New(0); - - for(int k=0; k < co->co_posonlyargcount; k++){ - PyObject* posonly_name = PyTuple_GET_ITEM(co->co_varnames, k); - - for (int k2=0; k2<kwcount; k2++){ - /* Compare the pointers first and fallback to PyObject_RichCompareBool*/ - PyObject* kwname = kwnames[k2]; - if (kwname == posonly_name){ - if(PyList_Append(posonly_names, kwname) != 0) { - goto fail; - } - posonly_conflicts++; - continue; - } - - int cmp = PyObject_RichCompareBool(posonly_name, kwname, Py_EQ); - - if ( cmp > 0) { - if(PyList_Append(posonly_names, kwname) != 0) { - goto fail; - } - posonly_conflicts++; - } else if (cmp < 0) { - goto fail; - } - - } - } - if (posonly_conflicts) { - PyObject* comma = PyUnicode_FromString(", "); - if (comma == NULL) { - goto fail; - } - PyObject* error_names = PyUnicode_Join(comma, posonly_names); - Py_DECREF(comma); - if (error_names == NULL) { - goto fail; - } - _PyErr_Format(tstate, PyExc_TypeError, - "%U() got some positional-only arguments passed" - " as keyword arguments: '%U'", - co->co_name, error_names); - Py_DECREF(error_names); - goto fail; - } - - Py_DECREF(posonly_names); - return 0; - -fail: - Py_XDECREF(posonly_names); - return 1; - -} - +static int +positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co, + Py_ssize_t kwcount, PyObject* const* kwnames) +{ + int posonly_conflicts = 0; + PyObject* posonly_names = PyList_New(0); + + for(int k=0; k < co->co_posonlyargcount; k++){ + PyObject* posonly_name = PyTuple_GET_ITEM(co->co_varnames, k); + + for (int k2=0; k2<kwcount; k2++){ + /* Compare the pointers first and fallback to PyObject_RichCompareBool*/ + PyObject* kwname = kwnames[k2]; + if (kwname == posonly_name){ + if(PyList_Append(posonly_names, kwname) != 0) { + goto fail; + } + posonly_conflicts++; + continue; + } + + int cmp = PyObject_RichCompareBool(posonly_name, kwname, Py_EQ); + + if ( cmp > 0) { + if(PyList_Append(posonly_names, kwname) != 0) { + goto fail; + } + posonly_conflicts++; + } else if (cmp < 0) { + goto fail; + } + + } + } + if (posonly_conflicts) { + PyObject* comma = PyUnicode_FromString(", "); + if (comma == NULL) { + goto fail; + } + PyObject* error_names = PyUnicode_Join(comma, posonly_names); + Py_DECREF(comma); + if (error_names == NULL) { + goto fail; + } + _PyErr_Format(tstate, PyExc_TypeError, + "%U() got some positional-only arguments passed" + " as keyword arguments: '%U'", + co->co_name, error_names); + Py_DECREF(error_names); + goto fail; + } + + Py_DECREF(posonly_names); + return 0; + +fail: + Py_XDECREF(posonly_names); + return 1; + +} + /* This is gonna seem *real weird*, but if you put some other code between PyEval_EvalFrame() and _PyEval_EvalFrameDefault() you will need to adjust the test in the if statements in Misc/gdbinit (pystack and pystackv). */ PyObject * -_PyEval_EvalCode(PyThreadState *tstate, - PyObject *_co, PyObject *globals, PyObject *locals, +_PyEval_EvalCode(PyThreadState *tstate, + PyObject *_co, PyObject *globals, PyObject *locals, PyObject *const *args, Py_ssize_t argcount, PyObject *const *kwnames, PyObject *const *kwargs, Py_ssize_t kwcount, int kwstep, @@ -4082,20 +4082,20 @@ _PyEval_EvalCode(PyThreadState *tstate, PyObject *kwdefs, PyObject *closure, PyObject *name, PyObject *qualname) { - assert(is_tstate_valid(tstate)); - + assert(is_tstate_valid(tstate)); + PyCodeObject* co = (PyCodeObject*)_co; PyFrameObject *f; PyObject *retval = NULL; PyObject **fastlocals, **freevars; PyObject *x, *u; const Py_ssize_t total_args = co->co_argcount + co->co_kwonlyargcount; - Py_ssize_t i, j, n; + Py_ssize_t i, j, n; PyObject *kwdict; if (globals == NULL) { - _PyErr_SetString(tstate, PyExc_SystemError, - "PyEval_EvalCodeEx: NULL globals"); + _PyErr_SetString(tstate, PyExc_SystemError, + "PyEval_EvalCodeEx: NULL globals"); return NULL; } @@ -4122,22 +4122,22 @@ _PyEval_EvalCode(PyThreadState *tstate, kwdict = NULL; } - /* Copy all positional arguments into local variables */ + /* Copy all positional arguments into local variables */ if (argcount > co->co_argcount) { n = co->co_argcount; } else { n = argcount; } - for (j = 0; j < n; j++) { - x = args[j]; + for (j = 0; j < n; j++) { + x = args[j]; Py_INCREF(x); - SETLOCAL(j, x); + SETLOCAL(j, x); } /* Pack other positional arguments into the *args argument */ if (co->co_flags & CO_VARARGS) { - u = _PyTuple_FromArray(args + n, argcount - n); + u = _PyTuple_FromArray(args + n, argcount - n); if (u == NULL) { goto fail; } @@ -4153,16 +4153,16 @@ _PyEval_EvalCode(PyThreadState *tstate, Py_ssize_t j; if (keyword == NULL || !PyUnicode_Check(keyword)) { - _PyErr_Format(tstate, PyExc_TypeError, - "%U() keywords must be strings", - co->co_name); + _PyErr_Format(tstate, PyExc_TypeError, + "%U() keywords must be strings", + co->co_name); goto fail; } /* Speed hack: do raw pointer compares. As names are normally interned this should almost always hit. */ co_varnames = ((PyTupleObject *)(co->co_varnames))->ob_item; - for (j = co->co_posonlyargcount; j < total_args; j++) { + for (j = co->co_posonlyargcount; j < total_args; j++) { PyObject *name = co_varnames[j]; if (name == keyword) { goto kw_found; @@ -4170,7 +4170,7 @@ _PyEval_EvalCode(PyThreadState *tstate, } /* Slow fallback, just in case */ - for (j = co->co_posonlyargcount; j < total_args; j++) { + for (j = co->co_posonlyargcount; j < total_args; j++) { PyObject *name = co_varnames[j]; int cmp = PyObject_RichCompareBool( keyword, name, Py_EQ); if (cmp > 0) { @@ -4183,17 +4183,17 @@ _PyEval_EvalCode(PyThreadState *tstate, assert(j >= total_args); if (kwdict == NULL) { - - if (co->co_posonlyargcount - && positional_only_passed_as_keyword(tstate, co, - kwcount, kwnames)) - { - goto fail; - } - - _PyErr_Format(tstate, PyExc_TypeError, - "%U() got an unexpected keyword argument '%S'", - co->co_name, keyword); + + if (co->co_posonlyargcount + && positional_only_passed_as_keyword(tstate, co, + kwcount, kwnames)) + { + goto fail; + } + + _PyErr_Format(tstate, PyExc_TypeError, + "%U() got an unexpected keyword argument '%S'", + co->co_name, keyword); goto fail; } @@ -4204,9 +4204,9 @@ _PyEval_EvalCode(PyThreadState *tstate, kw_found: if (GETLOCAL(j) != NULL) { - _PyErr_Format(tstate, PyExc_TypeError, - "%U() got multiple values for argument '%S'", - co->co_name, keyword); + _PyErr_Format(tstate, PyExc_TypeError, + "%U() got multiple values for argument '%S'", + co->co_name, keyword); goto fail; } Py_INCREF(value); @@ -4214,8 +4214,8 @@ _PyEval_EvalCode(PyThreadState *tstate, } /* Check the number of positional arguments */ - if ((argcount > co->co_argcount) && !(co->co_flags & CO_VARARGS)) { - too_many_positional(tstate, co, argcount, defcount, fastlocals); + if ((argcount > co->co_argcount) && !(co->co_flags & CO_VARARGS)) { + too_many_positional(tstate, co, argcount, defcount, fastlocals); goto fail; } @@ -4229,7 +4229,7 @@ _PyEval_EvalCode(PyThreadState *tstate, } } if (missing) { - missing_arguments(tstate, co, missing, defcount, fastlocals); + missing_arguments(tstate, co, missing, defcount, fastlocals); goto fail; } if (n > m) @@ -4254,20 +4254,20 @@ _PyEval_EvalCode(PyThreadState *tstate, continue; name = PyTuple_GET_ITEM(co->co_varnames, i); if (kwdefs != NULL) { - PyObject *def = PyDict_GetItemWithError(kwdefs, name); + PyObject *def = PyDict_GetItemWithError(kwdefs, name); if (def) { Py_INCREF(def); SETLOCAL(i, def); continue; } - else if (_PyErr_Occurred(tstate)) { - goto fail; - } + else if (_PyErr_Occurred(tstate)) { + goto fail; + } } missing++; } if (missing) { - missing_arguments(tstate, co, missing, -1, fastlocals); + missing_arguments(tstate, co, missing, -1, fastlocals); goto fail; } } @@ -4326,7 +4326,7 @@ _PyEval_EvalCode(PyThreadState *tstate, return gen; } - retval = _PyEval_EvalFrame(tstate, f, 0); + retval = _PyEval_EvalFrame(tstate, f, 0); fail: /* Jump here from prelude on failure */ @@ -4347,27 +4347,27 @@ fail: /* Jump here from prelude on failure */ return retval; } - + +PyObject * +_PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, + PyObject *const *args, Py_ssize_t argcount, + PyObject *const *kwnames, PyObject *const *kwargs, + Py_ssize_t kwcount, int kwstep, + PyObject *const *defs, Py_ssize_t defcount, + PyObject *kwdefs, PyObject *closure, + PyObject *name, PyObject *qualname) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return _PyEval_EvalCode(tstate, _co, globals, locals, + args, argcount, + kwnames, kwargs, + kwcount, kwstep, + defs, defcount, + kwdefs, closure, + name, qualname); +} + PyObject * -_PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, - PyObject *const *args, Py_ssize_t argcount, - PyObject *const *kwnames, PyObject *const *kwargs, - Py_ssize_t kwcount, int kwstep, - PyObject *const *defs, Py_ssize_t defcount, - PyObject *kwdefs, PyObject *closure, - PyObject *name, PyObject *qualname) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return _PyEval_EvalCode(tstate, _co, globals, locals, - args, argcount, - kwnames, kwargs, - kwcount, kwstep, - defs, defcount, - kwdefs, closure, - name, qualname); -} - -PyObject * PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, PyObject *const *args, int argcount, PyObject *const *kws, int kwcount, @@ -4384,12 +4384,12 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, } static PyObject * -special_lookup(PyThreadState *tstate, PyObject *o, _Py_Identifier *id) +special_lookup(PyThreadState *tstate, PyObject *o, _Py_Identifier *id) { PyObject *res; res = _PyObject_LookupSpecial(o, id); - if (res == NULL && !_PyErr_Occurred(tstate)) { - _PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(id)); + if (res == NULL && !_PyErr_Occurred(tstate)) { + _PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(id)); return NULL; } return res; @@ -4399,7 +4399,7 @@ special_lookup(PyThreadState *tstate, PyObject *o, _Py_Identifier *id) /* Logic for the raise statement (too complicated for inlining). This *consumes* a reference count to each of its arguments. */ static int -do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) +do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) { PyObject *type = NULL, *value = NULL; @@ -4411,14 +4411,14 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) value = exc_info->exc_value; tb = exc_info->exc_traceback; if (type == Py_None || type == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "No active exception to reraise"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "No active exception to reraise"); return 0; } Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); - _PyErr_Restore(tstate, type, value, tb); + _PyErr_Restore(tstate, type, value, tb); return 1; } @@ -4433,11 +4433,11 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) if (value == NULL) goto raise_error; if (!PyExceptionInstance_Check(value)) { - _PyErr_Format(tstate, PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto raise_error; + _PyErr_Format(tstate, PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto raise_error; } } else if (PyExceptionInstance_Check(exc)) { @@ -4449,8 +4449,8 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) /* Not something you can raise. You get an exception anyway, just not what you specified :-) */ Py_DECREF(exc); - _PyErr_SetString(tstate, PyExc_TypeError, - "exceptions must derive from BaseException"); + _PyErr_SetString(tstate, PyExc_TypeError, + "exceptions must derive from BaseException"); goto raise_error; } @@ -4473,16 +4473,16 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause) fixed_cause = NULL; } else { - _PyErr_SetString(tstate, PyExc_TypeError, - "exception causes must derive from " - "BaseException"); + _PyErr_SetString(tstate, PyExc_TypeError, + "exception causes must derive from " + "BaseException"); goto raise_error; } PyException_SetCause(value, fixed_cause); } - _PyErr_SetObject(tstate, type, value); - /* _PyErr_SetObject incref's its arguments */ + _PyErr_SetObject(tstate, type, value); + /* _PyErr_SetObject incref's its arguments */ Py_DECREF(value); Py_DECREF(type); return 0; @@ -4502,8 +4502,8 @@ raise_error: */ static int -unpack_iterable(PyThreadState *tstate, PyObject *v, - int argcnt, int argcntafter, PyObject **sp) +unpack_iterable(PyThreadState *tstate, PyObject *v, + int argcnt, int argcntafter, PyObject **sp) { int i = 0, j = 0; Py_ssize_t ll = 0; @@ -4515,12 +4515,12 @@ unpack_iterable(PyThreadState *tstate, PyObject *v, it = PyObject_GetIter(v); if (it == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && - Py_TYPE(v)->tp_iter == NULL && !PySequence_Check(v)) + if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && + Py_TYPE(v)->tp_iter == NULL && !PySequence_Check(v)) { - _PyErr_Format(tstate, PyExc_TypeError, - "cannot unpack non-iterable %.200s object", - Py_TYPE(v)->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "cannot unpack non-iterable %.200s object", + Py_TYPE(v)->tp_name); } return 0; } @@ -4529,18 +4529,18 @@ unpack_iterable(PyThreadState *tstate, PyObject *v, w = PyIter_Next(it); if (w == NULL) { /* Iterator done, via error or exhaustion. */ - if (!_PyErr_Occurred(tstate)) { + if (!_PyErr_Occurred(tstate)) { if (argcntafter == -1) { - _PyErr_Format(tstate, PyExc_ValueError, - "not enough values to unpack " - "(expected %d, got %d)", - argcnt, i); + _PyErr_Format(tstate, PyExc_ValueError, + "not enough values to unpack " + "(expected %d, got %d)", + argcnt, i); } else { - _PyErr_Format(tstate, PyExc_ValueError, - "not enough values to unpack " - "(expected at least %d, got %d)", - argcnt + argcntafter, i); + _PyErr_Format(tstate, PyExc_ValueError, + "not enough values to unpack " + "(expected at least %d, got %d)", + argcnt + argcntafter, i); } } goto Error; @@ -4552,15 +4552,15 @@ unpack_iterable(PyThreadState *tstate, PyObject *v, /* We better have exhausted the iterator now. */ w = PyIter_Next(it); if (w == NULL) { - if (_PyErr_Occurred(tstate)) + if (_PyErr_Occurred(tstate)) goto Error; Py_DECREF(it); return 1; } Py_DECREF(w); - _PyErr_Format(tstate, PyExc_ValueError, - "too many values to unpack (expected %d)", - argcnt); + _PyErr_Format(tstate, PyExc_ValueError, + "too many values to unpack (expected %d)", + argcnt); goto Error; } @@ -4572,7 +4572,7 @@ unpack_iterable(PyThreadState *tstate, PyObject *v, ll = PyList_GET_SIZE(l); if (ll < argcntafter) { - _PyErr_Format(tstate, PyExc_ValueError, + _PyErr_Format(tstate, PyExc_ValueError, "not enough values to unpack (expected at least %d, got %zd)", argcnt + argcntafter, argcnt + ll); goto Error; @@ -4583,7 +4583,7 @@ unpack_iterable(PyThreadState *tstate, PyObject *v, *--sp = PyList_GET_ITEM(l, ll - j); } /* Resize the list. */ - Py_SET_SIZE(l, ll - argcntafter); + Py_SET_SIZE(l, ll - argcntafter); Py_DECREF(it); return 1; @@ -4597,17 +4597,17 @@ Error: #ifdef LLTRACE static int -prtrace(PyThreadState *tstate, PyObject *v, const char *str) +prtrace(PyThreadState *tstate, PyObject *v, const char *str) { printf("%s ", str); - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - if (PyObject_Print(v, stdout, 0) != 0) { - /* Don't know what else to do */ - _PyErr_Clear(tstate); - } + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (PyObject_Print(v, stdout, 0) != 0) { + /* Don't know what else to do */ + _PyErr_Clear(tstate); + } printf("\n"); - PyErr_Restore(type, value, traceback); + PyErr_Restore(type, value, traceback); return 1; } #endif @@ -4618,23 +4618,23 @@ call_exc_trace(Py_tracefunc func, PyObject *self, { PyObject *type, *value, *traceback, *orig_traceback, *arg; int err; - _PyErr_Fetch(tstate, &type, &value, &orig_traceback); + _PyErr_Fetch(tstate, &type, &value, &orig_traceback); if (value == NULL) { value = Py_None; Py_INCREF(value); } - _PyErr_NormalizeException(tstate, &type, &value, &orig_traceback); + _PyErr_NormalizeException(tstate, &type, &value, &orig_traceback); traceback = (orig_traceback != NULL) ? orig_traceback : Py_None; arg = PyTuple_Pack(3, type, value, traceback); if (arg == NULL) { - _PyErr_Restore(tstate, type, value, orig_traceback); + _PyErr_Restore(tstate, type, value, orig_traceback); return; } err = call_trace(func, self, tstate, f, PyTrace_EXCEPTION, arg); Py_DECREF(arg); - if (err == 0) { - _PyErr_Restore(tstate, type, value, orig_traceback); - } + if (err == 0) { + _PyErr_Restore(tstate, type, value, orig_traceback); + } else { Py_XDECREF(type); Py_XDECREF(value); @@ -4649,11 +4649,11 @@ call_trace_protected(Py_tracefunc func, PyObject *obj, { PyObject *type, *value, *traceback; int err; - _PyErr_Fetch(tstate, &type, &value, &traceback); + _PyErr_Fetch(tstate, &type, &value, &traceback); err = call_trace(func, obj, tstate, frame, what, arg); if (err == 0) { - _PyErr_Restore(tstate, type, value, traceback); + _PyErr_Restore(tstate, type, value, traceback); return 0; } else { @@ -4684,7 +4684,7 @@ call_trace(Py_tracefunc func, PyObject *obj, PyObject * _PyEval_CallTracing(PyObject *func, PyObject *args) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int save_tracing = tstate->tracing; int save_use_tracing = tstate->use_tracing; PyObject *result; @@ -4735,96 +4735,96 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj, return result; } -int -_PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg) +int +_PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg) { - assert(is_tstate_valid(tstate)); - /* The caller must hold the GIL */ - assert(PyGILState_Check()); - - /* Call _PySys_Audit() in the context of the current thread state, - even if tstate is not the current thread state. */ - PyThreadState *current_tstate = _PyThreadState_GET(); - if (_PySys_Audit(current_tstate, "sys.setprofile", NULL) < 0) { - return -1; - } - - PyObject *profileobj = tstate->c_profileobj; - + assert(is_tstate_valid(tstate)); + /* The caller must hold the GIL */ + assert(PyGILState_Check()); + + /* Call _PySys_Audit() in the context of the current thread state, + even if tstate is not the current thread state. */ + PyThreadState *current_tstate = _PyThreadState_GET(); + if (_PySys_Audit(current_tstate, "sys.setprofile", NULL) < 0) { + return -1; + } + + PyObject *profileobj = tstate->c_profileobj; + tstate->c_profilefunc = NULL; tstate->c_profileobj = NULL; - /* Must make sure that tracing is not ignored if 'profileobj' is freed */ + /* Must make sure that tracing is not ignored if 'profileobj' is freed */ tstate->use_tracing = tstate->c_tracefunc != NULL; - Py_XDECREF(profileobj); - - Py_XINCREF(arg); - tstate->c_profileobj = arg; + Py_XDECREF(profileobj); + + Py_XINCREF(arg); + tstate->c_profileobj = arg; tstate->c_profilefunc = func; - + /* Flag that tracing or profiling is turned on */ tstate->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL); - return 0; + return 0; } void -PyEval_SetProfile(Py_tracefunc func, PyObject *arg) +PyEval_SetProfile(Py_tracefunc func, PyObject *arg) { - PyThreadState *tstate = _PyThreadState_GET(); - if (_PyEval_SetProfile(tstate, func, arg) < 0) { - /* Log _PySys_Audit() error */ - _PyErr_WriteUnraisableMsg("in PyEval_SetProfile", NULL); - } -} - -int -_PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg) -{ - assert(is_tstate_valid(tstate)); - /* The caller must hold the GIL */ - assert(PyGILState_Check()); - - /* Call _PySys_Audit() in the context of the current thread state, - even if tstate is not the current thread state. */ - PyThreadState *current_tstate = _PyThreadState_GET(); - if (_PySys_Audit(current_tstate, "sys.settrace", NULL) < 0) { - return -1; - } - - struct _ceval_state *ceval2 = &tstate->interp->ceval; - PyObject *traceobj = tstate->c_traceobj; - ceval2->tracing_possible += (func != NULL) - (tstate->c_tracefunc != NULL); - + PyThreadState *tstate = _PyThreadState_GET(); + if (_PyEval_SetProfile(tstate, func, arg) < 0) { + /* Log _PySys_Audit() error */ + _PyErr_WriteUnraisableMsg("in PyEval_SetProfile", NULL); + } +} + +int +_PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg) +{ + assert(is_tstate_valid(tstate)); + /* The caller must hold the GIL */ + assert(PyGILState_Check()); + + /* Call _PySys_Audit() in the context of the current thread state, + even if tstate is not the current thread state. */ + PyThreadState *current_tstate = _PyThreadState_GET(); + if (_PySys_Audit(current_tstate, "sys.settrace", NULL) < 0) { + return -1; + } + + struct _ceval_state *ceval2 = &tstate->interp->ceval; + PyObject *traceobj = tstate->c_traceobj; + ceval2->tracing_possible += (func != NULL) - (tstate->c_tracefunc != NULL); + tstate->c_tracefunc = NULL; tstate->c_traceobj = NULL; - /* Must make sure that profiling is not ignored if 'traceobj' is freed */ - tstate->use_tracing = (tstate->c_profilefunc != NULL); - Py_XDECREF(traceobj); - - Py_XINCREF(arg); - tstate->c_traceobj = arg; + /* Must make sure that profiling is not ignored if 'traceobj' is freed */ + tstate->use_tracing = (tstate->c_profilefunc != NULL); + Py_XDECREF(traceobj); + + Py_XINCREF(arg); + tstate->c_traceobj = arg; tstate->c_tracefunc = func; - + /* Flag that tracing or profiling is turned on */ tstate->use_tracing = ((func != NULL) || (tstate->c_profilefunc != NULL)); - - return 0; + + return 0; +} + +void +PyEval_SetTrace(Py_tracefunc func, PyObject *arg) +{ + PyThreadState *tstate = _PyThreadState_GET(); + if (_PyEval_SetTrace(tstate, func, arg) < 0) { + /* Log _PySys_Audit() error */ + _PyErr_WriteUnraisableMsg("in PyEval_SetTrace", NULL); + } } + void -PyEval_SetTrace(Py_tracefunc func, PyObject *arg) +_PyEval_SetCoroutineOriginTrackingDepth(PyThreadState *tstate, int new_depth) { - PyThreadState *tstate = _PyThreadState_GET(); - if (_PyEval_SetTrace(tstate, func, arg) < 0) { - /* Log _PySys_Audit() error */ - _PyErr_WriteUnraisableMsg("in PyEval_SetTrace", NULL); - } -} - - -void -_PyEval_SetCoroutineOriginTrackingDepth(PyThreadState *tstate, int new_depth) -{ assert(new_depth >= 0); tstate->coroutine_origin_tracking_depth = new_depth; } @@ -4832,66 +4832,66 @@ _PyEval_SetCoroutineOriginTrackingDepth(PyThreadState *tstate, int new_depth) int _PyEval_GetCoroutineOriginTrackingDepth(void) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate->coroutine_origin_tracking_depth; } -int -_PyEval_SetAsyncGenFirstiter(PyObject *firstiter) -{ - PyThreadState *tstate = _PyThreadState_GET(); - - if (_PySys_Audit(tstate, "sys.set_asyncgen_hook_firstiter", NULL) < 0) { - return -1; - } - - Py_XINCREF(firstiter); - Py_XSETREF(tstate->async_gen_firstiter, firstiter); - return 0; -} - +int +_PyEval_SetAsyncGenFirstiter(PyObject *firstiter) +{ + PyThreadState *tstate = _PyThreadState_GET(); + + if (_PySys_Audit(tstate, "sys.set_asyncgen_hook_firstiter", NULL) < 0) { + return -1; + } + + Py_XINCREF(firstiter); + Py_XSETREF(tstate->async_gen_firstiter, firstiter); + return 0; +} + PyObject * -_PyEval_GetAsyncGenFirstiter(void) +_PyEval_GetAsyncGenFirstiter(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return tstate->async_gen_firstiter; + PyThreadState *tstate = _PyThreadState_GET(); + return tstate->async_gen_firstiter; +} + +int +_PyEval_SetAsyncGenFinalizer(PyObject *finalizer) +{ + PyThreadState *tstate = _PyThreadState_GET(); + + if (_PySys_Audit(tstate, "sys.set_asyncgen_hook_finalizer", NULL) < 0) { + return -1; + } + + Py_XINCREF(finalizer); + Py_XSETREF(tstate->async_gen_finalizer, finalizer); + return 0; } -int -_PyEval_SetAsyncGenFinalizer(PyObject *finalizer) -{ - PyThreadState *tstate = _PyThreadState_GET(); - - if (_PySys_Audit(tstate, "sys.set_asyncgen_hook_finalizer", NULL) < 0) { - return -1; - } - - Py_XINCREF(finalizer); - Py_XSETREF(tstate->async_gen_finalizer, finalizer); - return 0; -} - PyObject * -_PyEval_GetAsyncGenFinalizer(void) +_PyEval_GetAsyncGenFinalizer(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return tstate->async_gen_finalizer; + PyThreadState *tstate = _PyThreadState_GET(); + return tstate->async_gen_finalizer; } -PyFrameObject * -PyEval_GetFrame(void) +PyFrameObject * +PyEval_GetFrame(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return tstate->frame; + PyThreadState *tstate = _PyThreadState_GET(); + return tstate->frame; } PyObject * PyEval_GetBuiltins(void) { - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *current_frame = tstate->frame; + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *current_frame = tstate->frame; if (current_frame == NULL) - return tstate->interp->builtins; + return tstate->interp->builtins; else return current_frame->f_builtins; } @@ -4900,13 +4900,13 @@ PyEval_GetBuiltins(void) PyObject * _PyEval_GetBuiltinId(_Py_Identifier *name) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *attr = _PyDict_GetItemIdWithError(PyEval_GetBuiltins(), name); if (attr) { Py_INCREF(attr); } - else if (!_PyErr_Occurred(tstate)) { - _PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(name)); + else if (!_PyErr_Occurred(tstate)) { + _PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(name)); } return attr; } @@ -4914,16 +4914,16 @@ _PyEval_GetBuiltinId(_Py_Identifier *name) PyObject * PyEval_GetLocals(void) { - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *current_frame = tstate->frame; + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *current_frame = tstate->frame; if (current_frame == NULL) { - _PyErr_SetString(tstate, PyExc_SystemError, "frame does not exist"); + _PyErr_SetString(tstate, PyExc_SystemError, "frame does not exist"); return NULL; } - if (PyFrame_FastToLocalsWithError(current_frame) < 0) { + if (PyFrame_FastToLocalsWithError(current_frame) < 0) { return NULL; - } + } assert(current_frame->f_locals != NULL); return current_frame->f_locals; @@ -4932,11 +4932,11 @@ PyEval_GetLocals(void) PyObject * PyEval_GetGlobals(void) { - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *current_frame = tstate->frame; - if (current_frame == NULL) { + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *current_frame = tstate->frame; + if (current_frame == NULL) { return NULL; - } + } assert(current_frame->f_globals != NULL); return current_frame->f_globals; @@ -4945,8 +4945,8 @@ PyEval_GetGlobals(void) int PyEval_MergeCompilerFlags(PyCompilerFlags *cf) { - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *current_frame = tstate->frame; + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *current_frame = tstate->frame; int result = cf->cf_flags != 0; if (current_frame != NULL) { @@ -4977,7 +4977,7 @@ PyEval_GetFuncName(PyObject *func) else if (PyCFunction_Check(func)) return ((PyCFunctionObject*)func)->m_ml->ml_name; else - return Py_TYPE(func)->tp_name; + return Py_TYPE(func)->tp_name; } const char * @@ -5024,44 +5024,44 @@ if (tstate->use_tracing && tstate->c_profilefunc) { \ x = call; \ } - -static PyObject * -trace_call_function(PyThreadState *tstate, - PyObject *func, - PyObject **args, Py_ssize_t nargs, - PyObject *kwnames) -{ - PyObject *x; - if (PyCFunction_CheckExact(func) || PyCMethod_CheckExact(func)) { - C_TRACE(x, PyObject_Vectorcall(func, args, nargs, kwnames)); - return x; - } - else if (Py_IS_TYPE(func, &PyMethodDescr_Type) && nargs > 0) { - /* We need to create a temporary bound method as argument - for profiling. - - If nargs == 0, then this cannot work because we have no - "self". In any case, the call itself would raise - TypeError (foo needs an argument), so we just skip - profiling. */ - PyObject *self = args[0]; - func = Py_TYPE(func)->tp_descr_get(func, self, (PyObject*)Py_TYPE(self)); - if (func == NULL) { - return NULL; - } - C_TRACE(x, PyObject_Vectorcall(func, - args+1, nargs-1, - kwnames)); - Py_DECREF(func); - return x; - } - return PyObject_Vectorcall(func, args, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); -} - + +static PyObject * +trace_call_function(PyThreadState *tstate, + PyObject *func, + PyObject **args, Py_ssize_t nargs, + PyObject *kwnames) +{ + PyObject *x; + if (PyCFunction_CheckExact(func) || PyCMethod_CheckExact(func)) { + C_TRACE(x, PyObject_Vectorcall(func, args, nargs, kwnames)); + return x; + } + else if (Py_IS_TYPE(func, &PyMethodDescr_Type) && nargs > 0) { + /* We need to create a temporary bound method as argument + for profiling. + + If nargs == 0, then this cannot work because we have no + "self". In any case, the call itself would raise + TypeError (foo needs an argument), so we just skip + profiling. */ + PyObject *self = args[0]; + func = Py_TYPE(func)->tp_descr_get(func, self, (PyObject*)Py_TYPE(self)); + if (func == NULL) { + return NULL; + } + C_TRACE(x, PyObject_Vectorcall(func, + args+1, nargs-1, + kwnames)); + Py_DECREF(func); + return x; + } + return PyObject_Vectorcall(func, args, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); +} + /* Issue #29227: Inline call_function() into _PyEval_EvalFrameDefault() to reduce the stack consumption. */ Py_LOCAL_INLINE(PyObject *) _Py_HOT_FUNCTION -call_function(PyThreadState *tstate, PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames) +call_function(PyThreadState *tstate, PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames) { PyObject **pfunc = (*pp_stack) - oparg - 1; PyObject *func = *pfunc; @@ -5070,14 +5070,14 @@ call_function(PyThreadState *tstate, PyObject ***pp_stack, Py_ssize_t oparg, PyO Py_ssize_t nargs = oparg - nkwargs; PyObject **stack = (*pp_stack) - nargs - nkwargs; - if (tstate->use_tracing) { - x = trace_call_function(tstate, func, stack, nargs, kwnames); + if (tstate->use_tracing) { + x = trace_call_function(tstate, func, stack, nargs, kwnames); } else { - x = PyObject_Vectorcall(func, stack, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); + x = PyObject_Vectorcall(func, stack, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); } - assert((x != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); + assert((x != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); /* Clear the stack of the function object. */ while ((*pp_stack) > pfunc) { @@ -5089,40 +5089,40 @@ call_function(PyThreadState *tstate, PyObject ***pp_stack, Py_ssize_t oparg, PyO } static PyObject * -do_call_core(PyThreadState *tstate, PyObject *func, PyObject *callargs, PyObject *kwdict) +do_call_core(PyThreadState *tstate, PyObject *func, PyObject *callargs, PyObject *kwdict) { - PyObject *result; - - if (PyCFunction_CheckExact(func) || PyCMethod_CheckExact(func)) { - C_TRACE(result, PyObject_Call(func, callargs, kwdict)); + PyObject *result; + + if (PyCFunction_CheckExact(func) || PyCMethod_CheckExact(func)) { + C_TRACE(result, PyObject_Call(func, callargs, kwdict)); return result; } - else if (Py_IS_TYPE(func, &PyMethodDescr_Type)) { - Py_ssize_t nargs = PyTuple_GET_SIZE(callargs); - if (nargs > 0 && tstate->use_tracing) { - /* We need to create a temporary bound method as argument - for profiling. - - If nargs == 0, then this cannot work because we have no - "self". In any case, the call itself would raise - TypeError (foo needs an argument), so we just skip - profiling. */ - PyObject *self = PyTuple_GET_ITEM(callargs, 0); - func = Py_TYPE(func)->tp_descr_get(func, self, (PyObject*)Py_TYPE(self)); - if (func == NULL) { - return NULL; - } - - C_TRACE(result, _PyObject_FastCallDictTstate( - tstate, func, - &_PyTuple_ITEMS(callargs)[1], - nargs - 1, - kwdict)); - Py_DECREF(func); - return result; - } - } - return PyObject_Call(func, callargs, kwdict); + else if (Py_IS_TYPE(func, &PyMethodDescr_Type)) { + Py_ssize_t nargs = PyTuple_GET_SIZE(callargs); + if (nargs > 0 && tstate->use_tracing) { + /* We need to create a temporary bound method as argument + for profiling. + + If nargs == 0, then this cannot work because we have no + "self". In any case, the call itself would raise + TypeError (foo needs an argument), so we just skip + profiling. */ + PyObject *self = PyTuple_GET_ITEM(callargs, 0); + func = Py_TYPE(func)->tp_descr_get(func, self, (PyObject*)Py_TYPE(self)); + if (func == NULL) { + return NULL; + } + + C_TRACE(result, _PyObject_FastCallDictTstate( + tstate, func, + &_PyTuple_ITEMS(callargs)[1], + nargs - 1, + kwdict)); + Py_DECREF(func); + return result; + } + } + return PyObject_Call(func, callargs, kwdict); } /* Extract a slice index from a PyLong or an object with the @@ -5134,18 +5134,18 @@ do_call_core(PyThreadState *tstate, PyObject *func, PyObject *callargs, PyObject int _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (v != Py_None) { Py_ssize_t x; - if (_PyIndex_Check(v)) { + if (_PyIndex_Check(v)) { x = PyNumber_AsSsize_t(v, NULL); - if (x == -1 && _PyErr_Occurred(tstate)) + if (x == -1 && _PyErr_Occurred(tstate)) return 0; } else { - _PyErr_SetString(tstate, PyExc_TypeError, - "slice indices must be integers or " - "None or have an __index__ method"); + _PyErr_SetString(tstate, PyExc_TypeError, + "slice indices must be integers or " + "None or have an __index__ method"); return 0; } *pi = x; @@ -5156,17 +5156,17 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi) int _PyEval_SliceIndexNotNone(PyObject *v, Py_ssize_t *pi) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); Py_ssize_t x; - if (_PyIndex_Check(v)) { + if (_PyIndex_Check(v)) { x = PyNumber_AsSsize_t(v, NULL); - if (x == -1 && _PyErr_Occurred(tstate)) + if (x == -1 && _PyErr_Occurred(tstate)) return 0; } else { - _PyErr_SetString(tstate, PyExc_TypeError, - "slice indices must be integers or " - "have an __index__ method"); + _PyErr_SetString(tstate, PyExc_TypeError, + "slice indices must be integers or " + "have an __index__ method"); return 0; } *pi = x; @@ -5174,25 +5174,25 @@ _PyEval_SliceIndexNotNone(PyObject *v, Py_ssize_t *pi) } static PyObject * -import_name(PyThreadState *tstate, PyFrameObject *f, - PyObject *name, PyObject *fromlist, PyObject *level) +import_name(PyThreadState *tstate, PyFrameObject *f, + PyObject *name, PyObject *fromlist, PyObject *level) { _Py_IDENTIFIER(__import__); PyObject *import_func, *res; PyObject* stack[5]; - import_func = _PyDict_GetItemIdWithError(f->f_builtins, &PyId___import__); + import_func = _PyDict_GetItemIdWithError(f->f_builtins, &PyId___import__); if (import_func == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_SetString(tstate, PyExc_ImportError, "__import__ not found"); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_SetString(tstate, PyExc_ImportError, "__import__ not found"); + } return NULL; } /* Fast path for not overloaded __import__. */ - if (import_func == tstate->interp->import_func) { + if (import_func == tstate->interp->import_func) { int ilevel = _PyLong_AsInt(level); - if (ilevel == -1 && _PyErr_Occurred(tstate)) { + if (ilevel == -1 && _PyErr_Occurred(tstate)) { return NULL; } res = PyImport_ImportModuleLevelObject( @@ -5217,7 +5217,7 @@ import_name(PyThreadState *tstate, PyFrameObject *f, } static PyObject * -import_from(PyThreadState *tstate, PyObject *v, PyObject *name) +import_from(PyThreadState *tstate, PyObject *v, PyObject *name) { PyObject *x; PyObject *fullmodname, *pkgname, *pkgpath, *pkgname_or_unknown, *errmsg; @@ -5243,7 +5243,7 @@ import_from(PyThreadState *tstate, PyObject *v, PyObject *name) } x = PyImport_GetModule(fullmodname); Py_DECREF(fullmodname); - if (x == NULL && !_PyErr_Occurred(tstate)) { + if (x == NULL && !_PyErr_Occurred(tstate)) { goto error; } Py_DECREF(pkgname); @@ -5261,26 +5261,26 @@ import_from(PyThreadState *tstate, PyObject *v, PyObject *name) } if (pkgpath == NULL || !PyUnicode_Check(pkgpath)) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); errmsg = PyUnicode_FromFormat( "cannot import name %R from %R (unknown location)", name, pkgname_or_unknown ); - /* NULL checks for errmsg and pkgname done by PyErr_SetImportError. */ + /* NULL checks for errmsg and pkgname done by PyErr_SetImportError. */ PyErr_SetImportError(errmsg, pkgname, NULL); } else { - _Py_IDENTIFIER(__spec__); - PyObject *spec = _PyObject_GetAttrId(v, &PyId___spec__); - const char *fmt = - _PyModuleSpec_IsInitializing(spec) ? - "cannot import name %R from partially initialized module %R " - "(most likely due to a circular import) (%S)" : - "cannot import name %R from %R (%S)"; - Py_XDECREF(spec); - - errmsg = PyUnicode_FromFormat(fmt, name, pkgname_or_unknown, pkgpath); - /* NULL checks for errmsg and pkgname done by PyErr_SetImportError. */ + _Py_IDENTIFIER(__spec__); + PyObject *spec = _PyObject_GetAttrId(v, &PyId___spec__); + const char *fmt = + _PyModuleSpec_IsInitializing(spec) ? + "cannot import name %R from partially initialized module %R " + "(most likely due to a circular import) (%S)" : + "cannot import name %R from %R (%S)"; + Py_XDECREF(spec); + + errmsg = PyUnicode_FromFormat(fmt, name, pkgname_or_unknown, pkgpath); + /* NULL checks for errmsg and pkgname done by PyErr_SetImportError. */ PyErr_SetImportError(errmsg, pkgname, pkgpath); } @@ -5291,7 +5291,7 @@ import_from(PyThreadState *tstate, PyObject *v, PyObject *name) } static int -import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v) +import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v) { _Py_IDENTIFIER(__all__); _Py_IDENTIFIER(__dict__); @@ -5307,7 +5307,7 @@ import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v) return -1; } if (dict == NULL) { - _PyErr_SetString(tstate, PyExc_ImportError, + _PyErr_SetString(tstate, PyExc_ImportError, "from-import-* object has no __dict__ and no __all__"); return -1; } @@ -5321,40 +5321,40 @@ import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v) for (pos = 0, err = 0; ; pos++) { name = PySequence_GetItem(all, pos); if (name == NULL) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_IndexError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_IndexError)) { err = -1; - } - else { - _PyErr_Clear(tstate); - } + } + else { + _PyErr_Clear(tstate); + } break; } - if (!PyUnicode_Check(name)) { - PyObject *modname = _PyObject_GetAttrId(v, &PyId___name__); - if (modname == NULL) { - Py_DECREF(name); - err = -1; - break; - } - if (!PyUnicode_Check(modname)) { - _PyErr_Format(tstate, PyExc_TypeError, - "module __name__ must be a string, not %.100s", - Py_TYPE(modname)->tp_name); - } - else { - _PyErr_Format(tstate, PyExc_TypeError, - "%s in %U.%s must be str, not %.100s", - skip_leading_underscores ? "Key" : "Item", - modname, - skip_leading_underscores ? "__dict__" : "__all__", - Py_TYPE(name)->tp_name); - } - Py_DECREF(modname); - Py_DECREF(name); - err = -1; - break; - } - if (skip_leading_underscores) { + if (!PyUnicode_Check(name)) { + PyObject *modname = _PyObject_GetAttrId(v, &PyId___name__); + if (modname == NULL) { + Py_DECREF(name); + err = -1; + break; + } + if (!PyUnicode_Check(modname)) { + _PyErr_Format(tstate, PyExc_TypeError, + "module __name__ must be a string, not %.100s", + Py_TYPE(modname)->tp_name); + } + else { + _PyErr_Format(tstate, PyExc_TypeError, + "%s in %U.%s must be str, not %.100s", + skip_leading_underscores ? "Key" : "Item", + modname, + skip_leading_underscores ? "__dict__" : "__all__", + Py_TYPE(name)->tp_name); + } + Py_DECREF(modname); + Py_DECREF(name); + err = -1; + break; + } + if (skip_leading_underscores) { if (PyUnicode_READY(name) == -1) { Py_DECREF(name); err = -1; @@ -5382,72 +5382,72 @@ import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v) } static int -check_args_iterable(PyThreadState *tstate, PyObject *func, PyObject *args) +check_args_iterable(PyThreadState *tstate, PyObject *func, PyObject *args) { - if (Py_TYPE(args)->tp_iter == NULL && !PySequence_Check(args)) { - /* check_args_iterable() may be called with a live exception: - * clear it to prevent calling _PyObject_FunctionStr() with an - * exception set. */ - _PyErr_Clear(tstate); - PyObject *funcstr = _PyObject_FunctionStr(func); - if (funcstr != NULL) { - _PyErr_Format(tstate, PyExc_TypeError, - "%U argument after * must be an iterable, not %.200s", - funcstr, Py_TYPE(args)->tp_name); - Py_DECREF(funcstr); - } + if (Py_TYPE(args)->tp_iter == NULL && !PySequence_Check(args)) { + /* check_args_iterable() may be called with a live exception: + * clear it to prevent calling _PyObject_FunctionStr() with an + * exception set. */ + _PyErr_Clear(tstate); + PyObject *funcstr = _PyObject_FunctionStr(func); + if (funcstr != NULL) { + _PyErr_Format(tstate, PyExc_TypeError, + "%U argument after * must be an iterable, not %.200s", + funcstr, Py_TYPE(args)->tp_name); + Py_DECREF(funcstr); + } return -1; } return 0; } static void -format_kwargs_error(PyThreadState *tstate, PyObject *func, PyObject *kwargs) +format_kwargs_error(PyThreadState *tstate, PyObject *func, PyObject *kwargs) { - /* _PyDict_MergeEx raises attribute - * error (percolated from an attempt - * to get 'keys' attribute) instead of - * a type error if its second argument - * is not a mapping. - */ - if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { - _PyErr_Clear(tstate); - PyObject *funcstr = _PyObject_FunctionStr(func); - if (funcstr != NULL) { - _PyErr_Format( - tstate, PyExc_TypeError, - "%U argument after ** must be a mapping, not %.200s", - funcstr, Py_TYPE(kwargs)->tp_name); - Py_DECREF(funcstr); - } - } - else if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - PyObject *exc, *val, *tb; - _PyErr_Fetch(tstate, &exc, &val, &tb); - if (val && PyTuple_Check(val) && PyTuple_GET_SIZE(val) == 1) { - _PyErr_Clear(tstate); - PyObject *funcstr = _PyObject_FunctionStr(func); - if (funcstr != NULL) { - PyObject *key = PyTuple_GET_ITEM(val, 0); - _PyErr_Format( - tstate, PyExc_TypeError, - "%U got multiple values for keyword argument '%S'", - funcstr, key); - Py_DECREF(funcstr); - } - Py_XDECREF(exc); - Py_XDECREF(val); - Py_XDECREF(tb); - } - else { - _PyErr_Restore(tstate, exc, val, tb); - } - } + /* _PyDict_MergeEx raises attribute + * error (percolated from an attempt + * to get 'keys' attribute) instead of + * a type error if its second argument + * is not a mapping. + */ + if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { + _PyErr_Clear(tstate); + PyObject *funcstr = _PyObject_FunctionStr(func); + if (funcstr != NULL) { + _PyErr_Format( + tstate, PyExc_TypeError, + "%U argument after ** must be a mapping, not %.200s", + funcstr, Py_TYPE(kwargs)->tp_name); + Py_DECREF(funcstr); + } + } + else if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + PyObject *exc, *val, *tb; + _PyErr_Fetch(tstate, &exc, &val, &tb); + if (val && PyTuple_Check(val) && PyTuple_GET_SIZE(val) == 1) { + _PyErr_Clear(tstate); + PyObject *funcstr = _PyObject_FunctionStr(func); + if (funcstr != NULL) { + PyObject *key = PyTuple_GET_ITEM(val, 0); + _PyErr_Format( + tstate, PyExc_TypeError, + "%U got multiple values for keyword argument '%S'", + funcstr, key); + Py_DECREF(funcstr); + } + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + } + else { + _PyErr_Restore(tstate, exc, val, tb); + } + } } static void -format_exc_check_arg(PyThreadState *tstate, PyObject *exc, - const char *format_str, PyObject *obj) +format_exc_check_arg(PyThreadState *tstate, PyObject *exc, + const char *format_str, PyObject *obj) { const char *obj_str; @@ -5458,52 +5458,52 @@ format_exc_check_arg(PyThreadState *tstate, PyObject *exc, if (!obj_str) return; - _PyErr_Format(tstate, exc, format_str, obj_str); + _PyErr_Format(tstate, exc, format_str, obj_str); } static void -format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg) +format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg) { PyObject *name; /* Don't stomp existing exception */ - if (_PyErr_Occurred(tstate)) + if (_PyErr_Occurred(tstate)) return; if (oparg < PyTuple_GET_SIZE(co->co_cellvars)) { name = PyTuple_GET_ITEM(co->co_cellvars, oparg); - format_exc_check_arg(tstate, + format_exc_check_arg(tstate, PyExc_UnboundLocalError, UNBOUNDLOCAL_ERROR_MSG, name); } else { name = PyTuple_GET_ITEM(co->co_freevars, oparg - PyTuple_GET_SIZE(co->co_cellvars)); - format_exc_check_arg(tstate, PyExc_NameError, + format_exc_check_arg(tstate, PyExc_NameError, UNBOUNDFREE_ERROR_MSG, name); } } static void -format_awaitable_error(PyThreadState *tstate, PyTypeObject *type, int prevprevopcode, int prevopcode) +format_awaitable_error(PyThreadState *tstate, PyTypeObject *type, int prevprevopcode, int prevopcode) { if (type->tp_as_async == NULL || type->tp_as_async->am_await == NULL) { if (prevopcode == BEFORE_ASYNC_WITH) { - _PyErr_Format(tstate, PyExc_TypeError, - "'async with' received an object from __aenter__ " - "that does not implement __await__: %.100s", - type->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "'async with' received an object from __aenter__ " + "that does not implement __await__: %.100s", + type->tp_name); } - else if (prevopcode == WITH_EXCEPT_START || (prevopcode == CALL_FUNCTION && prevprevopcode == DUP_TOP)) { - _PyErr_Format(tstate, PyExc_TypeError, - "'async with' received an object from __aexit__ " - "that does not implement __await__: %.100s", - type->tp_name); + else if (prevopcode == WITH_EXCEPT_START || (prevopcode == CALL_FUNCTION && prevprevopcode == DUP_TOP)) { + _PyErr_Format(tstate, PyExc_TypeError, + "'async with' received an object from __aexit__ " + "that does not implement __await__: %.100s", + type->tp_name); } } } static PyObject * -unicode_concatenate(PyThreadState *tstate, PyObject *v, PyObject *w, +unicode_concatenate(PyThreadState *tstate, PyObject *v, PyObject *w, PyFrameObject *f, const _Py_CODEUNIT *next_instr) { PyObject *res; @@ -5540,13 +5540,13 @@ unicode_concatenate(PyThreadState *tstate, PyObject *v, PyObject *w, PyObject *names = f->f_code->co_names; PyObject *name = GETITEM(names, oparg); PyObject *locals = f->f_locals; - if (locals && PyDict_CheckExact(locals)) { - PyObject *w = PyDict_GetItemWithError(locals, name); - if ((w == v && PyDict_DelItem(locals, name) != 0) || - (w == NULL && _PyErr_Occurred(tstate))) - { - Py_DECREF(v); - return NULL; + if (locals && PyDict_CheckExact(locals)) { + PyObject *w = PyDict_GetItemWithError(locals, name); + if ((w == v && PyDict_DelItem(locals, name) != 0) || + (w == NULL && _PyErr_Occurred(tstate))) + { + Py_DECREF(v); + return NULL; } } break; @@ -5605,7 +5605,7 @@ _Py_GetDXProfile(PyObject *self, PyObject *args) Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free) { - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); Py_ssize_t new_index; if (interp->co_extra_user_count == MAX_CO_EXTRA_USERS - 1) { @@ -5623,10 +5623,10 @@ dtrace_function_entry(PyFrameObject *f) const char *funcname; int lineno; - PyCodeObject *code = f->f_code; - filename = PyUnicode_AsUTF8(code->co_filename); - funcname = PyUnicode_AsUTF8(code->co_name); - lineno = PyCode_Addr2Line(code, f->f_lasti); + PyCodeObject *code = f->f_code; + filename = PyUnicode_AsUTF8(code->co_filename); + funcname = PyUnicode_AsUTF8(code->co_name); + lineno = PyCode_Addr2Line(code, f->f_lasti); PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno); } @@ -5638,10 +5638,10 @@ dtrace_function_return(PyFrameObject *f) const char *funcname; int lineno; - PyCodeObject *code = f->f_code; - filename = PyUnicode_AsUTF8(code->co_filename); - funcname = PyUnicode_AsUTF8(code->co_name); - lineno = PyCode_Addr2Line(code, f->f_lasti); + PyCodeObject *code = f->f_code; + filename = PyUnicode_AsUTF8(code->co_filename); + funcname = PyUnicode_AsUTF8(code->co_name); + lineno = PyCode_Addr2Line(code, f->f_lasti); PyDTrace_FUNCTION_RETURN(filename, funcname, lineno); } @@ -5679,21 +5679,21 @@ maybe_dtrace_line(PyFrameObject *frame, } *instr_prev = frame->f_lasti; } - - -/* Implement Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as functions - for the limited API. */ - -#undef Py_EnterRecursiveCall - -int Py_EnterRecursiveCall(const char *where) -{ - return _Py_EnterRecursiveCall_inline(where); -} - -#undef Py_LeaveRecursiveCall - -void Py_LeaveRecursiveCall(void) -{ - _Py_LeaveRecursiveCall_inline(); -} + + +/* Implement Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as functions + for the limited API. */ + +#undef Py_EnterRecursiveCall + +int Py_EnterRecursiveCall(const char *where) +{ + return _Py_EnterRecursiveCall_inline(where); +} + +#undef Py_LeaveRecursiveCall + +void Py_LeaveRecursiveCall(void) +{ + _Py_LeaveRecursiveCall_inline(); +} diff --git a/contrib/tools/python3/src/Python/ceval_gil.h b/contrib/tools/python3/src/Python/ceval_gil.h index 3624d9462f..3510675a69 100644 --- a/contrib/tools/python3/src/Python/ceval_gil.h +++ b/contrib/tools/python3/src/Python/ceval_gil.h @@ -5,7 +5,7 @@ #include <stdlib.h> #include <errno.h> -#include "pycore_atomic.h" +#include "pycore_atomic.h" /* @@ -90,242 +90,242 @@ #define DEFAULT_INTERVAL 5000 -static void _gil_initialize(struct _gil_runtime_state *gil) +static void _gil_initialize(struct _gil_runtime_state *gil) { _Py_atomic_int uninitialized = {-1}; - gil->locked = uninitialized; - gil->interval = DEFAULT_INTERVAL; + gil->locked = uninitialized; + gil->interval = DEFAULT_INTERVAL; } -static int gil_created(struct _gil_runtime_state *gil) +static int gil_created(struct _gil_runtime_state *gil) { - return (_Py_atomic_load_explicit(&gil->locked, _Py_memory_order_acquire) >= 0); + return (_Py_atomic_load_explicit(&gil->locked, _Py_memory_order_acquire) >= 0); } -static void create_gil(struct _gil_runtime_state *gil) +static void create_gil(struct _gil_runtime_state *gil) { - MUTEX_INIT(gil->mutex); + MUTEX_INIT(gil->mutex); #ifdef FORCE_SWITCHING - MUTEX_INIT(gil->switch_mutex); + MUTEX_INIT(gil->switch_mutex); #endif - COND_INIT(gil->cond); + COND_INIT(gil->cond); #ifdef FORCE_SWITCHING - COND_INIT(gil->switch_cond); + COND_INIT(gil->switch_cond); #endif - _Py_atomic_store_relaxed(&gil->last_holder, 0); - _Py_ANNOTATE_RWLOCK_CREATE(&gil->locked); - _Py_atomic_store_explicit(&gil->locked, 0, _Py_memory_order_release); + _Py_atomic_store_relaxed(&gil->last_holder, 0); + _Py_ANNOTATE_RWLOCK_CREATE(&gil->locked); + _Py_atomic_store_explicit(&gil->locked, 0, _Py_memory_order_release); } -static void destroy_gil(struct _gil_runtime_state *gil) +static void destroy_gil(struct _gil_runtime_state *gil) { /* some pthread-like implementations tie the mutex to the cond * and must have the cond destroyed first. */ - COND_FINI(gil->cond); - MUTEX_FINI(gil->mutex); + COND_FINI(gil->cond); + MUTEX_FINI(gil->mutex); #ifdef FORCE_SWITCHING - COND_FINI(gil->switch_cond); - MUTEX_FINI(gil->switch_mutex); + COND_FINI(gil->switch_cond); + MUTEX_FINI(gil->switch_mutex); #endif - _Py_atomic_store_explicit(&gil->locked, -1, + _Py_atomic_store_explicit(&gil->locked, -1, _Py_memory_order_release); - _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked); + _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked); } -static void recreate_gil(struct _gil_runtime_state *gil) +static void recreate_gil(struct _gil_runtime_state *gil) { - _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked); + _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked); /* XXX should we destroy the old OS resources here? */ - create_gil(gil); + create_gil(gil); } -static void -drop_gil(struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2, - PyThreadState *tstate) +static void +drop_gil(struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2, + PyThreadState *tstate) { - struct _gil_runtime_state *gil = &ceval->gil; - if (!_Py_atomic_load_relaxed(&gil->locked)) { + struct _gil_runtime_state *gil = &ceval->gil; + if (!_Py_atomic_load_relaxed(&gil->locked)) { Py_FatalError("drop_gil: GIL is not locked"); - } - + } + /* tstate is allowed to be NULL (early interpreter init) */ if (tstate != NULL) { /* Sub-interpreter support: threads might have been switched under our feet using PyThreadState_Swap(). Fix the GIL last holder variable so that our heuristics work. */ - _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); + _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); } - MUTEX_LOCK(gil->mutex); - _Py_ANNOTATE_RWLOCK_RELEASED(&gil->locked, /*is_write=*/1); - _Py_atomic_store_relaxed(&gil->locked, 0); - COND_SIGNAL(gil->cond); - MUTEX_UNLOCK(gil->mutex); + MUTEX_LOCK(gil->mutex); + _Py_ANNOTATE_RWLOCK_RELEASED(&gil->locked, /*is_write=*/1); + _Py_atomic_store_relaxed(&gil->locked, 0); + COND_SIGNAL(gil->cond); + MUTEX_UNLOCK(gil->mutex); #ifdef FORCE_SWITCHING - if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request) && tstate != NULL) { - MUTEX_LOCK(gil->switch_mutex); + if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request) && tstate != NULL) { + MUTEX_LOCK(gil->switch_mutex); /* Not switched yet => wait */ - if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate) + if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate) { - assert(is_tstate_valid(tstate)); - RESET_GIL_DROP_REQUEST(tstate->interp); + assert(is_tstate_valid(tstate)); + RESET_GIL_DROP_REQUEST(tstate->interp); /* NOTE: if COND_WAIT does not atomically start waiting when releasing the mutex, another thread can run through, take the GIL and drop it again, and reset the condition before we even had a chance to wait for it. */ - COND_WAIT(gil->switch_cond, gil->switch_mutex); - } - MUTEX_UNLOCK(gil->switch_mutex); + COND_WAIT(gil->switch_cond, gil->switch_mutex); + } + MUTEX_UNLOCK(gil->switch_mutex); } #endif } - -/* Check if a Python thread must exit immediately, rather than taking the GIL - if Py_Finalize() has been called. - - When this function is called by a daemon thread after Py_Finalize() has been - called, the GIL does no longer exist. - - tstate must be non-NULL. */ -static inline int -tstate_must_exit(PyThreadState *tstate) -{ - /* bpo-39877: Access _PyRuntime directly rather than using - tstate->interp->runtime to support calls from Python daemon threads. - After Py_Finalize() has been called, tstate can be a dangling pointer: - point to PyThreadState freed memory. */ - PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(&_PyRuntime); - return (finalizing != NULL && finalizing != tstate); -} - - -/* Take the GIL. - - The function saves errno at entry and restores its value at exit. - - tstate must be non-NULL. */ -static void -take_gil(PyThreadState *tstate) + +/* Check if a Python thread must exit immediately, rather than taking the GIL + if Py_Finalize() has been called. + + When this function is called by a daemon thread after Py_Finalize() has been + called, the GIL does no longer exist. + + tstate must be non-NULL. */ +static inline int +tstate_must_exit(PyThreadState *tstate) +{ + /* bpo-39877: Access _PyRuntime directly rather than using + tstate->interp->runtime to support calls from Python daemon threads. + After Py_Finalize() has been called, tstate can be a dangling pointer: + point to PyThreadState freed memory. */ + PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(&_PyRuntime); + return (finalizing != NULL && finalizing != tstate); +} + + +/* Take the GIL. + + The function saves errno at entry and restores its value at exit. + + tstate must be non-NULL. */ +static void +take_gil(PyThreadState *tstate) { - int err = errno; - - assert(tstate != NULL); - - if (tstate_must_exit(tstate)) { - /* bpo-39877: If Py_Finalize() has been called and tstate is not the - thread which called Py_Finalize(), exit immediately the thread. - - This code path can be reached by a daemon thread after Py_Finalize() - completes. In this case, tstate is a dangling pointer: points to - PyThreadState freed memory. */ - PyThread_exit_thread(); - } - - assert(is_tstate_valid(tstate)); - PyInterpreterState *interp = tstate->interp; - struct _ceval_runtime_state *ceval = &interp->runtime->ceval; - struct _ceval_state *ceval2 = &interp->ceval; - struct _gil_runtime_state *gil = &ceval->gil; - - /* Check that _PyEval_InitThreads() was called to create the lock */ - assert(gil_created(gil)); - - MUTEX_LOCK(gil->mutex); - - if (!_Py_atomic_load_relaxed(&gil->locked)) { + int err = errno; + + assert(tstate != NULL); + + if (tstate_must_exit(tstate)) { + /* bpo-39877: If Py_Finalize() has been called and tstate is not the + thread which called Py_Finalize(), exit immediately the thread. + + This code path can be reached by a daemon thread after Py_Finalize() + completes. In this case, tstate is a dangling pointer: points to + PyThreadState freed memory. */ + PyThread_exit_thread(); + } + + assert(is_tstate_valid(tstate)); + PyInterpreterState *interp = tstate->interp; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; + struct _gil_runtime_state *gil = &ceval->gil; + + /* Check that _PyEval_InitThreads() was called to create the lock */ + assert(gil_created(gil)); + + MUTEX_LOCK(gil->mutex); + + if (!_Py_atomic_load_relaxed(&gil->locked)) { goto _ready; - } + } + + while (_Py_atomic_load_relaxed(&gil->locked)) { + unsigned long saved_switchnum = gil->switch_number; - while (_Py_atomic_load_relaxed(&gil->locked)) { - unsigned long saved_switchnum = gil->switch_number; + unsigned long interval = (gil->interval >= 1 ? gil->interval : 1); + int timed_out = 0; + COND_TIMED_WAIT(gil->cond, gil->mutex, interval, timed_out); - unsigned long interval = (gil->interval >= 1 ? gil->interval : 1); - int timed_out = 0; - COND_TIMED_WAIT(gil->cond, gil->mutex, interval, timed_out); - /* If we timed out and no switch occurred in the meantime, it is time to ask the GIL-holding thread to drop it. */ if (timed_out && - _Py_atomic_load_relaxed(&gil->locked) && - gil->switch_number == saved_switchnum) - { - if (tstate_must_exit(tstate)) { - MUTEX_UNLOCK(gil->mutex); - PyThread_exit_thread(); - } - assert(is_tstate_valid(tstate)); - - SET_GIL_DROP_REQUEST(interp); + _Py_atomic_load_relaxed(&gil->locked) && + gil->switch_number == saved_switchnum) + { + if (tstate_must_exit(tstate)) { + MUTEX_UNLOCK(gil->mutex); + PyThread_exit_thread(); + } + assert(is_tstate_valid(tstate)); + + SET_GIL_DROP_REQUEST(interp); } } - + _ready: #ifdef FORCE_SWITCHING - /* This mutex must be taken before modifying gil->last_holder: - see drop_gil(). */ - MUTEX_LOCK(gil->switch_mutex); + /* This mutex must be taken before modifying gil->last_holder: + see drop_gil(). */ + MUTEX_LOCK(gil->switch_mutex); #endif /* We now hold the GIL */ - _Py_atomic_store_relaxed(&gil->locked, 1); - _Py_ANNOTATE_RWLOCK_ACQUIRED(&gil->locked, /*is_write=*/1); + _Py_atomic_store_relaxed(&gil->locked, 1); + _Py_ANNOTATE_RWLOCK_ACQUIRED(&gil->locked, /*is_write=*/1); - if (tstate != (PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) { - _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); - ++gil->switch_number; + if (tstate != (PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) { + _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); + ++gil->switch_number; } #ifdef FORCE_SWITCHING - COND_SIGNAL(gil->switch_cond); - MUTEX_UNLOCK(gil->switch_mutex); + COND_SIGNAL(gil->switch_cond); + MUTEX_UNLOCK(gil->switch_mutex); #endif - - if (tstate_must_exit(tstate)) { - /* bpo-36475: If Py_Finalize() has been called and tstate is not - the thread which called Py_Finalize(), exit immediately the - thread. - - This code path can be reached by a daemon thread which was waiting - in take_gil() while the main thread called - wait_for_thread_shutdown() from Py_Finalize(). */ - MUTEX_UNLOCK(gil->mutex); - drop_gil(ceval, ceval2, tstate); - PyThread_exit_thread(); + + if (tstate_must_exit(tstate)) { + /* bpo-36475: If Py_Finalize() has been called and tstate is not + the thread which called Py_Finalize(), exit immediately the + thread. + + This code path can be reached by a daemon thread which was waiting + in take_gil() while the main thread called + wait_for_thread_shutdown() from Py_Finalize(). */ + MUTEX_UNLOCK(gil->mutex); + drop_gil(ceval, ceval2, tstate); + PyThread_exit_thread(); + } + assert(is_tstate_valid(tstate)); + + if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request)) { + RESET_GIL_DROP_REQUEST(interp); } - assert(is_tstate_valid(tstate)); - - if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request)) { - RESET_GIL_DROP_REQUEST(interp); - } - else { - /* bpo-40010: eval_breaker should be recomputed to be set to 1 if there - is a pending signal: signal received by another thread which cannot - handle signals. - - Note: RESET_GIL_DROP_REQUEST() calls COMPUTE_EVAL_BREAKER(). */ - COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); - } - - /* Don't access tstate if the thread must exit */ + else { + /* bpo-40010: eval_breaker should be recomputed to be set to 1 if there + is a pending signal: signal received by another thread which cannot + handle signals. + + Note: RESET_GIL_DROP_REQUEST() calls COMPUTE_EVAL_BREAKER(). */ + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); + } + + /* Don't access tstate if the thread must exit */ if (tstate->async_exc != NULL) { - _PyEval_SignalAsyncExc(tstate); + _PyEval_SignalAsyncExc(tstate); } - MUTEX_UNLOCK(gil->mutex); - + MUTEX_UNLOCK(gil->mutex); + errno = err; } void _PyEval_SetSwitchInterval(unsigned long microseconds) { - struct _gil_runtime_state *gil = &_PyRuntime.ceval.gil; - gil->interval = microseconds; + struct _gil_runtime_state *gil = &_PyRuntime.ceval.gil; + gil->interval = microseconds; } unsigned long _PyEval_GetSwitchInterval() { - struct _gil_runtime_state *gil = &_PyRuntime.ceval.gil; - return gil->interval; + struct _gil_runtime_state *gil = &_PyRuntime.ceval.gil; + return gil->interval; } diff --git a/contrib/tools/python3/src/Python/clinic/_warnings.c.h b/contrib/tools/python3/src/Python/clinic/_warnings.c.h index 8c07aecfc1..67ab0e3d9d 100644 --- a/contrib/tools/python3/src/Python/clinic/_warnings.c.h +++ b/contrib/tools/python3/src/Python/clinic/_warnings.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(warnings_warn__doc__, "Issue a warning, or maybe ignore it or raise an exception."); #define WARNINGS_WARN_METHODDEF \ - {"warn", (PyCFunction)(void(*)(void))warnings_warn, METH_FASTCALL|METH_KEYWORDS, warnings_warn__doc__}, + {"warn", (PyCFunction)(void(*)(void))warnings_warn, METH_FASTCALL|METH_KEYWORDS, warnings_warn__doc__}, static PyObject * warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category, @@ -20,55 +20,55 @@ warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec { PyObject *return_value = NULL; static const char * const _keywords[] = {"message", "category", "stacklevel", "source", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "warn", 0}; - PyObject *argsbuf[4]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static _PyArg_Parser _parser = {NULL, _keywords, "warn", 0}; + PyObject *argsbuf[4]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *message; PyObject *category = Py_None; Py_ssize_t stacklevel = 1; PyObject *source = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf); + if (!args) { goto exit; } - message = args[0]; - if (!noptargs) { - goto skip_optional_pos; - } - if (args[1]) { - category = args[1]; - if (!--noptargs) { - goto skip_optional_pos; - } - } - if (args[2]) { - if (PyFloat_Check(args[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - { - Py_ssize_t ival = -1; - PyObject *iobj = PyNumber_Index(args[2]); - if (iobj != NULL) { - ival = PyLong_AsSsize_t(iobj); - Py_DECREF(iobj); - } - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - stacklevel = ival; - } - if (!--noptargs) { - goto skip_optional_pos; - } - } - source = args[3]; -skip_optional_pos: + message = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + if (args[1]) { + category = args[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[2]) { + if (PyFloat_Check(args[2])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + { + Py_ssize_t ival = -1; + PyObject *iobj = PyNumber_Index(args[2]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + goto exit; + } + stacklevel = ival; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + source = args[3]; +skip_optional_pos: return_value = warnings_warn_impl(module, message, category, stacklevel, source); exit: return return_value; } -/*[clinic end generated code: output=b7bb54c73b5433ec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b7bb54c73b5433ec input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h b/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h index 830e7560f2..d15af1f7f3 100644 --- a/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h +++ b/contrib/tools/python3/src/Python/clinic/bltinmodule.c.h @@ -82,7 +82,7 @@ PyDoc_STRVAR(builtin_format__doc__, "details."); #define BUILTIN_FORMAT_METHODDEF \ - {"format", (PyCFunction)(void(*)(void))builtin_format, METH_FASTCALL, builtin_format__doc__}, + {"format", (PyCFunction)(void(*)(void))builtin_format, METH_FASTCALL, builtin_format__doc__}, static PyObject * builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec); @@ -94,22 +94,22 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *value; PyObject *format_spec = NULL; - if (!_PyArg_CheckPositional("format", nargs, 1, 2)) { + if (!_PyArg_CheckPositional("format", nargs, 1, 2)) { goto exit; } - value = args[0]; - if (nargs < 2) { - goto skip_optional; - } - if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("format", "argument 2", "str", args[1]); - goto exit; - } - if (PyUnicode_READY(args[1]) == -1) { - goto exit; - } - format_spec = args[1]; -skip_optional: + value = args[0]; + if (nargs < 2) { + goto skip_optional; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("format", "argument 2", "str", args[1]); + goto exit; + } + if (PyUnicode_READY(args[1]) == -1) { + goto exit; + } + format_spec = args[1]; +skip_optional: return_value = builtin_format_impl(module, value, format_spec); exit: @@ -134,15 +134,15 @@ builtin_chr(PyObject *module, PyObject *arg) PyObject *return_value = NULL; int i; - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + i = _PyLong_AsInt(arg); + if (i == -1 && PyErr_Occurred()) { goto exit; } - i = _PyLong_AsInt(arg); - if (i == -1 && PyErr_Occurred()) { - goto exit; - } return_value = builtin_chr_impl(module, i); exit: @@ -151,7 +151,7 @@ exit: PyDoc_STRVAR(builtin_compile__doc__, "compile($module, /, source, filename, mode, flags=0,\n" -" dont_inherit=False, optimize=-1, *, _feature_version=-1)\n" +" dont_inherit=False, optimize=-1, *, _feature_version=-1)\n" "--\n" "\n" "Compile source into a code object that can be executed by exec() or eval().\n" @@ -168,110 +168,110 @@ PyDoc_STRVAR(builtin_compile__doc__, "in addition to any features explicitly specified."); #define BUILTIN_COMPILE_METHODDEF \ - {"compile", (PyCFunction)(void(*)(void))builtin_compile, METH_FASTCALL|METH_KEYWORDS, builtin_compile__doc__}, + {"compile", (PyCFunction)(void(*)(void))builtin_compile, METH_FASTCALL|METH_KEYWORDS, builtin_compile__doc__}, static PyObject * builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, const char *mode, int flags, int dont_inherit, - int optimize, int feature_version); + int optimize, int feature_version); static PyObject * builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"source", "filename", "mode", "flags", "dont_inherit", "optimize", "_feature_version", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "compile", 0}; - PyObject *argsbuf[7]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3; + static const char * const _keywords[] = {"source", "filename", "mode", "flags", "dont_inherit", "optimize", "_feature_version", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "compile", 0}; + PyObject *argsbuf[7]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3; PyObject *source; PyObject *filename; const char *mode; int flags = 0; int dont_inherit = 0; int optimize = -1; - int feature_version = -1; + int feature_version = -1; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 6, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 6, 0, argsbuf); + if (!args) { + goto exit; + } + source = args[0]; + if (!PyUnicode_FSDecoder(args[1], &filename)) { + goto exit; + } + if (!PyUnicode_Check(args[2])) { + _PyArg_BadArgument("compile", "argument 'mode'", "str", args[2]); + goto exit; + } + Py_ssize_t mode_length; + mode = PyUnicode_AsUTF8AndSize(args[2], &mode_length); + if (mode == NULL) { + goto exit; + } + if (strlen(mode) != (size_t)mode_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[3]) { + if (PyFloat_Check(args[3])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + flags = _PyLong_AsInt(args[3]); + if (flags == -1 && PyErr_Occurred()) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[4]) { + if (PyFloat_Check(args[4])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + dont_inherit = _PyLong_AsInt(args[4]); + if (dont_inherit == -1 && PyErr_Occurred()) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[5]) { + if (PyFloat_Check(args[5])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + optimize = _PyLong_AsInt(args[5]); + if (optimize == -1 && PyErr_Occurred()) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } +skip_optional_pos: + if (!noptargs) { + goto skip_optional_kwonly; + } + if (PyFloat_Check(args[6])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + feature_version = _PyLong_AsInt(args[6]); + if (feature_version == -1 && PyErr_Occurred()) { goto exit; } - source = args[0]; - if (!PyUnicode_FSDecoder(args[1], &filename)) { - goto exit; - } - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("compile", "argument 'mode'", "str", args[2]); - goto exit; - } - Py_ssize_t mode_length; - mode = PyUnicode_AsUTF8AndSize(args[2], &mode_length); - if (mode == NULL) { - goto exit; - } - if (strlen(mode) != (size_t)mode_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - if (args[3]) { - if (PyFloat_Check(args[3])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - flags = _PyLong_AsInt(args[3]); - if (flags == -1 && PyErr_Occurred()) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_pos; - } - } - if (args[4]) { - if (PyFloat_Check(args[4])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - dont_inherit = _PyLong_AsInt(args[4]); - if (dont_inherit == -1 && PyErr_Occurred()) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_pos; - } - } - if (args[5]) { - if (PyFloat_Check(args[5])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - optimize = _PyLong_AsInt(args[5]); - if (optimize == -1 && PyErr_Occurred()) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_pos; - } - } -skip_optional_pos: - if (!noptargs) { - goto skip_optional_kwonly; - } - if (PyFloat_Check(args[6])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - feature_version = _PyLong_AsInt(args[6]); - if (feature_version == -1 && PyErr_Occurred()) { - goto exit; - } -skip_optional_kwonly: - return_value = builtin_compile_impl(module, source, filename, mode, flags, dont_inherit, optimize, feature_version); +skip_optional_kwonly: + return_value = builtin_compile_impl(module, source, filename, mode, flags, dont_inherit, optimize, feature_version); exit: return return_value; @@ -284,7 +284,7 @@ PyDoc_STRVAR(builtin_divmod__doc__, "Return the tuple (x//y, x%y). Invariant: div*y + mod == x."); #define BUILTIN_DIVMOD_METHODDEF \ - {"divmod", (PyCFunction)(void(*)(void))builtin_divmod, METH_FASTCALL, builtin_divmod__doc__}, + {"divmod", (PyCFunction)(void(*)(void))builtin_divmod, METH_FASTCALL, builtin_divmod__doc__}, static PyObject * builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y); @@ -296,11 +296,11 @@ builtin_divmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *x; PyObject *y; - if (!_PyArg_CheckPositional("divmod", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("divmod", nargs, 2, 2)) { goto exit; } - x = args[0]; - y = args[1]; + x = args[0]; + y = args[1]; return_value = builtin_divmod_impl(module, x, y); exit: @@ -320,7 +320,7 @@ PyDoc_STRVAR(builtin_eval__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EVAL_METHODDEF \ - {"eval", (PyCFunction)(void(*)(void))builtin_eval, METH_FASTCALL, builtin_eval__doc__}, + {"eval", (PyCFunction)(void(*)(void))builtin_eval, METH_FASTCALL, builtin_eval__doc__}, static PyObject * builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals, @@ -334,19 +334,19 @@ builtin_eval(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *globals = Py_None; PyObject *locals = Py_None; - if (!_PyArg_CheckPositional("eval", nargs, 1, 3)) { + if (!_PyArg_CheckPositional("eval", nargs, 1, 3)) { goto exit; } - source = args[0]; - if (nargs < 2) { - goto skip_optional; - } - globals = args[1]; - if (nargs < 3) { - goto skip_optional; - } - locals = args[2]; -skip_optional: + source = args[0]; + if (nargs < 2) { + goto skip_optional; + } + globals = args[1]; + if (nargs < 3) { + goto skip_optional; + } + locals = args[2]; +skip_optional: return_value = builtin_eval_impl(module, source, globals, locals); exit: @@ -366,7 +366,7 @@ PyDoc_STRVAR(builtin_exec__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EXEC_METHODDEF \ - {"exec", (PyCFunction)(void(*)(void))builtin_exec, METH_FASTCALL, builtin_exec__doc__}, + {"exec", (PyCFunction)(void(*)(void))builtin_exec, METH_FASTCALL, builtin_exec__doc__}, static PyObject * builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, @@ -380,19 +380,19 @@ builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *globals = Py_None; PyObject *locals = Py_None; - if (!_PyArg_CheckPositional("exec", nargs, 1, 3)) { + if (!_PyArg_CheckPositional("exec", nargs, 1, 3)) { goto exit; } - source = args[0]; - if (nargs < 2) { - goto skip_optional; - } - globals = args[1]; - if (nargs < 3) { - goto skip_optional; - } - locals = args[2]; -skip_optional: + source = args[0]; + if (nargs < 2) { + goto skip_optional; + } + globals = args[1]; + if (nargs < 3) { + goto skip_optional; + } + locals = args[2]; +skip_optional: return_value = builtin_exec_impl(module, source, globals, locals); exit: @@ -429,7 +429,7 @@ PyDoc_STRVAR(builtin_hasattr__doc__, "This is done by calling getattr(obj, name) and catching AttributeError."); #define BUILTIN_HASATTR_METHODDEF \ - {"hasattr", (PyCFunction)(void(*)(void))builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__}, + {"hasattr", (PyCFunction)(void(*)(void))builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__}, static PyObject * builtin_hasattr_impl(PyObject *module, PyObject *obj, PyObject *name); @@ -441,11 +441,11 @@ builtin_hasattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *obj; PyObject *name; - if (!_PyArg_CheckPositional("hasattr", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("hasattr", nargs, 2, 2)) { goto exit; } - obj = args[0]; - name = args[1]; + obj = args[0]; + name = args[1]; return_value = builtin_hasattr_impl(module, obj, name); exit: @@ -473,7 +473,7 @@ PyDoc_STRVAR(builtin_setattr__doc__, "setattr(x, \'y\', v) is equivalent to ``x.y = v\'\'"); #define BUILTIN_SETATTR_METHODDEF \ - {"setattr", (PyCFunction)(void(*)(void))builtin_setattr, METH_FASTCALL, builtin_setattr__doc__}, + {"setattr", (PyCFunction)(void(*)(void))builtin_setattr, METH_FASTCALL, builtin_setattr__doc__}, static PyObject * builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name, @@ -487,12 +487,12 @@ builtin_setattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *name; PyObject *value; - if (!_PyArg_CheckPositional("setattr", nargs, 3, 3)) { + if (!_PyArg_CheckPositional("setattr", nargs, 3, 3)) { goto exit; } - obj = args[0]; - name = args[1]; - value = args[2]; + obj = args[0]; + name = args[1]; + value = args[2]; return_value = builtin_setattr_impl(module, obj, name, value); exit: @@ -508,7 +508,7 @@ PyDoc_STRVAR(builtin_delattr__doc__, "delattr(x, \'y\') is equivalent to ``del x.y\'\'"); #define BUILTIN_DELATTR_METHODDEF \ - {"delattr", (PyCFunction)(void(*)(void))builtin_delattr, METH_FASTCALL, builtin_delattr__doc__}, + {"delattr", (PyCFunction)(void(*)(void))builtin_delattr, METH_FASTCALL, builtin_delattr__doc__}, static PyObject * builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name); @@ -520,11 +520,11 @@ builtin_delattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *obj; PyObject *name; - if (!_PyArg_CheckPositional("delattr", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("delattr", nargs, 2, 2)) { goto exit; } - obj = args[0]; - name = args[1]; + obj = args[0]; + name = args[1]; return_value = builtin_delattr_impl(module, obj, name); exit: @@ -608,45 +608,45 @@ PyDoc_STRVAR(builtin_ord__doc__, {"ord", (PyCFunction)builtin_ord, METH_O, builtin_ord__doc__}, PyDoc_STRVAR(builtin_pow__doc__, -"pow($module, /, base, exp, mod=None)\n" +"pow($module, /, base, exp, mod=None)\n" "--\n" "\n" -"Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments\n" +"Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments\n" "\n" "Some types, such as ints, are able to use a more efficient algorithm when\n" "invoked using the three argument form."); #define BUILTIN_POW_METHODDEF \ - {"pow", (PyCFunction)(void(*)(void))builtin_pow, METH_FASTCALL|METH_KEYWORDS, builtin_pow__doc__}, + {"pow", (PyCFunction)(void(*)(void))builtin_pow, METH_FASTCALL|METH_KEYWORDS, builtin_pow__doc__}, static PyObject * -builtin_pow_impl(PyObject *module, PyObject *base, PyObject *exp, - PyObject *mod); +builtin_pow_impl(PyObject *module, PyObject *base, PyObject *exp, + PyObject *mod); static PyObject * -builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"base", "exp", "mod", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "pow", 0}; - PyObject *argsbuf[3]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; - PyObject *base; - PyObject *exp; - PyObject *mod = Py_None; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); - if (!args) { + static const char * const _keywords[] = {"base", "exp", "mod", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "pow", 0}; + PyObject *argsbuf[3]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; + PyObject *base; + PyObject *exp; + PyObject *mod = Py_None; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); + if (!args) { goto exit; } - base = args[0]; - exp = args[1]; - if (!noptargs) { - goto skip_optional_pos; - } - mod = args[2]; -skip_optional_pos: - return_value = builtin_pow_impl(module, base, exp, mod); + base = args[0]; + exp = args[1]; + if (!noptargs) { + goto skip_optional_pos; + } + mod = args[2]; +skip_optional_pos: + return_value = builtin_pow_impl(module, base, exp, mod); exit: return return_value; @@ -665,7 +665,7 @@ PyDoc_STRVAR(builtin_input__doc__, "On *nix systems, readline is used if available."); #define BUILTIN_INPUT_METHODDEF \ - {"input", (PyCFunction)(void(*)(void))builtin_input, METH_FASTCALL, builtin_input__doc__}, + {"input", (PyCFunction)(void(*)(void))builtin_input, METH_FASTCALL, builtin_input__doc__}, static PyObject * builtin_input_impl(PyObject *module, PyObject *prompt); @@ -676,14 +676,14 @@ builtin_input(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *return_value = NULL; PyObject *prompt = NULL; - if (!_PyArg_CheckPositional("input", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("input", nargs, 0, 1)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - prompt = args[0]; -skip_optional: + if (nargs < 1) { + goto skip_optional; + } + prompt = args[0]; +skip_optional: return_value = builtin_input_impl(module, prompt); exit: @@ -711,7 +711,7 @@ PyDoc_STRVAR(builtin_round__doc__, "the return value has the same type as the number. ndigits may be negative."); #define BUILTIN_ROUND_METHODDEF \ - {"round", (PyCFunction)(void(*)(void))builtin_round, METH_FASTCALL|METH_KEYWORDS, builtin_round__doc__}, + {"round", (PyCFunction)(void(*)(void))builtin_round, METH_FASTCALL|METH_KEYWORDS, builtin_round__doc__}, static PyObject * builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits); @@ -721,22 +721,22 @@ builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec { PyObject *return_value = NULL; static const char * const _keywords[] = {"number", "ndigits", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "round", 0}; - PyObject *argsbuf[2]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static _PyArg_Parser _parser = {NULL, _keywords, "round", 0}; + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *number; - PyObject *ndigits = Py_None; + PyObject *ndigits = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); + if (!args) { goto exit; } - number = args[0]; - if (!noptargs) { - goto skip_optional_pos; - } - ndigits = args[1]; -skip_optional_pos: + number = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + ndigits = args[1]; +skip_optional_pos: return_value = builtin_round_impl(module, number, ndigits); exit: @@ -744,7 +744,7 @@ exit: } PyDoc_STRVAR(builtin_sum__doc__, -"sum($module, iterable, /, start=0)\n" +"sum($module, iterable, /, start=0)\n" "--\n" "\n" "Return the sum of a \'start\' value (default: 0) plus an iterable of numbers\n" @@ -754,32 +754,32 @@ PyDoc_STRVAR(builtin_sum__doc__, "reject non-numeric types."); #define BUILTIN_SUM_METHODDEF \ - {"sum", (PyCFunction)(void(*)(void))builtin_sum, METH_FASTCALL|METH_KEYWORDS, builtin_sum__doc__}, + {"sum", (PyCFunction)(void(*)(void))builtin_sum, METH_FASTCALL|METH_KEYWORDS, builtin_sum__doc__}, static PyObject * builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start); static PyObject * -builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"", "start", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "sum", 0}; - PyObject *argsbuf[2]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static const char * const _keywords[] = {"", "start", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "sum", 0}; + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *iterable; PyObject *start = NULL; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); + if (!args) { goto exit; } - iterable = args[0]; - if (!noptargs) { - goto skip_optional_pos; - } - start = args[1]; -skip_optional_pos: + iterable = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + start = args[1]; +skip_optional_pos: return_value = builtin_sum_impl(module, iterable, start); exit: @@ -797,7 +797,7 @@ PyDoc_STRVAR(builtin_isinstance__doc__, "or ...`` etc."); #define BUILTIN_ISINSTANCE_METHODDEF \ - {"isinstance", (PyCFunction)(void(*)(void))builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__}, + {"isinstance", (PyCFunction)(void(*)(void))builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__}, static PyObject * builtin_isinstance_impl(PyObject *module, PyObject *obj, @@ -810,11 +810,11 @@ builtin_isinstance(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *obj; PyObject *class_or_tuple; - if (!_PyArg_CheckPositional("isinstance", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("isinstance", nargs, 2, 2)) { goto exit; } - obj = args[0]; - class_or_tuple = args[1]; + obj = args[0]; + class_or_tuple = args[1]; return_value = builtin_isinstance_impl(module, obj, class_or_tuple); exit: @@ -832,7 +832,7 @@ PyDoc_STRVAR(builtin_issubclass__doc__, "or ...`` etc."); #define BUILTIN_ISSUBCLASS_METHODDEF \ - {"issubclass", (PyCFunction)(void(*)(void))builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__}, + {"issubclass", (PyCFunction)(void(*)(void))builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__}, static PyObject * builtin_issubclass_impl(PyObject *module, PyObject *cls, @@ -845,14 +845,14 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *cls; PyObject *class_or_tuple; - if (!_PyArg_CheckPositional("issubclass", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("issubclass", nargs, 2, 2)) { goto exit; } - cls = args[0]; - class_or_tuple = args[1]; + cls = args[0]; + class_or_tuple = args[1]; return_value = builtin_issubclass_impl(module, cls, class_or_tuple); exit: return return_value; } -/*[clinic end generated code: output=29686a89b739d600 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=29686a89b739d600 input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/context.c.h b/contrib/tools/python3/src/Python/clinic/context.c.h index 4290652e15..2ac8bf7c0b 100644 --- a/contrib/tools/python3/src/Python/clinic/context.c.h +++ b/contrib/tools/python3/src/Python/clinic/context.c.h @@ -5,14 +5,14 @@ preserve PyDoc_STRVAR(_contextvars_Context_get__doc__, "get($self, key, default=None, /)\n" "--\n" -"\n" -"Return the value for `key` if `key` has the value in the context object.\n" -"\n" -"If `key` does not exist, return `default`. If `default` is not given,\n" -"return None."); +"\n" +"Return the value for `key` if `key` has the value in the context object.\n" +"\n" +"If `key` does not exist, return `default`. If `default` is not given,\n" +"return None."); #define _CONTEXTVARS_CONTEXT_GET_METHODDEF \ - {"get", (PyCFunction)(void(*)(void))_contextvars_Context_get, METH_FASTCALL, _contextvars_Context_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_contextvars_Context_get, METH_FASTCALL, _contextvars_Context_get__doc__}, static PyObject * _contextvars_Context_get_impl(PyContext *self, PyObject *key, @@ -25,15 +25,15 @@ _contextvars_Context_get(PyContext *self, PyObject *const *args, Py_ssize_t narg PyObject *key; PyObject *default_value = Py_None; - if (!_PyArg_CheckPositional("get", nargs, 1, 2)) { + if (!_PyArg_CheckPositional("get", nargs, 1, 2)) { goto exit; } - key = args[0]; - if (nargs < 2) { - goto skip_optional; - } - default_value = args[1]; -skip_optional: + key = args[0]; + if (nargs < 2) { + goto skip_optional; + } + default_value = args[1]; +skip_optional: return_value = _contextvars_Context_get_impl(self, key, default_value); exit: @@ -43,10 +43,10 @@ exit: PyDoc_STRVAR(_contextvars_Context_items__doc__, "items($self, /)\n" "--\n" -"\n" -"Return all variables and their values in the context object.\n" -"\n" -"The result is returned as a list of 2-tuples (variable, value)."); +"\n" +"Return all variables and their values in the context object.\n" +"\n" +"The result is returned as a list of 2-tuples (variable, value)."); #define _CONTEXTVARS_CONTEXT_ITEMS_METHODDEF \ {"items", (PyCFunction)_contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__}, @@ -63,8 +63,8 @@ _contextvars_Context_items(PyContext *self, PyObject *Py_UNUSED(ignored)) PyDoc_STRVAR(_contextvars_Context_keys__doc__, "keys($self, /)\n" "--\n" -"\n" -"Return a list of all variables in the context object."); +"\n" +"Return a list of all variables in the context object."); #define _CONTEXTVARS_CONTEXT_KEYS_METHODDEF \ {"keys", (PyCFunction)_contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__}, @@ -81,8 +81,8 @@ _contextvars_Context_keys(PyContext *self, PyObject *Py_UNUSED(ignored)) PyDoc_STRVAR(_contextvars_Context_values__doc__, "values($self, /)\n" "--\n" -"\n" -"Return a list of all variables\' values in the context object."); +"\n" +"Return a list of all variables\' values in the context object."); #define _CONTEXTVARS_CONTEXT_VALUES_METHODDEF \ {"values", (PyCFunction)_contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__}, @@ -99,8 +99,8 @@ _contextvars_Context_values(PyContext *self, PyObject *Py_UNUSED(ignored)) PyDoc_STRVAR(_contextvars_Context_copy__doc__, "copy($self, /)\n" "--\n" -"\n" -"Return a shallow copy of the context object."); +"\n" +"Return a shallow copy of the context object."); #define _CONTEXTVARS_CONTEXT_COPY_METHODDEF \ {"copy", (PyCFunction)_contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__}, @@ -115,19 +115,19 @@ _contextvars_Context_copy(PyContext *self, PyObject *Py_UNUSED(ignored)) } PyDoc_STRVAR(_contextvars_ContextVar_get__doc__, -"get($self, default=<unrepresentable>, /)\n" +"get($self, default=<unrepresentable>, /)\n" "--\n" -"\n" -"Return a value for the context variable for the current context.\n" -"\n" -"If there is no value for the variable in the current context, the method will:\n" -" * return the value of the default argument of the method, if provided; or\n" -" * return the default value for the context variable, if it was created\n" -" with one; or\n" -" * raise a LookupError."); +"\n" +"Return a value for the context variable for the current context.\n" +"\n" +"If there is no value for the variable in the current context, the method will:\n" +" * return the value of the default argument of the method, if provided; or\n" +" * return the default value for the context variable, if it was created\n" +" with one; or\n" +" * raise a LookupError."); #define _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF \ - {"get", (PyCFunction)(void(*)(void))_contextvars_ContextVar_get, METH_FASTCALL, _contextvars_ContextVar_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_contextvars_ContextVar_get, METH_FASTCALL, _contextvars_ContextVar_get__doc__}, static PyObject * _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value); @@ -138,14 +138,14 @@ _contextvars_ContextVar_get(PyContextVar *self, PyObject *const *args, Py_ssize_ PyObject *return_value = NULL; PyObject *default_value = NULL; - if (!_PyArg_CheckPositional("get", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("get", nargs, 0, 1)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - default_value = args[0]; -skip_optional: + if (nargs < 1) { + goto skip_optional; + } + default_value = args[0]; +skip_optional: return_value = _contextvars_ContextVar_get_impl(self, default_value); exit: @@ -155,13 +155,13 @@ exit: PyDoc_STRVAR(_contextvars_ContextVar_set__doc__, "set($self, value, /)\n" "--\n" -"\n" -"Call to set a new value for the context variable in the current context.\n" -"\n" -"The required value argument is the new value for the context variable.\n" -"\n" -"Returns a Token object that can be used to restore the variable to its previous\n" -"value via the `ContextVar.reset()` method."); +"\n" +"Call to set a new value for the context variable in the current context.\n" +"\n" +"The required value argument is the new value for the context variable.\n" +"\n" +"Returns a Token object that can be used to restore the variable to its previous\n" +"value via the `ContextVar.reset()` method."); #define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \ {"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, @@ -169,12 +169,12 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__, PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, "reset($self, token, /)\n" "--\n" -"\n" -"Reset the context variable.\n" -"\n" -"The variable is reset to the value it had before the `ContextVar.set()` that\n" -"created the token was used."); +"\n" +"Reset the context variable.\n" +"\n" +"The variable is reset to the value it had before the `ContextVar.set()` that\n" +"created the token was used."); #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, -/*[clinic end generated code: output=f2e42f34e358e179 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f2e42f34e358e179 input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/import.c.h b/contrib/tools/python3/src/Python/clinic/import.c.h index 50f3d415ab..e4867f34d4 100644 --- a/contrib/tools/python3/src/Python/clinic/import.c.h +++ b/contrib/tools/python3/src/Python/clinic/import.c.h @@ -75,7 +75,7 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__, " File path to use."); #define _IMP__FIX_CO_FILENAME_METHODDEF \ - {"_fix_co_filename", (PyCFunction)(void(*)(void))_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, + {"_fix_co_filename", (PyCFunction)(void(*)(void))_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, static PyObject * _imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code, @@ -88,22 +88,22 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyCodeObject *code; PyObject *path; - if (!_PyArg_CheckPositional("_fix_co_filename", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("_fix_co_filename", nargs, 2, 2)) { goto exit; } - if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { - _PyArg_BadArgument("_fix_co_filename", "argument 1", (&PyCode_Type)->tp_name, args[0]); - goto exit; - } - code = (PyCodeObject *)args[0]; - if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_fix_co_filename", "argument 2", "str", args[1]); - goto exit; - } - if (PyUnicode_READY(args[1]) == -1) { - goto exit; - } - path = args[1]; + if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { + _PyArg_BadArgument("_fix_co_filename", "argument 1", (&PyCode_Type)->tp_name, args[0]); + goto exit; + } + code = (PyCodeObject *)args[0]; + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("_fix_co_filename", "argument 2", "str", args[1]); + goto exit; + } + if (PyUnicode_READY(args[1]) == -1) { + goto exit; + } + path = args[1]; return_value = _imp__fix_co_filename_impl(module, code, path); exit: @@ -155,14 +155,14 @@ _imp_init_frozen(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("init_frozen", "argument", "str", arg); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("init_frozen", "argument", "str", arg); goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - name = arg; + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + name = arg; return_value = _imp_init_frozen_impl(module, name); exit: @@ -187,14 +187,14 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("get_frozen_object", "argument", "str", arg); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("get_frozen_object", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - name = arg; + name = arg; return_value = _imp_get_frozen_object_impl(module, name); exit: @@ -219,14 +219,14 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen_package", "argument", "str", arg); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("is_frozen_package", "argument", "str", arg); goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - name = arg; + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + name = arg; return_value = _imp_is_frozen_package_impl(module, name); exit: @@ -251,14 +251,14 @@ _imp_is_builtin(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_builtin", "argument", "str", arg); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("is_builtin", "argument", "str", arg); goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - name = arg; + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + name = arg; return_value = _imp_is_builtin_impl(module, name); exit: @@ -283,14 +283,14 @@ _imp_is_frozen(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen", "argument", "str", arg); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("is_frozen", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - name = arg; + name = arg; return_value = _imp_is_frozen_impl(module, name); exit: @@ -300,13 +300,13 @@ exit: #if defined(HAVE_DYNAMIC_LOADING) PyDoc_STRVAR(_imp_create_dynamic__doc__, -"create_dynamic($module, spec, file=<unrepresentable>, /)\n" +"create_dynamic($module, spec, file=<unrepresentable>, /)\n" "--\n" "\n" "Create an extension module."); #define _IMP_CREATE_DYNAMIC_METHODDEF \ - {"create_dynamic", (PyCFunction)(void(*)(void))_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, + {"create_dynamic", (PyCFunction)(void(*)(void))_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, static PyObject * _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file); @@ -318,15 +318,15 @@ _imp_create_dynamic(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *spec; PyObject *file = NULL; - if (!_PyArg_CheckPositional("create_dynamic", nargs, 1, 2)) { + if (!_PyArg_CheckPositional("create_dynamic", nargs, 1, 2)) { goto exit; } - spec = args[0]; - if (nargs < 2) { - goto skip_optional; - } - file = args[1]; -skip_optional: + spec = args[0]; + if (nargs < 2) { + goto skip_optional; + } + file = args[1]; +skip_optional: return_value = _imp_create_dynamic_impl(module, spec, file); exit: @@ -401,7 +401,7 @@ PyDoc_STRVAR(_imp_source_hash__doc__, "\n"); #define _IMP_SOURCE_HASH_METHODDEF \ - {"source_hash", (PyCFunction)(void(*)(void))_imp_source_hash, METH_FASTCALL|METH_KEYWORDS, _imp_source_hash__doc__}, + {"source_hash", (PyCFunction)(void(*)(void))_imp_source_hash, METH_FASTCALL|METH_KEYWORDS, _imp_source_hash__doc__}, static PyObject * _imp_source_hash_impl(PyObject *module, long key, Py_buffer *source); @@ -411,31 +411,31 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb { PyObject *return_value = NULL; static const char * const _keywords[] = {"key", "source", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "source_hash", 0}; - PyObject *argsbuf[2]; + static _PyArg_Parser _parser = {NULL, _keywords, "source_hash", 0}; + PyObject *argsbuf[2]; long key; Py_buffer source = {NULL, NULL}; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + key = PyLong_AsLong(args[0]); + if (key == -1 && PyErr_Occurred()) { + goto exit; + } + if (PyObject_GetBuffer(args[1], &source, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&source, 'C')) { + _PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]); goto exit; } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - key = PyLong_AsLong(args[0]); - if (key == -1 && PyErr_Occurred()) { - goto exit; - } - if (PyObject_GetBuffer(args[1], &source, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&source, 'C')) { - _PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]); - goto exit; - } return_value = _imp_source_hash_impl(module, key, &source); exit: @@ -454,4 +454,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=3dc495e9c64d944e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3dc495e9c64d944e input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/marshal.c.h b/contrib/tools/python3/src/Python/clinic/marshal.c.h index 9064651287..05d4830c4a 100644 --- a/contrib/tools/python3/src/Python/clinic/marshal.c.h +++ b/contrib/tools/python3/src/Python/clinic/marshal.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(marshal_dump__doc__, "to the file. The object will not be properly read back by load()."); #define MARSHAL_DUMP_METHODDEF \ - {"dump", (PyCFunction)(void(*)(void))marshal_dump, METH_FASTCALL, marshal_dump__doc__}, + {"dump", (PyCFunction)(void(*)(void))marshal_dump, METH_FASTCALL, marshal_dump__doc__}, static PyObject * marshal_dump_impl(PyObject *module, PyObject *value, PyObject *file, @@ -34,24 +34,24 @@ marshal_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *file; int version = Py_MARSHAL_VERSION; - if (!_PyArg_CheckPositional("dump", nargs, 2, 3)) { + if (!_PyArg_CheckPositional("dump", nargs, 2, 3)) { goto exit; } - value = args[0]; - file = args[1]; - if (nargs < 3) { - goto skip_optional; - } - if (PyFloat_Check(args[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - version = _PyLong_AsInt(args[2]); - if (version == -1 && PyErr_Occurred()) { - goto exit; - } -skip_optional: + value = args[0]; + file = args[1]; + if (nargs < 3) { + goto skip_optional; + } + if (PyFloat_Check(args[2])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + version = _PyLong_AsInt(args[2]); + if (version == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: return_value = marshal_dump_impl(module, value, file, version); exit: @@ -92,7 +92,7 @@ PyDoc_STRVAR(marshal_dumps__doc__, "unsupported type."); #define MARSHAL_DUMPS_METHODDEF \ - {"dumps", (PyCFunction)(void(*)(void))marshal_dumps, METH_FASTCALL, marshal_dumps__doc__}, + {"dumps", (PyCFunction)(void(*)(void))marshal_dumps, METH_FASTCALL, marshal_dumps__doc__}, static PyObject * marshal_dumps_impl(PyObject *module, PyObject *value, int version); @@ -104,23 +104,23 @@ marshal_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs) PyObject *value; int version = Py_MARSHAL_VERSION; - if (!_PyArg_CheckPositional("dumps", nargs, 1, 2)) { + if (!_PyArg_CheckPositional("dumps", nargs, 1, 2)) { + goto exit; + } + value = args[0]; + if (nargs < 2) { + goto skip_optional; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + version = _PyLong_AsInt(args[1]); + if (version == -1 && PyErr_Occurred()) { goto exit; } - value = args[0]; - if (nargs < 2) { - goto skip_optional; - } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - version = _PyLong_AsInt(args[1]); - if (version == -1 && PyErr_Occurred()) { - goto exit; - } -skip_optional: +skip_optional: return_value = marshal_dumps_impl(module, value, version); exit: @@ -148,13 +148,13 @@ marshal_loads(PyObject *module, PyObject *arg) PyObject *return_value = NULL; Py_buffer bytes = {NULL, NULL}; - if (PyObject_GetBuffer(arg, &bytes, PyBUF_SIMPLE) != 0) { + if (PyObject_GetBuffer(arg, &bytes, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&bytes, 'C')) { + _PyArg_BadArgument("loads", "argument", "contiguous buffer", arg); goto exit; } - if (!PyBuffer_IsContiguous(&bytes, 'C')) { - _PyArg_BadArgument("loads", "argument", "contiguous buffer", arg); - goto exit; - } return_value = marshal_loads_impl(module, &bytes); exit: @@ -165,4 +165,4 @@ exit: return return_value; } -/*[clinic end generated code: output=a859dabe8b0afeb6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a859dabe8b0afeb6 input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/sysmodule.c.h b/contrib/tools/python3/src/Python/clinic/sysmodule.c.h index 36943eae35..4615ebaab5 100644 --- a/contrib/tools/python3/src/Python/clinic/sysmodule.c.h +++ b/contrib/tools/python3/src/Python/clinic/sysmodule.c.h @@ -2,404 +2,404 @@ preserve [clinic start generated code]*/ -PyDoc_STRVAR(sys_addaudithook__doc__, -"addaudithook($module, /, hook)\n" -"--\n" -"\n" -"Adds a new audit hook callback."); - -#define SYS_ADDAUDITHOOK_METHODDEF \ - {"addaudithook", (PyCFunction)(void(*)(void))sys_addaudithook, METH_FASTCALL|METH_KEYWORDS, sys_addaudithook__doc__}, - -static PyObject * -sys_addaudithook_impl(PyObject *module, PyObject *hook); - -static PyObject * -sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"hook", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "addaudithook", 0}; - PyObject *argsbuf[1]; - PyObject *hook; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { - goto exit; - } - hook = args[0]; - return_value = sys_addaudithook_impl(module, hook); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_displayhook__doc__, -"displayhook($module, object, /)\n" -"--\n" -"\n" -"Print an object to sys.stdout and also save it in builtins._"); - -#define SYS_DISPLAYHOOK_METHODDEF \ - {"displayhook", (PyCFunction)sys_displayhook, METH_O, sys_displayhook__doc__}, - -PyDoc_STRVAR(sys_excepthook__doc__, -"excepthook($module, exctype, value, traceback, /)\n" -"--\n" -"\n" -"Handle an exception by displaying it with a traceback on sys.stderr."); - -#define SYS_EXCEPTHOOK_METHODDEF \ - {"excepthook", (PyCFunction)(void(*)(void))sys_excepthook, METH_FASTCALL, sys_excepthook__doc__}, - -static PyObject * -sys_excepthook_impl(PyObject *module, PyObject *exctype, PyObject *value, - PyObject *traceback); - -static PyObject * -sys_excepthook(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - PyObject *exctype; - PyObject *value; - PyObject *traceback; - - if (!_PyArg_CheckPositional("excepthook", nargs, 3, 3)) { - goto exit; - } - exctype = args[0]; - value = args[1]; - traceback = args[2]; - return_value = sys_excepthook_impl(module, exctype, value, traceback); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_exc_info__doc__, -"exc_info($module, /)\n" -"--\n" -"\n" -"Return current exception information: (type, value, traceback).\n" -"\n" -"Return information about the most recent exception caught by an except\n" -"clause in the current stack frame or in an older stack frame."); - -#define SYS_EXC_INFO_METHODDEF \ - {"exc_info", (PyCFunction)sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, - -static PyObject * -sys_exc_info_impl(PyObject *module); - -static PyObject * -sys_exc_info(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_exc_info_impl(module); -} - -PyDoc_STRVAR(sys_unraisablehook__doc__, -"unraisablehook($module, unraisable, /)\n" -"--\n" -"\n" -"Handle an unraisable exception.\n" -"\n" -"The unraisable argument has the following attributes:\n" -"\n" -"* exc_type: Exception type.\n" -"* exc_value: Exception value, can be None.\n" -"* exc_traceback: Exception traceback, can be None.\n" -"* err_msg: Error message, can be None.\n" -"* object: Object causing the exception, can be None."); - -#define SYS_UNRAISABLEHOOK_METHODDEF \ - {"unraisablehook", (PyCFunction)sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, - -PyDoc_STRVAR(sys_exit__doc__, -"exit($module, status=None, /)\n" -"--\n" -"\n" -"Exit the interpreter by raising SystemExit(status).\n" -"\n" -"If the status is omitted or None, it defaults to zero (i.e., success).\n" -"If the status is an integer, it will be used as the system exit status.\n" -"If it is another kind of object, it will be printed and the system\n" -"exit status will be one (i.e., failure)."); - -#define SYS_EXIT_METHODDEF \ - {"exit", (PyCFunction)(void(*)(void))sys_exit, METH_FASTCALL, sys_exit__doc__}, - -static PyObject * -sys_exit_impl(PyObject *module, PyObject *status); - -static PyObject * -sys_exit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - PyObject *status = Py_None; - - if (!_PyArg_CheckPositional("exit", nargs, 0, 1)) { - goto exit; - } - if (nargs < 1) { - goto skip_optional; - } - status = args[0]; -skip_optional: - return_value = sys_exit_impl(module, status); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_getdefaultencoding__doc__, -"getdefaultencoding($module, /)\n" -"--\n" -"\n" -"Return the current default encoding used by the Unicode implementation."); - -#define SYS_GETDEFAULTENCODING_METHODDEF \ - {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, - -static PyObject * -sys_getdefaultencoding_impl(PyObject *module); - -static PyObject * -sys_getdefaultencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getdefaultencoding_impl(module); -} - -PyDoc_STRVAR(sys_getfilesystemencoding__doc__, -"getfilesystemencoding($module, /)\n" -"--\n" -"\n" -"Return the encoding used to convert Unicode filenames to OS filenames."); - -#define SYS_GETFILESYSTEMENCODING_METHODDEF \ - {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, - -static PyObject * -sys_getfilesystemencoding_impl(PyObject *module); - -static PyObject * -sys_getfilesystemencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getfilesystemencoding_impl(module); -} - -PyDoc_STRVAR(sys_getfilesystemencodeerrors__doc__, -"getfilesystemencodeerrors($module, /)\n" -"--\n" -"\n" -"Return the error mode used Unicode to OS filename conversion."); - -#define SYS_GETFILESYSTEMENCODEERRORS_METHODDEF \ - {"getfilesystemencodeerrors", (PyCFunction)sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, - -static PyObject * -sys_getfilesystemencodeerrors_impl(PyObject *module); - -static PyObject * -sys_getfilesystemencodeerrors(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getfilesystemencodeerrors_impl(module); -} - -PyDoc_STRVAR(sys_intern__doc__, -"intern($module, string, /)\n" -"--\n" -"\n" -"``Intern\'\' the given string.\n" -"\n" -"This enters the string in the (global) table of interned strings whose\n" -"purpose is to speed up dictionary lookups. Return the string itself or\n" -"the previously interned string object with the same value."); - -#define SYS_INTERN_METHODDEF \ - {"intern", (PyCFunction)sys_intern, METH_O, sys_intern__doc__}, - -static PyObject * -sys_intern_impl(PyObject *module, PyObject *s); - -static PyObject * -sys_intern(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - PyObject *s; - - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("intern", "argument", "str", arg); - goto exit; - } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } - s = arg; - return_value = sys_intern_impl(module, s); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_gettrace__doc__, -"gettrace($module, /)\n" -"--\n" -"\n" -"Return the global debug tracing function set with sys.settrace.\n" -"\n" -"See the debugger chapter in the library manual."); - -#define SYS_GETTRACE_METHODDEF \ - {"gettrace", (PyCFunction)sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, - -static PyObject * -sys_gettrace_impl(PyObject *module); - -static PyObject * -sys_gettrace(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_gettrace_impl(module); -} - -PyDoc_STRVAR(sys_getprofile__doc__, -"getprofile($module, /)\n" -"--\n" -"\n" -"Return the profiling function set with sys.setprofile.\n" -"\n" -"See the profiler chapter in the library manual."); - -#define SYS_GETPROFILE_METHODDEF \ - {"getprofile", (PyCFunction)sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, - -static PyObject * -sys_getprofile_impl(PyObject *module); - -static PyObject * -sys_getprofile(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getprofile_impl(module); -} - -PyDoc_STRVAR(sys_setswitchinterval__doc__, -"setswitchinterval($module, interval, /)\n" -"--\n" -"\n" -"Set the ideal thread switching delay inside the Python interpreter.\n" -"\n" -"The actual frequency of switching threads can be lower if the\n" -"interpreter executes long sequences of uninterruptible code\n" -"(this is implementation-specific and workload-dependent).\n" -"\n" -"The parameter must represent the desired switching delay in seconds\n" -"A typical value is 0.005 (5 milliseconds)."); - -#define SYS_SETSWITCHINTERVAL_METHODDEF \ - {"setswitchinterval", (PyCFunction)sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, - -static PyObject * -sys_setswitchinterval_impl(PyObject *module, double interval); - -static PyObject * -sys_setswitchinterval(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - double interval; - - if (PyFloat_CheckExact(arg)) { - interval = PyFloat_AS_DOUBLE(arg); - } - else - { - interval = PyFloat_AsDouble(arg); - if (interval == -1.0 && PyErr_Occurred()) { - goto exit; - } - } - return_value = sys_setswitchinterval_impl(module, interval); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_getswitchinterval__doc__, -"getswitchinterval($module, /)\n" -"--\n" -"\n" -"Return the current thread switch interval; see sys.setswitchinterval()."); - -#define SYS_GETSWITCHINTERVAL_METHODDEF \ - {"getswitchinterval", (PyCFunction)sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, - -static double -sys_getswitchinterval_impl(PyObject *module); - -static PyObject * -sys_getswitchinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - PyObject *return_value = NULL; - double _return_value; - - _return_value = sys_getswitchinterval_impl(module); - if ((_return_value == -1.0) && PyErr_Occurred()) { - goto exit; - } - return_value = PyFloat_FromDouble(_return_value); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys_setrecursionlimit__doc__, -"setrecursionlimit($module, limit, /)\n" -"--\n" -"\n" -"Set the maximum depth of the Python interpreter stack to n.\n" -"\n" -"This limit prevents infinite recursion from causing an overflow of the C\n" -"stack and crashing Python. The highest possible limit is platform-\n" -"dependent."); - -#define SYS_SETRECURSIONLIMIT_METHODDEF \ - {"setrecursionlimit", (PyCFunction)sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, - -static PyObject * -sys_setrecursionlimit_impl(PyObject *module, int new_limit); - -static PyObject * -sys_setrecursionlimit(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - int new_limit; - - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - new_limit = _PyLong_AsInt(arg); - if (new_limit == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = sys_setrecursionlimit_impl(module, new_limit); - -exit: - return return_value; -} - +PyDoc_STRVAR(sys_addaudithook__doc__, +"addaudithook($module, /, hook)\n" +"--\n" +"\n" +"Adds a new audit hook callback."); + +#define SYS_ADDAUDITHOOK_METHODDEF \ + {"addaudithook", (PyCFunction)(void(*)(void))sys_addaudithook, METH_FASTCALL|METH_KEYWORDS, sys_addaudithook__doc__}, + +static PyObject * +sys_addaudithook_impl(PyObject *module, PyObject *hook); + +static PyObject * +sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"hook", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "addaudithook", 0}; + PyObject *argsbuf[1]; + PyObject *hook; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { + goto exit; + } + hook = args[0]; + return_value = sys_addaudithook_impl(module, hook); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_displayhook__doc__, +"displayhook($module, object, /)\n" +"--\n" +"\n" +"Print an object to sys.stdout and also save it in builtins._"); + +#define SYS_DISPLAYHOOK_METHODDEF \ + {"displayhook", (PyCFunction)sys_displayhook, METH_O, sys_displayhook__doc__}, + +PyDoc_STRVAR(sys_excepthook__doc__, +"excepthook($module, exctype, value, traceback, /)\n" +"--\n" +"\n" +"Handle an exception by displaying it with a traceback on sys.stderr."); + +#define SYS_EXCEPTHOOK_METHODDEF \ + {"excepthook", (PyCFunction)(void(*)(void))sys_excepthook, METH_FASTCALL, sys_excepthook__doc__}, + +static PyObject * +sys_excepthook_impl(PyObject *module, PyObject *exctype, PyObject *value, + PyObject *traceback); + +static PyObject * +sys_excepthook(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *exctype; + PyObject *value; + PyObject *traceback; + + if (!_PyArg_CheckPositional("excepthook", nargs, 3, 3)) { + goto exit; + } + exctype = args[0]; + value = args[1]; + traceback = args[2]; + return_value = sys_excepthook_impl(module, exctype, value, traceback); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_exc_info__doc__, +"exc_info($module, /)\n" +"--\n" +"\n" +"Return current exception information: (type, value, traceback).\n" +"\n" +"Return information about the most recent exception caught by an except\n" +"clause in the current stack frame or in an older stack frame."); + +#define SYS_EXC_INFO_METHODDEF \ + {"exc_info", (PyCFunction)sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, + +static PyObject * +sys_exc_info_impl(PyObject *module); + +static PyObject * +sys_exc_info(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_exc_info_impl(module); +} + +PyDoc_STRVAR(sys_unraisablehook__doc__, +"unraisablehook($module, unraisable, /)\n" +"--\n" +"\n" +"Handle an unraisable exception.\n" +"\n" +"The unraisable argument has the following attributes:\n" +"\n" +"* exc_type: Exception type.\n" +"* exc_value: Exception value, can be None.\n" +"* exc_traceback: Exception traceback, can be None.\n" +"* err_msg: Error message, can be None.\n" +"* object: Object causing the exception, can be None."); + +#define SYS_UNRAISABLEHOOK_METHODDEF \ + {"unraisablehook", (PyCFunction)sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, + +PyDoc_STRVAR(sys_exit__doc__, +"exit($module, status=None, /)\n" +"--\n" +"\n" +"Exit the interpreter by raising SystemExit(status).\n" +"\n" +"If the status is omitted or None, it defaults to zero (i.e., success).\n" +"If the status is an integer, it will be used as the system exit status.\n" +"If it is another kind of object, it will be printed and the system\n" +"exit status will be one (i.e., failure)."); + +#define SYS_EXIT_METHODDEF \ + {"exit", (PyCFunction)(void(*)(void))sys_exit, METH_FASTCALL, sys_exit__doc__}, + +static PyObject * +sys_exit_impl(PyObject *module, PyObject *status); + +static PyObject * +sys_exit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *status = Py_None; + + if (!_PyArg_CheckPositional("exit", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + status = args[0]; +skip_optional: + return_value = sys_exit_impl(module, status); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_getdefaultencoding__doc__, +"getdefaultencoding($module, /)\n" +"--\n" +"\n" +"Return the current default encoding used by the Unicode implementation."); + +#define SYS_GETDEFAULTENCODING_METHODDEF \ + {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, + +static PyObject * +sys_getdefaultencoding_impl(PyObject *module); + +static PyObject * +sys_getdefaultencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getdefaultencoding_impl(module); +} + +PyDoc_STRVAR(sys_getfilesystemencoding__doc__, +"getfilesystemencoding($module, /)\n" +"--\n" +"\n" +"Return the encoding used to convert Unicode filenames to OS filenames."); + +#define SYS_GETFILESYSTEMENCODING_METHODDEF \ + {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, + +static PyObject * +sys_getfilesystemencoding_impl(PyObject *module); + +static PyObject * +sys_getfilesystemencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getfilesystemencoding_impl(module); +} + +PyDoc_STRVAR(sys_getfilesystemencodeerrors__doc__, +"getfilesystemencodeerrors($module, /)\n" +"--\n" +"\n" +"Return the error mode used Unicode to OS filename conversion."); + +#define SYS_GETFILESYSTEMENCODEERRORS_METHODDEF \ + {"getfilesystemencodeerrors", (PyCFunction)sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, + +static PyObject * +sys_getfilesystemencodeerrors_impl(PyObject *module); + +static PyObject * +sys_getfilesystemencodeerrors(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getfilesystemencodeerrors_impl(module); +} + +PyDoc_STRVAR(sys_intern__doc__, +"intern($module, string, /)\n" +"--\n" +"\n" +"``Intern\'\' the given string.\n" +"\n" +"This enters the string in the (global) table of interned strings whose\n" +"purpose is to speed up dictionary lookups. Return the string itself or\n" +"the previously interned string object with the same value."); + +#define SYS_INTERN_METHODDEF \ + {"intern", (PyCFunction)sys_intern, METH_O, sys_intern__doc__}, + +static PyObject * +sys_intern_impl(PyObject *module, PyObject *s); + +static PyObject * +sys_intern(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *s; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("intern", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + s = arg; + return_value = sys_intern_impl(module, s); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_gettrace__doc__, +"gettrace($module, /)\n" +"--\n" +"\n" +"Return the global debug tracing function set with sys.settrace.\n" +"\n" +"See the debugger chapter in the library manual."); + +#define SYS_GETTRACE_METHODDEF \ + {"gettrace", (PyCFunction)sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, + +static PyObject * +sys_gettrace_impl(PyObject *module); + +static PyObject * +sys_gettrace(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_gettrace_impl(module); +} + +PyDoc_STRVAR(sys_getprofile__doc__, +"getprofile($module, /)\n" +"--\n" +"\n" +"Return the profiling function set with sys.setprofile.\n" +"\n" +"See the profiler chapter in the library manual."); + +#define SYS_GETPROFILE_METHODDEF \ + {"getprofile", (PyCFunction)sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, + +static PyObject * +sys_getprofile_impl(PyObject *module); + +static PyObject * +sys_getprofile(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getprofile_impl(module); +} + +PyDoc_STRVAR(sys_setswitchinterval__doc__, +"setswitchinterval($module, interval, /)\n" +"--\n" +"\n" +"Set the ideal thread switching delay inside the Python interpreter.\n" +"\n" +"The actual frequency of switching threads can be lower if the\n" +"interpreter executes long sequences of uninterruptible code\n" +"(this is implementation-specific and workload-dependent).\n" +"\n" +"The parameter must represent the desired switching delay in seconds\n" +"A typical value is 0.005 (5 milliseconds)."); + +#define SYS_SETSWITCHINTERVAL_METHODDEF \ + {"setswitchinterval", (PyCFunction)sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, + +static PyObject * +sys_setswitchinterval_impl(PyObject *module, double interval); + +static PyObject * +sys_setswitchinterval(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + double interval; + + if (PyFloat_CheckExact(arg)) { + interval = PyFloat_AS_DOUBLE(arg); + } + else + { + interval = PyFloat_AsDouble(arg); + if (interval == -1.0 && PyErr_Occurred()) { + goto exit; + } + } + return_value = sys_setswitchinterval_impl(module, interval); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_getswitchinterval__doc__, +"getswitchinterval($module, /)\n" +"--\n" +"\n" +"Return the current thread switch interval; see sys.setswitchinterval()."); + +#define SYS_GETSWITCHINTERVAL_METHODDEF \ + {"getswitchinterval", (PyCFunction)sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, + +static double +sys_getswitchinterval_impl(PyObject *module); + +static PyObject * +sys_getswitchinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + double _return_value; + + _return_value = sys_getswitchinterval_impl(module); + if ((_return_value == -1.0) && PyErr_Occurred()) { + goto exit; + } + return_value = PyFloat_FromDouble(_return_value); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys_setrecursionlimit__doc__, +"setrecursionlimit($module, limit, /)\n" +"--\n" +"\n" +"Set the maximum depth of the Python interpreter stack to n.\n" +"\n" +"This limit prevents infinite recursion from causing an overflow of the C\n" +"stack and crashing Python. The highest possible limit is platform-\n" +"dependent."); + +#define SYS_SETRECURSIONLIMIT_METHODDEF \ + {"setrecursionlimit", (PyCFunction)sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, + +static PyObject * +sys_setrecursionlimit_impl(PyObject *module, int new_limit); + +static PyObject * +sys_setrecursionlimit(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int new_limit; + + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + new_limit = _PyLong_AsInt(arg); + if (new_limit == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = sys_setrecursionlimit_impl(module, new_limit); + +exit: + return return_value; +} + PyDoc_STRVAR(sys_set_coroutine_origin_tracking_depth__doc__, "set_coroutine_origin_tracking_depth($module, /, depth)\n" "--\n" "\n" "Enable or disable origin tracking for coroutine objects in this thread.\n" "\n" -"Coroutine objects will track \'depth\' frames of traceback information\n" -"about where they came from, available in their cr_origin attribute.\n" -"\n" -"Set a depth of 0 to disable."); +"Coroutine objects will track \'depth\' frames of traceback information\n" +"about where they came from, available in their cr_origin attribute.\n" +"\n" +"Set a depth of 0 to disable."); #define SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF \ - {"set_coroutine_origin_tracking_depth", (PyCFunction)(void(*)(void))sys_set_coroutine_origin_tracking_depth, METH_FASTCALL|METH_KEYWORDS, sys_set_coroutine_origin_tracking_depth__doc__}, + {"set_coroutine_origin_tracking_depth", (PyCFunction)(void(*)(void))sys_set_coroutine_origin_tracking_depth, METH_FASTCALL|METH_KEYWORDS, sys_set_coroutine_origin_tracking_depth__doc__}, static PyObject * sys_set_coroutine_origin_tracking_depth_impl(PyObject *module, int depth); @@ -409,23 +409,23 @@ sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args, { PyObject *return_value = NULL; static const char * const _keywords[] = {"depth", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "set_coroutine_origin_tracking_depth", 0}; - PyObject *argsbuf[1]; + static _PyArg_Parser _parser = {NULL, _keywords, "set_coroutine_origin_tracking_depth", 0}; + PyObject *argsbuf[1]; int depth; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + depth = _PyLong_AsInt(args[0]); + if (depth == -1 && PyErr_Occurred()) { goto exit; } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - depth = _PyLong_AsInt(args[0]); - if (depth == -1 && PyErr_Occurred()) { - goto exit; - } return_value = sys_set_coroutine_origin_tracking_depth_impl(module, depth); exit: @@ -459,515 +459,515 @@ sys_get_coroutine_origin_tracking_depth(PyObject *module, PyObject *Py_UNUSED(ig exit: return return_value; } - -PyDoc_STRVAR(sys_get_asyncgen_hooks__doc__, -"get_asyncgen_hooks($module, /)\n" -"--\n" -"\n" -"Return the installed asynchronous generators hooks.\n" -"\n" -"This returns a namedtuple of the form (firstiter, finalizer)."); - -#define SYS_GET_ASYNCGEN_HOOKS_METHODDEF \ - {"get_asyncgen_hooks", (PyCFunction)sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, - -static PyObject * -sys_get_asyncgen_hooks_impl(PyObject *module); - -static PyObject * -sys_get_asyncgen_hooks(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_get_asyncgen_hooks_impl(module); -} - -PyDoc_STRVAR(sys_getrecursionlimit__doc__, -"getrecursionlimit($module, /)\n" -"--\n" -"\n" -"Return the current value of the recursion limit.\n" -"\n" -"The recursion limit is the maximum depth of the Python interpreter\n" -"stack. This limit prevents infinite recursion from causing an overflow\n" -"of the C stack and crashing Python."); - -#define SYS_GETRECURSIONLIMIT_METHODDEF \ - {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, - -static PyObject * -sys_getrecursionlimit_impl(PyObject *module); - -static PyObject * -sys_getrecursionlimit(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getrecursionlimit_impl(module); -} - -#if defined(MS_WINDOWS) - -PyDoc_STRVAR(sys_getwindowsversion__doc__, -"getwindowsversion($module, /)\n" -"--\n" -"\n" -"Return info about the running version of Windows as a named tuple.\n" -"\n" -"The members are named: major, minor, build, platform, service_pack,\n" -"service_pack_major, service_pack_minor, suite_mask, product_type and\n" -"platform_version. For backward compatibility, only the first 5 items\n" -"are available by indexing. All elements are numbers, except\n" -"service_pack and platform_type which are strings, and platform_version\n" -"which is a 3-tuple. Platform is always 2. Product_type may be 1 for a\n" -"workstation, 2 for a domain controller, 3 for a server.\n" -"Platform_version is a 3-tuple containing a version number that is\n" -"intended for identifying the OS rather than feature detection."); - -#define SYS_GETWINDOWSVERSION_METHODDEF \ - {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, - -static PyObject * -sys_getwindowsversion_impl(PyObject *module); - -static PyObject * -sys_getwindowsversion(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getwindowsversion_impl(module); -} - -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - -PyDoc_STRVAR(sys__enablelegacywindowsfsencoding__doc__, -"_enablelegacywindowsfsencoding($module, /)\n" -"--\n" -"\n" -"Changes the default filesystem encoding to mbcs:replace.\n" -"\n" -"This is done for consistency with earlier versions of Python. See PEP\n" -"529 for more information.\n" -"\n" -"This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING\n" -"environment variable before launching Python."); - -#define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF \ - {"_enablelegacywindowsfsencoding", (PyCFunction)sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, - -static PyObject * -sys__enablelegacywindowsfsencoding_impl(PyObject *module); - -static PyObject * -sys__enablelegacywindowsfsencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys__enablelegacywindowsfsencoding_impl(module); -} - -#endif /* defined(MS_WINDOWS) */ - -#if defined(HAVE_DLOPEN) - -PyDoc_STRVAR(sys_setdlopenflags__doc__, -"setdlopenflags($module, flags, /)\n" -"--\n" -"\n" -"Set the flags used by the interpreter for dlopen calls.\n" -"\n" -"This is used, for example, when the interpreter loads extension\n" -"modules. Among other things, this will enable a lazy resolving of\n" -"symbols when importing a module, if called as sys.setdlopenflags(0).\n" -"To share symbols across extension modules, call as\n" -"sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag\n" -"modules can be found in the os module (RTLD_xxx constants, e.g.\n" -"os.RTLD_LAZY)."); - -#define SYS_SETDLOPENFLAGS_METHODDEF \ - {"setdlopenflags", (PyCFunction)sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, - -static PyObject * -sys_setdlopenflags_impl(PyObject *module, int new_val); - -static PyObject * -sys_setdlopenflags(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - int new_val; - - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - new_val = _PyLong_AsInt(arg); - if (new_val == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = sys_setdlopenflags_impl(module, new_val); - -exit: - return return_value; -} - -#endif /* defined(HAVE_DLOPEN) */ - -#if defined(HAVE_DLOPEN) - -PyDoc_STRVAR(sys_getdlopenflags__doc__, -"getdlopenflags($module, /)\n" -"--\n" -"\n" -"Return the current value of the flags that are used for dlopen calls.\n" -"\n" -"The flag constants are defined in the os module."); - -#define SYS_GETDLOPENFLAGS_METHODDEF \ - {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, - -static PyObject * -sys_getdlopenflags_impl(PyObject *module); - -static PyObject * -sys_getdlopenflags(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getdlopenflags_impl(module); -} - -#endif /* defined(HAVE_DLOPEN) */ - -#if defined(USE_MALLOPT) - -PyDoc_STRVAR(sys_mdebug__doc__, -"mdebug($module, flag, /)\n" -"--\n" -"\n"); - -#define SYS_MDEBUG_METHODDEF \ - {"mdebug", (PyCFunction)sys_mdebug, METH_O, sys_mdebug__doc__}, - -static PyObject * -sys_mdebug_impl(PyObject *module, int flag); - -static PyObject * -sys_mdebug(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - int flag; - - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - flag = _PyLong_AsInt(arg); - if (flag == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = sys_mdebug_impl(module, flag); - -exit: - return return_value; -} - -#endif /* defined(USE_MALLOPT) */ - -PyDoc_STRVAR(sys_getrefcount__doc__, -"getrefcount($module, object, /)\n" -"--\n" -"\n" -"Return the reference count of object.\n" -"\n" -"The count returned is generally one higher than you might expect,\n" -"because it includes the (temporary) reference as an argument to\n" -"getrefcount()."); - -#define SYS_GETREFCOUNT_METHODDEF \ - {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, sys_getrefcount__doc__}, - -static Py_ssize_t -sys_getrefcount_impl(PyObject *module, PyObject *object); - -static PyObject * -sys_getrefcount(PyObject *module, PyObject *object) -{ - PyObject *return_value = NULL; - Py_ssize_t _return_value; - - _return_value = sys_getrefcount_impl(module, object); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromSsize_t(_return_value); - -exit: - return return_value; -} - -#if defined(Py_REF_DEBUG) - -PyDoc_STRVAR(sys_gettotalrefcount__doc__, -"gettotalrefcount($module, /)\n" -"--\n" -"\n"); - -#define SYS_GETTOTALREFCOUNT_METHODDEF \ - {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, - -static Py_ssize_t -sys_gettotalrefcount_impl(PyObject *module); - -static PyObject * -sys_gettotalrefcount(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - PyObject *return_value = NULL; - Py_ssize_t _return_value; - - _return_value = sys_gettotalrefcount_impl(module); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromSsize_t(_return_value); - -exit: - return return_value; -} - -#endif /* defined(Py_REF_DEBUG) */ - -PyDoc_STRVAR(sys_getallocatedblocks__doc__, -"getallocatedblocks($module, /)\n" -"--\n" -"\n" -"Return the number of memory blocks currently allocated."); - -#define SYS_GETALLOCATEDBLOCKS_METHODDEF \ - {"getallocatedblocks", (PyCFunction)sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, - -static Py_ssize_t -sys_getallocatedblocks_impl(PyObject *module); - -static PyObject * -sys_getallocatedblocks(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - PyObject *return_value = NULL; - Py_ssize_t _return_value; - - _return_value = sys_getallocatedblocks_impl(module); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromSsize_t(_return_value); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys__getframe__doc__, -"_getframe($module, depth=0, /)\n" -"--\n" -"\n" -"Return a frame object from the call stack.\n" -"\n" -"If optional integer depth is given, return the frame object that many\n" -"calls below the top of the stack. If that is deeper than the call\n" -"stack, ValueError is raised. The default for depth is zero, returning\n" -"the frame at the top of the call stack.\n" -"\n" -"This function should be used for internal and specialized purposes\n" -"only."); - -#define SYS__GETFRAME_METHODDEF \ - {"_getframe", (PyCFunction)(void(*)(void))sys__getframe, METH_FASTCALL, sys__getframe__doc__}, - -static PyObject * -sys__getframe_impl(PyObject *module, int depth); - -static PyObject * -sys__getframe(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - int depth = 0; - - if (!_PyArg_CheckPositional("_getframe", nargs, 0, 1)) { - goto exit; - } - if (nargs < 1) { - goto skip_optional; - } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - depth = _PyLong_AsInt(args[0]); - if (depth == -1 && PyErr_Occurred()) { - goto exit; - } -skip_optional: - return_value = sys__getframe_impl(module, depth); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys__current_frames__doc__, -"_current_frames($module, /)\n" -"--\n" -"\n" -"Return a dict mapping each thread\'s thread id to its current stack frame.\n" -"\n" -"This function should be used for specialized purposes only."); - -#define SYS__CURRENT_FRAMES_METHODDEF \ - {"_current_frames", (PyCFunction)sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, - -static PyObject * -sys__current_frames_impl(PyObject *module); - -static PyObject * -sys__current_frames(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys__current_frames_impl(module); -} - -PyDoc_STRVAR(sys_call_tracing__doc__, -"call_tracing($module, func, args, /)\n" -"--\n" -"\n" -"Call func(*args), while tracing is enabled.\n" -"\n" -"The tracing state is saved, and restored afterwards. This is intended\n" -"to be called from a debugger from a checkpoint, to recursively debug\n" -"some other code."); - -#define SYS_CALL_TRACING_METHODDEF \ - {"call_tracing", (PyCFunction)(void(*)(void))sys_call_tracing, METH_FASTCALL, sys_call_tracing__doc__}, - -static PyObject * -sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs); - -static PyObject * -sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - PyObject *func; - PyObject *funcargs; - - if (!_PyArg_CheckPositional("call_tracing", nargs, 2, 2)) { - goto exit; - } - func = args[0]; - if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("call_tracing", "argument 2", "tuple", args[1]); - goto exit; - } - funcargs = args[1]; - return_value = sys_call_tracing_impl(module, func, funcargs); - -exit: - return return_value; -} - -PyDoc_STRVAR(sys__debugmallocstats__doc__, -"_debugmallocstats($module, /)\n" -"--\n" -"\n" -"Print summary info to stderr about the state of pymalloc\'s structures.\n" -"\n" -"In Py_DEBUG mode, also perform some expensive internal consistency\n" -"checks."); - -#define SYS__DEBUGMALLOCSTATS_METHODDEF \ - {"_debugmallocstats", (PyCFunction)sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, - -static PyObject * -sys__debugmallocstats_impl(PyObject *module); - -static PyObject * -sys__debugmallocstats(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys__debugmallocstats_impl(module); -} - -PyDoc_STRVAR(sys__clear_type_cache__doc__, -"_clear_type_cache($module, /)\n" -"--\n" -"\n" -"Clear the internal type lookup cache."); - -#define SYS__CLEAR_TYPE_CACHE_METHODDEF \ - {"_clear_type_cache", (PyCFunction)sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, - -static PyObject * -sys__clear_type_cache_impl(PyObject *module); - -static PyObject * -sys__clear_type_cache(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys__clear_type_cache_impl(module); -} - -PyDoc_STRVAR(sys_is_finalizing__doc__, -"is_finalizing($module, /)\n" -"--\n" -"\n" -"Return True if Python is exiting."); - -#define SYS_IS_FINALIZING_METHODDEF \ - {"is_finalizing", (PyCFunction)sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, - -static PyObject * -sys_is_finalizing_impl(PyObject *module); - -static PyObject * -sys_is_finalizing(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_is_finalizing_impl(module); -} - -#if defined(ANDROID_API_LEVEL) - -PyDoc_STRVAR(sys_getandroidapilevel__doc__, -"getandroidapilevel($module, /)\n" -"--\n" -"\n" -"Return the build time API version of Android as an integer."); - -#define SYS_GETANDROIDAPILEVEL_METHODDEF \ - {"getandroidapilevel", (PyCFunction)sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, - -static PyObject * -sys_getandroidapilevel_impl(PyObject *module); - -static PyObject * -sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return sys_getandroidapilevel_impl(module); -} - -#endif /* defined(ANDROID_API_LEVEL) */ - -#ifndef SYS_GETWINDOWSVERSION_METHODDEF - #define SYS_GETWINDOWSVERSION_METHODDEF -#endif /* !defined(SYS_GETWINDOWSVERSION_METHODDEF) */ - -#ifndef SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF - #define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF -#endif /* !defined(SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF) */ - -#ifndef SYS_SETDLOPENFLAGS_METHODDEF - #define SYS_SETDLOPENFLAGS_METHODDEF -#endif /* !defined(SYS_SETDLOPENFLAGS_METHODDEF) */ - -#ifndef SYS_GETDLOPENFLAGS_METHODDEF - #define SYS_GETDLOPENFLAGS_METHODDEF -#endif /* !defined(SYS_GETDLOPENFLAGS_METHODDEF) */ - -#ifndef SYS_MDEBUG_METHODDEF - #define SYS_MDEBUG_METHODDEF -#endif /* !defined(SYS_MDEBUG_METHODDEF) */ - -#ifndef SYS_GETTOTALREFCOUNT_METHODDEF - #define SYS_GETTOTALREFCOUNT_METHODDEF -#endif /* !defined(SYS_GETTOTALREFCOUNT_METHODDEF) */ - -#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF - #define SYS_GETANDROIDAPILEVEL_METHODDEF -#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=39eb34a01fb9a919 input=a9049054013a1b77]*/ + +PyDoc_STRVAR(sys_get_asyncgen_hooks__doc__, +"get_asyncgen_hooks($module, /)\n" +"--\n" +"\n" +"Return the installed asynchronous generators hooks.\n" +"\n" +"This returns a namedtuple of the form (firstiter, finalizer)."); + +#define SYS_GET_ASYNCGEN_HOOKS_METHODDEF \ + {"get_asyncgen_hooks", (PyCFunction)sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, + +static PyObject * +sys_get_asyncgen_hooks_impl(PyObject *module); + +static PyObject * +sys_get_asyncgen_hooks(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_get_asyncgen_hooks_impl(module); +} + +PyDoc_STRVAR(sys_getrecursionlimit__doc__, +"getrecursionlimit($module, /)\n" +"--\n" +"\n" +"Return the current value of the recursion limit.\n" +"\n" +"The recursion limit is the maximum depth of the Python interpreter\n" +"stack. This limit prevents infinite recursion from causing an overflow\n" +"of the C stack and crashing Python."); + +#define SYS_GETRECURSIONLIMIT_METHODDEF \ + {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, + +static PyObject * +sys_getrecursionlimit_impl(PyObject *module); + +static PyObject * +sys_getrecursionlimit(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getrecursionlimit_impl(module); +} + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(sys_getwindowsversion__doc__, +"getwindowsversion($module, /)\n" +"--\n" +"\n" +"Return info about the running version of Windows as a named tuple.\n" +"\n" +"The members are named: major, minor, build, platform, service_pack,\n" +"service_pack_major, service_pack_minor, suite_mask, product_type and\n" +"platform_version. For backward compatibility, only the first 5 items\n" +"are available by indexing. All elements are numbers, except\n" +"service_pack and platform_type which are strings, and platform_version\n" +"which is a 3-tuple. Platform is always 2. Product_type may be 1 for a\n" +"workstation, 2 for a domain controller, 3 for a server.\n" +"Platform_version is a 3-tuple containing a version number that is\n" +"intended for identifying the OS rather than feature detection."); + +#define SYS_GETWINDOWSVERSION_METHODDEF \ + {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, + +static PyObject * +sys_getwindowsversion_impl(PyObject *module); + +static PyObject * +sys_getwindowsversion(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getwindowsversion_impl(module); +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(sys__enablelegacywindowsfsencoding__doc__, +"_enablelegacywindowsfsencoding($module, /)\n" +"--\n" +"\n" +"Changes the default filesystem encoding to mbcs:replace.\n" +"\n" +"This is done for consistency with earlier versions of Python. See PEP\n" +"529 for more information.\n" +"\n" +"This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING\n" +"environment variable before launching Python."); + +#define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF \ + {"_enablelegacywindowsfsencoding", (PyCFunction)sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, + +static PyObject * +sys__enablelegacywindowsfsencoding_impl(PyObject *module); + +static PyObject * +sys__enablelegacywindowsfsencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys__enablelegacywindowsfsencoding_impl(module); +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(HAVE_DLOPEN) + +PyDoc_STRVAR(sys_setdlopenflags__doc__, +"setdlopenflags($module, flags, /)\n" +"--\n" +"\n" +"Set the flags used by the interpreter for dlopen calls.\n" +"\n" +"This is used, for example, when the interpreter loads extension\n" +"modules. Among other things, this will enable a lazy resolving of\n" +"symbols when importing a module, if called as sys.setdlopenflags(0).\n" +"To share symbols across extension modules, call as\n" +"sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag\n" +"modules can be found in the os module (RTLD_xxx constants, e.g.\n" +"os.RTLD_LAZY)."); + +#define SYS_SETDLOPENFLAGS_METHODDEF \ + {"setdlopenflags", (PyCFunction)sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, + +static PyObject * +sys_setdlopenflags_impl(PyObject *module, int new_val); + +static PyObject * +sys_setdlopenflags(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int new_val; + + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + new_val = _PyLong_AsInt(arg); + if (new_val == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = sys_setdlopenflags_impl(module, new_val); + +exit: + return return_value; +} + +#endif /* defined(HAVE_DLOPEN) */ + +#if defined(HAVE_DLOPEN) + +PyDoc_STRVAR(sys_getdlopenflags__doc__, +"getdlopenflags($module, /)\n" +"--\n" +"\n" +"Return the current value of the flags that are used for dlopen calls.\n" +"\n" +"The flag constants are defined in the os module."); + +#define SYS_GETDLOPENFLAGS_METHODDEF \ + {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, + +static PyObject * +sys_getdlopenflags_impl(PyObject *module); + +static PyObject * +sys_getdlopenflags(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getdlopenflags_impl(module); +} + +#endif /* defined(HAVE_DLOPEN) */ + +#if defined(USE_MALLOPT) + +PyDoc_STRVAR(sys_mdebug__doc__, +"mdebug($module, flag, /)\n" +"--\n" +"\n"); + +#define SYS_MDEBUG_METHODDEF \ + {"mdebug", (PyCFunction)sys_mdebug, METH_O, sys_mdebug__doc__}, + +static PyObject * +sys_mdebug_impl(PyObject *module, int flag); + +static PyObject * +sys_mdebug(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int flag; + + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + flag = _PyLong_AsInt(arg); + if (flag == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = sys_mdebug_impl(module, flag); + +exit: + return return_value; +} + +#endif /* defined(USE_MALLOPT) */ + +PyDoc_STRVAR(sys_getrefcount__doc__, +"getrefcount($module, object, /)\n" +"--\n" +"\n" +"Return the reference count of object.\n" +"\n" +"The count returned is generally one higher than you might expect,\n" +"because it includes the (temporary) reference as an argument to\n" +"getrefcount()."); + +#define SYS_GETREFCOUNT_METHODDEF \ + {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, sys_getrefcount__doc__}, + +static Py_ssize_t +sys_getrefcount_impl(PyObject *module, PyObject *object); + +static PyObject * +sys_getrefcount(PyObject *module, PyObject *object) +{ + PyObject *return_value = NULL; + Py_ssize_t _return_value; + + _return_value = sys_getrefcount_impl(module, object); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromSsize_t(_return_value); + +exit: + return return_value; +} + +#if defined(Py_REF_DEBUG) + +PyDoc_STRVAR(sys_gettotalrefcount__doc__, +"gettotalrefcount($module, /)\n" +"--\n" +"\n"); + +#define SYS_GETTOTALREFCOUNT_METHODDEF \ + {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, + +static Py_ssize_t +sys_gettotalrefcount_impl(PyObject *module); + +static PyObject * +sys_gettotalrefcount(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + Py_ssize_t _return_value; + + _return_value = sys_gettotalrefcount_impl(module); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromSsize_t(_return_value); + +exit: + return return_value; +} + +#endif /* defined(Py_REF_DEBUG) */ + +PyDoc_STRVAR(sys_getallocatedblocks__doc__, +"getallocatedblocks($module, /)\n" +"--\n" +"\n" +"Return the number of memory blocks currently allocated."); + +#define SYS_GETALLOCATEDBLOCKS_METHODDEF \ + {"getallocatedblocks", (PyCFunction)sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, + +static Py_ssize_t +sys_getallocatedblocks_impl(PyObject *module); + +static PyObject * +sys_getallocatedblocks(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + Py_ssize_t _return_value; + + _return_value = sys_getallocatedblocks_impl(module); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromSsize_t(_return_value); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys__getframe__doc__, +"_getframe($module, depth=0, /)\n" +"--\n" +"\n" +"Return a frame object from the call stack.\n" +"\n" +"If optional integer depth is given, return the frame object that many\n" +"calls below the top of the stack. If that is deeper than the call\n" +"stack, ValueError is raised. The default for depth is zero, returning\n" +"the frame at the top of the call stack.\n" +"\n" +"This function should be used for internal and specialized purposes\n" +"only."); + +#define SYS__GETFRAME_METHODDEF \ + {"_getframe", (PyCFunction)(void(*)(void))sys__getframe, METH_FASTCALL, sys__getframe__doc__}, + +static PyObject * +sys__getframe_impl(PyObject *module, int depth); + +static PyObject * +sys__getframe(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int depth = 0; + + if (!_PyArg_CheckPositional("_getframe", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + depth = _PyLong_AsInt(args[0]); + if (depth == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: + return_value = sys__getframe_impl(module, depth); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys__current_frames__doc__, +"_current_frames($module, /)\n" +"--\n" +"\n" +"Return a dict mapping each thread\'s thread id to its current stack frame.\n" +"\n" +"This function should be used for specialized purposes only."); + +#define SYS__CURRENT_FRAMES_METHODDEF \ + {"_current_frames", (PyCFunction)sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, + +static PyObject * +sys__current_frames_impl(PyObject *module); + +static PyObject * +sys__current_frames(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys__current_frames_impl(module); +} + +PyDoc_STRVAR(sys_call_tracing__doc__, +"call_tracing($module, func, args, /)\n" +"--\n" +"\n" +"Call func(*args), while tracing is enabled.\n" +"\n" +"The tracing state is saved, and restored afterwards. This is intended\n" +"to be called from a debugger from a checkpoint, to recursively debug\n" +"some other code."); + +#define SYS_CALL_TRACING_METHODDEF \ + {"call_tracing", (PyCFunction)(void(*)(void))sys_call_tracing, METH_FASTCALL, sys_call_tracing__doc__}, + +static PyObject * +sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs); + +static PyObject * +sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *func; + PyObject *funcargs; + + if (!_PyArg_CheckPositional("call_tracing", nargs, 2, 2)) { + goto exit; + } + func = args[0]; + if (!PyTuple_Check(args[1])) { + _PyArg_BadArgument("call_tracing", "argument 2", "tuple", args[1]); + goto exit; + } + funcargs = args[1]; + return_value = sys_call_tracing_impl(module, func, funcargs); + +exit: + return return_value; +} + +PyDoc_STRVAR(sys__debugmallocstats__doc__, +"_debugmallocstats($module, /)\n" +"--\n" +"\n" +"Print summary info to stderr about the state of pymalloc\'s structures.\n" +"\n" +"In Py_DEBUG mode, also perform some expensive internal consistency\n" +"checks."); + +#define SYS__DEBUGMALLOCSTATS_METHODDEF \ + {"_debugmallocstats", (PyCFunction)sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, + +static PyObject * +sys__debugmallocstats_impl(PyObject *module); + +static PyObject * +sys__debugmallocstats(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys__debugmallocstats_impl(module); +} + +PyDoc_STRVAR(sys__clear_type_cache__doc__, +"_clear_type_cache($module, /)\n" +"--\n" +"\n" +"Clear the internal type lookup cache."); + +#define SYS__CLEAR_TYPE_CACHE_METHODDEF \ + {"_clear_type_cache", (PyCFunction)sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, + +static PyObject * +sys__clear_type_cache_impl(PyObject *module); + +static PyObject * +sys__clear_type_cache(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys__clear_type_cache_impl(module); +} + +PyDoc_STRVAR(sys_is_finalizing__doc__, +"is_finalizing($module, /)\n" +"--\n" +"\n" +"Return True if Python is exiting."); + +#define SYS_IS_FINALIZING_METHODDEF \ + {"is_finalizing", (PyCFunction)sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, + +static PyObject * +sys_is_finalizing_impl(PyObject *module); + +static PyObject * +sys_is_finalizing(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_is_finalizing_impl(module); +} + +#if defined(ANDROID_API_LEVEL) + +PyDoc_STRVAR(sys_getandroidapilevel__doc__, +"getandroidapilevel($module, /)\n" +"--\n" +"\n" +"Return the build time API version of Android as an integer."); + +#define SYS_GETANDROIDAPILEVEL_METHODDEF \ + {"getandroidapilevel", (PyCFunction)sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, + +static PyObject * +sys_getandroidapilevel_impl(PyObject *module); + +static PyObject * +sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return sys_getandroidapilevel_impl(module); +} + +#endif /* defined(ANDROID_API_LEVEL) */ + +#ifndef SYS_GETWINDOWSVERSION_METHODDEF + #define SYS_GETWINDOWSVERSION_METHODDEF +#endif /* !defined(SYS_GETWINDOWSVERSION_METHODDEF) */ + +#ifndef SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF + #define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF +#endif /* !defined(SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF) */ + +#ifndef SYS_SETDLOPENFLAGS_METHODDEF + #define SYS_SETDLOPENFLAGS_METHODDEF +#endif /* !defined(SYS_SETDLOPENFLAGS_METHODDEF) */ + +#ifndef SYS_GETDLOPENFLAGS_METHODDEF + #define SYS_GETDLOPENFLAGS_METHODDEF +#endif /* !defined(SYS_GETDLOPENFLAGS_METHODDEF) */ + +#ifndef SYS_MDEBUG_METHODDEF + #define SYS_MDEBUG_METHODDEF +#endif /* !defined(SYS_MDEBUG_METHODDEF) */ + +#ifndef SYS_GETTOTALREFCOUNT_METHODDEF + #define SYS_GETTOTALREFCOUNT_METHODDEF +#endif /* !defined(SYS_GETTOTALREFCOUNT_METHODDEF) */ + +#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF + #define SYS_GETANDROIDAPILEVEL_METHODDEF +#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ +/*[clinic end generated code: output=39eb34a01fb9a919 input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/clinic/traceback.c.h b/contrib/tools/python3/src/Python/clinic/traceback.c.h index 0fc5c844eb..04daf2a376 100644 --- a/contrib/tools/python3/src/Python/clinic/traceback.c.h +++ b/contrib/tools/python3/src/Python/clinic/traceback.c.h @@ -17,46 +17,46 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; static const char * const _keywords[] = {"tb_next", "tb_frame", "tb_lasti", "tb_lineno", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "TracebackType", 0}; - PyObject *argsbuf[4]; - PyObject * const *fastargs; - Py_ssize_t nargs = PyTuple_GET_SIZE(args); + static _PyArg_Parser _parser = {NULL, _keywords, "TracebackType", 0}; + PyObject *argsbuf[4]; + PyObject * const *fastargs; + Py_ssize_t nargs = PyTuple_GET_SIZE(args); PyObject *tb_next; PyFrameObject *tb_frame; int tb_lasti; int tb_lineno; - fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 4, 4, 0, argsbuf); - if (!fastargs) { + fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 4, 4, 0, argsbuf); + if (!fastargs) { + goto exit; + } + tb_next = fastargs[0]; + if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { + _PyArg_BadArgument("TracebackType", "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]); + goto exit; + } + tb_frame = (PyFrameObject *)fastargs[1]; + if (PyFloat_Check(fastargs[2])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + tb_lasti = _PyLong_AsInt(fastargs[2]); + if (tb_lasti == -1 && PyErr_Occurred()) { + goto exit; + } + if (PyFloat_Check(fastargs[3])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + tb_lineno = _PyLong_AsInt(fastargs[3]); + if (tb_lineno == -1 && PyErr_Occurred()) { goto exit; } - tb_next = fastargs[0]; - if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { - _PyArg_BadArgument("TracebackType", "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]); - goto exit; - } - tb_frame = (PyFrameObject *)fastargs[1]; - if (PyFloat_Check(fastargs[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - tb_lasti = _PyLong_AsInt(fastargs[2]); - if (tb_lasti == -1 && PyErr_Occurred()) { - goto exit; - } - if (PyFloat_Check(fastargs[3])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - tb_lineno = _PyLong_AsInt(fastargs[3]); - if (tb_lineno == -1 && PyErr_Occurred()) { - goto exit; - } return_value = tb_new_impl(type, tb_next, tb_frame, tb_lasti, tb_lineno); exit: return return_value; } -/*[clinic end generated code: output=3def6c06248feed8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3def6c06248feed8 input=a9049054013a1b77]*/ diff --git a/contrib/tools/python3/src/Python/codecs.c b/contrib/tools/python3/src/Python/codecs.c index 1970cb6180..0f18c27e5f 100644 --- a/contrib/tools/python3/src/Python/codecs.c +++ b/contrib/tools/python3/src/Python/codecs.c @@ -9,8 +9,8 @@ Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.codec_search_path -#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_interp.h" // PyInterpreterState.codec_search_path +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "ucnhash.h" #include <ctype.h> @@ -33,7 +33,7 @@ static int _PyCodecRegistry_Init(void); /* Forward */ int PyCodec_Register(PyObject *search_function) { - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) goto onError; if (search_function == NULL) { @@ -50,16 +50,16 @@ int PyCodec_Register(PyObject *search_function) return -1; } -extern int _Py_normalize_encoding(const char *, char *, size_t); +extern int _Py_normalize_encoding(const char *, char *, size_t); + +/* Convert a string to a normalized Python string(decoded from UTF-8): all characters are + converted to lower case, spaces and hyphens are replaced with underscores. */ -/* Convert a string to a normalized Python string(decoded from UTF-8): all characters are - converted to lower case, spaces and hyphens are replaced with underscores. */ - static PyObject *normalizestring(const char *string) { size_t len = strlen(string); - char *encoding; + char *encoding; PyObject *v; if (len > PY_SSIZE_T_MAX) { @@ -67,19 +67,19 @@ PyObject *normalizestring(const char *string) return NULL; } - encoding = PyMem_Malloc(len + 1); - if (encoding == NULL) + encoding = PyMem_Malloc(len + 1); + if (encoding == NULL) return PyErr_NoMemory(); - - if (!_Py_normalize_encoding(string, encoding, len + 1)) - { - PyErr_SetString(PyExc_RuntimeError, "_Py_normalize_encoding() failed"); - PyMem_Free(encoding); - return NULL; + + if (!_Py_normalize_encoding(string, encoding, len + 1)) + { + PyErr_SetString(PyExc_RuntimeError, "_Py_normalize_encoding() failed"); + PyMem_Free(encoding); + return NULL; } - - v = PyUnicode_FromString(encoding); - PyMem_Free(encoding); + + v = PyUnicode_FromString(encoding); + PyMem_Free(encoding); return v; } @@ -102,36 +102,36 @@ PyObject *_PyCodec_Lookup(const char *encoding) { if (encoding == NULL) { PyErr_BadArgument(); - return NULL; + return NULL; } - PyInterpreterState *interp = _PyInterpreterState_GET(); - if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) { - return NULL; - } + PyInterpreterState *interp = _PyInterpreterState_GET(); + if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) { + return NULL; + } /* Convert the encoding to a normalized Python string: all characters are converted to lower case, spaces and hyphens are replaced with underscores. */ - PyObject *v = normalizestring(encoding); - if (v == NULL) { - return NULL; - } + PyObject *v = normalizestring(encoding); + if (v == NULL) { + return NULL; + } PyUnicode_InternInPlace(&v); /* First, try to lookup the name in the registry dictionary */ - PyObject *result = PyDict_GetItemWithError(interp->codec_search_cache, v); + PyObject *result = PyDict_GetItemWithError(interp->codec_search_cache, v); if (result != NULL) { Py_INCREF(result); Py_DECREF(v); return result; } - else if (PyErr_Occurred()) { - goto onError; - } + else if (PyErr_Occurred()) { + goto onError; + } /* Next, scan the search functions in order of registration */ - const Py_ssize_t len = PyList_Size(interp->codec_search_path); + const Py_ssize_t len = PyList_Size(interp->codec_search_path); if (len < 0) goto onError; if (len == 0) { @@ -141,14 +141,14 @@ PyObject *_PyCodec_Lookup(const char *encoding) goto onError; } - Py_ssize_t i; + Py_ssize_t i; for (i = 0; i < len; i++) { PyObject *func; func = PyList_GetItem(interp->codec_search_path, i); if (func == NULL) goto onError; - result = PyObject_CallOneArg(func, v); + result = PyObject_CallOneArg(func, v); if (result == NULL) goto onError; if (result == Py_None) { @@ -175,11 +175,11 @@ PyObject *_PyCodec_Lookup(const char *encoding) Py_DECREF(result); goto onError; } - Py_DECREF(v); + Py_DECREF(v); return result; onError: - Py_DECREF(v); + Py_DECREF(v); return NULL; } @@ -188,7 +188,7 @@ int _PyCodec_Forget(const char *encoding) PyObject *v; int result; - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL) { return -1; } @@ -318,7 +318,7 @@ PyObject *codec_getstreamcodec(const char *encoding, if (errors != NULL) streamcodec = PyObject_CallFunction(codeccls, "Os", stream, errors); else - streamcodec = PyObject_CallOneArg(codeccls, stream); + streamcodec = PyObject_CallOneArg(codeccls, stream); Py_DECREF(codecs); return streamcodec; } @@ -417,7 +417,7 @@ _PyCodec_EncodeInternal(PyObject *object, if (args == NULL) goto onError; - result = PyObject_Call(encoder, args, NULL); + result = PyObject_Call(encoder, args, NULL); if (result == NULL) { wrap_codec_error("encoding", encoding); goto onError; @@ -463,7 +463,7 @@ _PyCodec_DecodeInternal(PyObject *object, if (args == NULL) goto onError; - result = PyObject_Call(decoder, args, NULL); + result = PyObject_Call(decoder, args, NULL); if (result == NULL) { wrap_codec_error("decoding", encoding); goto onError; @@ -621,7 +621,7 @@ PyObject *_PyCodec_DecodeText(PyObject *object, Return 0 on success, -1 on error */ int PyCodec_RegisterError(const char *name, PyObject *error) { - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) return -1; if (!PyCallable_Check(error)) { @@ -639,19 +639,19 @@ PyObject *PyCodec_LookupError(const char *name) { PyObject *handler = NULL; - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) return NULL; if (name==NULL) name = "strict"; - handler = _PyDict_GetItemStringWithError(interp->codec_error_registry, name); - if (handler) { - Py_INCREF(handler); - } - else if (!PyErr_Occurred()) { + handler = _PyDict_GetItemStringWithError(interp->codec_error_registry, name); + if (handler) { + Py_INCREF(handler); + } + else if (!PyErr_Occurred()) { PyErr_Format(PyExc_LookupError, "unknown error handler name '%.400s'", name); - } + } return handler; } @@ -659,7 +659,7 @@ static void wrong_exception_type(PyObject *exc) { PyErr_Format(PyExc_TypeError, "don't know how to handle %.200s in error callback", - Py_TYPE(exc)->tp_name); + Py_TYPE(exc)->tp_name); } PyObject *PyCodec_StrictErrors(PyObject *exc) @@ -702,7 +702,7 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeEncodeError)) { PyObject *res; - Py_UCS1 *outp; + Py_UCS1 *outp; if (PyUnicodeEncodeError_GetStart(exc, &start)) return NULL; if (PyUnicodeEncodeError_GetEnd(exc, &end)) @@ -711,10 +711,10 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) res = PyUnicode_New(len, '?'); if (res == NULL) return NULL; - assert(PyUnicode_KIND(res) == PyUnicode_1BYTE_KIND); - outp = PyUnicode_1BYTE_DATA(res); + assert(PyUnicode_KIND(res) == PyUnicode_1BYTE_KIND); + outp = PyUnicode_1BYTE_DATA(res); for (i = 0; i < len; ++i) - outp[i] = '?'; + outp[i] = '?'; assert(_PyUnicode_CheckConsistency(res, 1)); return Py_BuildValue("(Nn)", res, end); } @@ -727,7 +727,7 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) } else if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeTranslateError)) { PyObject *res; - Py_UCS2 *outp; + Py_UCS2 *outp; if (PyUnicodeTranslateError_GetStart(exc, &start)) return NULL; if (PyUnicodeTranslateError_GetEnd(exc, &end)) @@ -736,10 +736,10 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) res = PyUnicode_New(len, Py_UNICODE_REPLACEMENT_CHARACTER); if (res == NULL) return NULL; - assert(PyUnicode_KIND(res) == PyUnicode_2BYTE_KIND); - outp = PyUnicode_2BYTE_DATA(res); - for (i = 0; i < len; i++) - outp[i] = Py_UNICODE_REPLACEMENT_CHARACTER; + assert(PyUnicode_KIND(res) == PyUnicode_2BYTE_KIND); + outp = PyUnicode_2BYTE_DATA(res); + for (i = 0; i < len; i++) + outp[i] = Py_UNICODE_REPLACEMENT_CHARACTER; assert(_PyUnicode_CheckConsistency(res, 1)); return Py_BuildValue("(Nn)", res, end); } @@ -758,7 +758,7 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - Py_UCS1 *outp; + Py_UCS1 *outp; Py_ssize_t ressize; Py_UCS4 ch; if (PyUnicodeEncodeError_GetStart(exc, &start)) @@ -854,7 +854,7 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - Py_UCS1 *outp; + Py_UCS1 *outp; int ressize; Py_UCS4 c; @@ -965,7 +965,7 @@ PyObject *PyCodec_NameReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - Py_UCS1 *outp; + Py_UCS1 *outp; Py_ssize_t ressize; int replsize; Py_UCS4 c; @@ -1406,7 +1406,7 @@ static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc) static int _PyCodecRegistry_Init(void) { static struct { - const char *name; + const char *name; PyMethodDef def; } methods[] = { @@ -1491,38 +1491,38 @@ static int _PyCodecRegistry_Init(void) } }; - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyObject *mod; if (interp->codec_search_path != NULL) return 0; interp->codec_search_path = PyList_New(0); - if (interp->codec_search_path == NULL) { - return -1; - } - + if (interp->codec_search_path == NULL) { + return -1; + } + interp->codec_search_cache = PyDict_New(); - if (interp->codec_search_cache == NULL) { - return -1; - } - + if (interp->codec_search_cache == NULL) { + return -1; + } + interp->codec_error_registry = PyDict_New(); - if (interp->codec_error_registry == NULL) { - return -1; - } - - for (size_t i = 0; i < Py_ARRAY_LENGTH(methods); ++i) { - PyObject *func = PyCFunction_NewEx(&methods[i].def, NULL, NULL); - if (!func) { - return -1; + if (interp->codec_error_registry == NULL) { + return -1; + } + + for (size_t i = 0; i < Py_ARRAY_LENGTH(methods); ++i) { + PyObject *func = PyCFunction_NewEx(&methods[i].def, NULL, NULL); + if (!func) { + return -1; + } + + int res = PyCodec_RegisterError(methods[i].name, func); + Py_DECREF(func); + if (res) { + return -1; } - - int res = PyCodec_RegisterError(methods[i].name, func); - Py_DECREF(func); - if (res) { - return -1; - } } mod = PyImport_ImportModuleNoBlock("encodings"); diff --git a/contrib/tools/python3/src/Python/compile.c b/contrib/tools/python3/src/Python/compile.c index 8c45ea6558..f426050cce 100644 --- a/contrib/tools/python3/src/Python/compile.c +++ b/contrib/tools/python3/src/Python/compile.c @@ -40,10 +40,10 @@ #define COMP_SETCOMP 2 #define COMP_DICTCOMP 3 -#define IS_TOP_LEVEL_AWAIT(c) ( \ - (c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) \ - && (c->u->u_ste->ste_type == ModuleBlock)) - +#define IS_TOP_LEVEL_AWAIT(c) ( \ + (c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) \ + && (c->u->u_ste->ste_type == ModuleBlock)) + struct instr { unsigned i_jabs : 1; unsigned i_jrel : 1; @@ -84,16 +84,16 @@ It's called a frame block to distinguish it from a basic block in the compiler IR. */ -enum fblocktype { WHILE_LOOP, FOR_LOOP, TRY_EXCEPT, FINALLY_TRY, FINALLY_END, - WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE, EXCEPTION_HANDLER }; +enum fblocktype { WHILE_LOOP, FOR_LOOP, TRY_EXCEPT, FINALLY_TRY, FINALLY_END, + WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE, EXCEPTION_HANDLER }; struct fblockinfo { enum fblocktype fb_type; basicblock *fb_block; - /* (optional) type-specific exit or cleanup block */ - basicblock *fb_exit; - /* (optional) additional information required for unwinding */ - void *fb_datum; + /* (optional) type-specific exit or cleanup block */ + basicblock *fb_exit; + /* (optional) additional information required for unwinding */ + void *fb_datum; }; enum { @@ -128,7 +128,7 @@ struct compiler_unit { PyObject *u_private; /* for private name mangling */ Py_ssize_t u_argcount; /* number of arguments for block */ - Py_ssize_t u_posonlyargcount; /* number of positional only arguments for block */ + Py_ssize_t u_posonlyargcount; /* number of positional only arguments for block */ Py_ssize_t u_kwonlyargcount; /* number of keyword only arguments for block */ /* Pointer to the most recently allocated block. By following b_list members, you can reach all early allocated blocks. */ @@ -164,14 +164,14 @@ struct compiler { int c_optimize; /* optimization level */ int c_interactive; /* true if in interactive mode */ int c_nestlevel; - int c_do_not_emit_bytecode; /* The compiler won't emit any bytecode - if this value is different from zero. - This can be used to temporarily visit - nodes without emitting bytecode to - check only errors. */ - - PyObject *c_const_cache; /* Python dict holding all constants, - including names tuple */ + int c_do_not_emit_bytecode; /* The compiler won't emit any bytecode + if this value is different from zero. + This can be used to temporarily visit + nodes without emitting bytecode to + check only errors. */ + + PyObject *c_const_cache; /* Python dict holding all constants, + including names tuple */ struct compiler_unit *u; /* compiler state for current block */ PyObject *c_stack; /* Python list holding compiler_unit ptrs */ PyArena *c_arena; /* pointer to memory allocation arena */ @@ -180,12 +180,12 @@ struct compiler { static int compiler_enter_scope(struct compiler *, identifier, int, void *, int); static void compiler_free(struct compiler *); static basicblock *compiler_new_block(struct compiler *); -static int compiler_next_instr(basicblock *); +static int compiler_next_instr(basicblock *); static int compiler_addop(struct compiler *, int); static int compiler_addop_i(struct compiler *, int, Py_ssize_t); static int compiler_addop_j(struct compiler *, int, basicblock *, int); static int compiler_error(struct compiler *, const char *); -static int compiler_warn(struct compiler *, const char *, ...); +static int compiler_warn(struct compiler *, const char *, ...); static int compiler_nameop(struct compiler *, identifier, expr_context_ty); static PyCodeObject *compiler_mod(struct compiler *, mod_ty); @@ -194,11 +194,11 @@ static int compiler_visit_keyword(struct compiler *, keyword_ty); static int compiler_visit_expr(struct compiler *, expr_ty); static int compiler_augassign(struct compiler *, stmt_ty); static int compiler_annassign(struct compiler *, stmt_ty); -static int compiler_subscript(struct compiler *, expr_ty); -static int compiler_slice(struct compiler *, expr_ty); +static int compiler_subscript(struct compiler *, expr_ty); +static int compiler_slice(struct compiler *, expr_ty); -static int inplace_binop(operator_ty); -static int are_all_items_const(asdl_seq *, Py_ssize_t, Py_ssize_t); +static int inplace_binop(operator_ty); +static int are_all_items_const(asdl_seq *, Py_ssize_t, Py_ssize_t); static int expr_constant(expr_ty); static int compiler_with(struct compiler *, stmt_ty, int); @@ -213,13 +213,13 @@ static int compiler_set_qualname(struct compiler *); static int compiler_sync_comprehension_generator( struct compiler *c, asdl_seq *generators, int gen_index, - int depth, + int depth, expr_ty elt, expr_ty val, int type); static int compiler_async_comprehension_generator( struct compiler *c, asdl_seq *generators, int gen_index, - int depth, + int depth, expr_ty elt, expr_ty val, int type); static PyCodeObject *assemble(struct compiler *, int addNone); @@ -300,16 +300,16 @@ compiler_init(struct compiler *c) { memset(c, 0, sizeof(struct compiler)); - c->c_const_cache = PyDict_New(); - if (!c->c_const_cache) { - return 0; - } - + c->c_const_cache = PyDict_New(); + if (!c->c_const_cache) { + return 0; + } + c->c_stack = PyList_New(0); - if (!c->c_stack) { - Py_CLEAR(c->c_const_cache); + if (!c->c_stack) { + Py_CLEAR(c->c_const_cache); return 0; - } + } return 1; } @@ -320,7 +320,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, { struct compiler c; PyCodeObject *co = NULL; - PyCompilerFlags local_flags = _PyCompilerFlags_INIT; + PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int merged; if (!__doc__) { @@ -348,15 +348,15 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, c.c_future->ff_features = merged; flags->cf_flags = merged; c.c_flags = flags; - c.c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize; + c.c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize; c.c_nestlevel = 0; - c.c_do_not_emit_bytecode = 0; + c.c_do_not_emit_bytecode = 0; - _PyASTOptimizeState state; - state.optimize = c.c_optimize; - state.ff_features = merged; - - if (!_PyAST_Optimize(mod, arena, &state)) { + _PyASTOptimizeState state; + state.optimize = c.c_optimize; + state.ff_features = merged; + + if (!_PyAST_Optimize(mod, arena, &state)) { goto finally; } @@ -413,7 +413,7 @@ compiler_free(struct compiler *c) if (c->c_future) PyObject_Free(c->c_future); Py_XDECREF(c->c_filename); - Py_DECREF(c->c_const_cache); + Py_DECREF(c->c_const_cache); Py_DECREF(c->c_stack); } @@ -433,7 +433,7 @@ list2dict(PyObject *list) return NULL; } k = PyList_GET_ITEM(list, i); - if (PyDict_SetItem(dict, k, v) < 0) { + if (PyDict_SetItem(dict, k, v) < 0) { Py_DECREF(v); Py_DECREF(dict); return NULL; @@ -486,14 +486,14 @@ dictbytype(PyObject *src, int scope_type, int flag, Py_ssize_t offset) scope = (vi >> SCOPE_OFFSET) & SCOPE_MASK; if (scope == scope_type || vi & flag) { - PyObject *item = PyLong_FromSsize_t(i); + PyObject *item = PyLong_FromSsize_t(i); if (item == NULL) { Py_DECREF(sorted_keys); Py_DECREF(dest); return NULL; } i++; - if (PyDict_SetItem(dest, k, item) < 0) { + if (PyDict_SetItem(dest, k, item) < 0) { Py_DECREF(sorted_keys); Py_DECREF(item); Py_DECREF(dest); @@ -559,7 +559,7 @@ compiler_enter_scope(struct compiler *c, identifier name, struct compiler_unit *u; basicblock *block; - u = (struct compiler_unit *)PyObject_Calloc(1, sizeof( + u = (struct compiler_unit *)PyObject_Calloc(1, sizeof( struct compiler_unit)); if (!u) { PyErr_NoMemory(); @@ -567,7 +567,7 @@ compiler_enter_scope(struct compiler *c, identifier name, } u->u_scope_type = scope_type; u->u_argcount = 0; - u->u_posonlyargcount = 0; + u->u_posonlyargcount = 0; u->u_kwonlyargcount = 0; u->u_ste = PySymtable_Lookup(c->c_st, key); if (!u->u_ste) { @@ -585,7 +585,7 @@ compiler_enter_scope(struct compiler *c, identifier name, if (u->u_ste->ste_needs_class_closure) { /* Cook up an implicit __class__ cell. */ _Py_IDENTIFIER(__class__); - PyObject *name; + PyObject *name; int res; assert(u->u_scope_type == COMPILER_SCOPE_CLASS); assert(PyDict_GET_SIZE(u->u_cellvars) == 0); @@ -594,7 +594,7 @@ compiler_enter_scope(struct compiler *c, identifier name, compiler_unit_free(u); return 0; } - res = PyDict_SetItem(u->u_cellvars, name, _PyLong_Zero); + res = PyDict_SetItem(u->u_cellvars, name, _PyLong_Zero); if (res < 0) { compiler_unit_free(u); return 0; @@ -767,7 +767,7 @@ compiler_new_block(struct compiler *c) struct compiler_unit *u; u = c->u; - b = (basicblock *)PyObject_Calloc(1, sizeof(basicblock)); + b = (basicblock *)PyObject_Calloc(1, sizeof(basicblock)); if (b == NULL) { PyErr_NoMemory(); return NULL; @@ -804,12 +804,12 @@ compiler_use_next_block(struct compiler *c, basicblock *block) */ static int -compiler_next_instr(basicblock *b) +compiler_next_instr(basicblock *b) { assert(b != NULL); if (b->b_instr == NULL) { - b->b_instr = (struct instr *)PyObject_Calloc( - DEFAULT_BLOCK_SIZE, sizeof(struct instr)); + b->b_instr = (struct instr *)PyObject_Calloc( + DEFAULT_BLOCK_SIZE, sizeof(struct instr)); if (b->b_instr == NULL) { PyErr_NoMemory(); return -1; @@ -844,18 +844,18 @@ compiler_next_instr(basicblock *b) return b->b_iused++; } -/* Set the line number and column offset for the following instructions. +/* Set the line number and column offset for the following instructions. The line number is reset in the following cases: - when entering a new scope - on each statement - - on each expression and sub-expression - - before the "except" and "finally" clauses + - on each expression and sub-expression + - before the "except" and "finally" clauses */ -#define SET_LOC(c, x) \ - (c)->u->u_lineno = (x)->lineno; \ - (c)->u->u_col_offset = (x)->col_offset; +#define SET_LOC(c, x) \ + (c)->u->u_lineno = (x)->lineno; \ + (c)->u->u_col_offset = (x)->col_offset; /* Return the stack effect of opcode with argument oparg. @@ -872,16 +872,16 @@ static int stack_effect(int opcode, int oparg, int jump) { switch (opcode) { - case NOP: - case EXTENDED_ARG: - return 0; - + case NOP: + case EXTENDED_ARG: + return 0; + /* Stack manipulation */ case POP_TOP: return -1; case ROT_TWO: case ROT_THREE: - case ROT_FOUR: + case ROT_FOUR: return 0; case DUP_TOP: return 1; @@ -948,7 +948,7 @@ stack_effect(int opcode, int oparg, int jump) case INPLACE_XOR: case INPLACE_OR: return -1; - + case SETUP_WITH: /* 1 in the normal flow. * Restore the stack position and push 6 values before jumping to @@ -1005,11 +1005,11 @@ stack_effect(int opcode, int oparg, int jump) case LOAD_ATTR: return 0; case COMPARE_OP: - case IS_OP: - case CONTAINS_OP: + case IS_OP: + case CONTAINS_OP: return -1; - case JUMP_IF_NOT_EXC_MATCH: - return -2; + case JUMP_IF_NOT_EXC_MATCH: + return -2; case IMPORT_NAME: return -1; case IMPORT_FROM: @@ -1031,18 +1031,18 @@ stack_effect(int opcode, int oparg, int jump) case LOAD_GLOBAL: return 1; - /* Exception handling */ + /* Exception handling */ case SETUP_FINALLY: /* 0 in the normal flow. * Restore the stack position and push 6 values before jumping to * the handler if an exception be raised. */ return jump ? 6 : 0; - case RERAISE: - return -3; + case RERAISE: + return -3; + + case WITH_EXCEPT_START: + return 1; - case WITH_EXCEPT_START: - return 1; - case LOAD_FAST: return 1; case STORE_FAST: @@ -1099,23 +1099,23 @@ stack_effect(int opcode, int oparg, int jump) return 1; case GET_YIELD_FROM_ITER: return 0; - case END_ASYNC_FOR: - return -7; + case END_ASYNC_FOR: + return -7; case FORMAT_VALUE: /* If there's a fmt_spec on the stack, we go from 2->1, else 1->1. */ return (oparg & FVS_MASK) == FVS_HAVE_SPEC ? -1 : 0; case LOAD_METHOD: return 1; - case LOAD_ASSERTION_ERROR: - return 1; - case LIST_TO_TUPLE: - return 0; - case LIST_EXTEND: - case SET_UPDATE: - case DICT_MERGE: - case DICT_UPDATE: - return -1; + case LOAD_ASSERTION_ERROR: + return 1; + case LIST_TO_TUPLE: + return 0; + case LIST_EXTEND: + case SET_UPDATE: + case DICT_MERGE: + case DICT_UPDATE: + return -1; default: return PY_INVALID_STACK_EFFECT; } @@ -1123,12 +1123,12 @@ stack_effect(int opcode, int oparg, int jump) } int -PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump) -{ - return stack_effect(opcode, oparg, jump); -} - -int +PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump) +{ + return stack_effect(opcode, oparg, jump); +} + +int PyCompile_OpcodeStackEffect(int opcode, int oparg) { return stack_effect(opcode, oparg, -1); @@ -1145,10 +1145,10 @@ compiler_addop(struct compiler *c, int opcode) struct instr *i; int off; assert(!HAS_ARG(opcode)); - if (c->c_do_not_emit_bytecode) { - return 1; - } - off = compiler_next_instr(c->u->u_curblock); + if (c->c_do_not_emit_bytecode) { + return 1; + } + off = compiler_next_instr(c->u->u_curblock); if (off < 0) return 0; b = c->u->u_curblock; @@ -1157,17 +1157,17 @@ compiler_addop(struct compiler *c, int opcode) i->i_oparg = 0; if (opcode == RETURN_VALUE) b->b_return = 1; - i->i_lineno = c->u->u_lineno; + i->i_lineno = c->u->u_lineno; return 1; } static Py_ssize_t -compiler_add_o(PyObject *dict, PyObject *o) +compiler_add_o(PyObject *dict, PyObject *o) { - PyObject *v; + PyObject *v; Py_ssize_t arg; - v = PyDict_GetItemWithError(dict, o); + v = PyDict_GetItemWithError(dict, o); if (!v) { if (PyErr_Occurred()) { return -1; @@ -1177,7 +1177,7 @@ compiler_add_o(PyObject *dict, PyObject *o) if (!v) { return -1; } - if (PyDict_SetItem(dict, o, v) < 0) { + if (PyDict_SetItem(dict, o, v) < 0) { Py_DECREF(v); return -1; } @@ -1188,155 +1188,155 @@ compiler_add_o(PyObject *dict, PyObject *o) return arg; } -// Merge const *o* recursively and return constant key object. -static PyObject* -merge_consts_recursive(struct compiler *c, PyObject *o) -{ - // None and Ellipsis are singleton, and key is the singleton. - // No need to merge object and key. - if (o == Py_None || o == Py_Ellipsis) { - Py_INCREF(o); - return o; - } - - PyObject *key = _PyCode_ConstantKey(o); - if (key == NULL) { - return NULL; - } - - // t is borrowed reference - PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); - if (t != key) { - // o is registered in c_const_cache. Just use it. - Py_XINCREF(t); - Py_DECREF(key); - return t; - } - - // We registered o in c_const_cache. - // When o is a tuple or frozenset, we want to merge its - // items too. - if (PyTuple_CheckExact(o)) { - Py_ssize_t len = PyTuple_GET_SIZE(o); - for (Py_ssize_t i = 0; i < len; i++) { - PyObject *item = PyTuple_GET_ITEM(o, i); - PyObject *u = merge_consts_recursive(c, item); - if (u == NULL) { - Py_DECREF(key); - return NULL; - } - - // See _PyCode_ConstantKey() - PyObject *v; // borrowed - if (PyTuple_CheckExact(u)) { - v = PyTuple_GET_ITEM(u, 1); - } - else { - v = u; - } - if (v != item) { - Py_INCREF(v); - PyTuple_SET_ITEM(o, i, v); - Py_DECREF(item); - } - - Py_DECREF(u); - } - } - else if (PyFrozenSet_CheckExact(o)) { - // *key* is tuple. And its first item is frozenset of - // constant keys. - // See _PyCode_ConstantKey() for detail. - assert(PyTuple_CheckExact(key)); - assert(PyTuple_GET_SIZE(key) == 2); - - Py_ssize_t len = PySet_GET_SIZE(o); - if (len == 0) { // empty frozenset should not be re-created. - return key; - } - PyObject *tuple = PyTuple_New(len); - if (tuple == NULL) { - Py_DECREF(key); - return NULL; - } - Py_ssize_t i = 0, pos = 0; - PyObject *item; - Py_hash_t hash; - while (_PySet_NextEntry(o, &pos, &item, &hash)) { - PyObject *k = merge_consts_recursive(c, item); - if (k == NULL) { - Py_DECREF(tuple); - Py_DECREF(key); - return NULL; - } - PyObject *u; - if (PyTuple_CheckExact(k)) { - u = PyTuple_GET_ITEM(k, 1); - Py_INCREF(u); - Py_DECREF(k); - } - else { - u = k; - } - PyTuple_SET_ITEM(tuple, i, u); // Steals reference of u. - i++; - } - - // Instead of rewriting o, we create new frozenset and embed in the - // key tuple. Caller should get merged frozenset from the key tuple. - PyObject *new = PyFrozenSet_New(tuple); - Py_DECREF(tuple); - if (new == NULL) { - Py_DECREF(key); - return NULL; - } - assert(PyTuple_GET_ITEM(key, 1) == o); - Py_DECREF(o); - PyTuple_SET_ITEM(key, 1, new); - } - - return key; -} - -static Py_ssize_t -compiler_add_const(struct compiler *c, PyObject *o) -{ - if (c->c_do_not_emit_bytecode) { - return 0; - } - - PyObject *key = merge_consts_recursive(c, o); - if (key == NULL) { - return -1; - } - - Py_ssize_t arg = compiler_add_o(c->u->u_consts, key); - Py_DECREF(key); - return arg; -} - +// Merge const *o* recursively and return constant key object. +static PyObject* +merge_consts_recursive(struct compiler *c, PyObject *o) +{ + // None and Ellipsis are singleton, and key is the singleton. + // No need to merge object and key. + if (o == Py_None || o == Py_Ellipsis) { + Py_INCREF(o); + return o; + } + + PyObject *key = _PyCode_ConstantKey(o); + if (key == NULL) { + return NULL; + } + + // t is borrowed reference + PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); + if (t != key) { + // o is registered in c_const_cache. Just use it. + Py_XINCREF(t); + Py_DECREF(key); + return t; + } + + // We registered o in c_const_cache. + // When o is a tuple or frozenset, we want to merge its + // items too. + if (PyTuple_CheckExact(o)) { + Py_ssize_t len = PyTuple_GET_SIZE(o); + for (Py_ssize_t i = 0; i < len; i++) { + PyObject *item = PyTuple_GET_ITEM(o, i); + PyObject *u = merge_consts_recursive(c, item); + if (u == NULL) { + Py_DECREF(key); + return NULL; + } + + // See _PyCode_ConstantKey() + PyObject *v; // borrowed + if (PyTuple_CheckExact(u)) { + v = PyTuple_GET_ITEM(u, 1); + } + else { + v = u; + } + if (v != item) { + Py_INCREF(v); + PyTuple_SET_ITEM(o, i, v); + Py_DECREF(item); + } + + Py_DECREF(u); + } + } + else if (PyFrozenSet_CheckExact(o)) { + // *key* is tuple. And its first item is frozenset of + // constant keys. + // See _PyCode_ConstantKey() for detail. + assert(PyTuple_CheckExact(key)); + assert(PyTuple_GET_SIZE(key) == 2); + + Py_ssize_t len = PySet_GET_SIZE(o); + if (len == 0) { // empty frozenset should not be re-created. + return key; + } + PyObject *tuple = PyTuple_New(len); + if (tuple == NULL) { + Py_DECREF(key); + return NULL; + } + Py_ssize_t i = 0, pos = 0; + PyObject *item; + Py_hash_t hash; + while (_PySet_NextEntry(o, &pos, &item, &hash)) { + PyObject *k = merge_consts_recursive(c, item); + if (k == NULL) { + Py_DECREF(tuple); + Py_DECREF(key); + return NULL; + } + PyObject *u; + if (PyTuple_CheckExact(k)) { + u = PyTuple_GET_ITEM(k, 1); + Py_INCREF(u); + Py_DECREF(k); + } + else { + u = k; + } + PyTuple_SET_ITEM(tuple, i, u); // Steals reference of u. + i++; + } + + // Instead of rewriting o, we create new frozenset and embed in the + // key tuple. Caller should get merged frozenset from the key tuple. + PyObject *new = PyFrozenSet_New(tuple); + Py_DECREF(tuple); + if (new == NULL) { + Py_DECREF(key); + return NULL; + } + assert(PyTuple_GET_ITEM(key, 1) == o); + Py_DECREF(o); + PyTuple_SET_ITEM(key, 1, new); + } + + return key; +} + +static Py_ssize_t +compiler_add_const(struct compiler *c, PyObject *o) +{ + if (c->c_do_not_emit_bytecode) { + return 0; + } + + PyObject *key = merge_consts_recursive(c, o); + if (key == NULL) { + return -1; + } + + Py_ssize_t arg = compiler_add_o(c->u->u_consts, key); + Py_DECREF(key); + return arg; +} + +static int +compiler_addop_load_const(struct compiler *c, PyObject *o) +{ + if (c->c_do_not_emit_bytecode) { + return 1; + } + + Py_ssize_t arg = compiler_add_const(c, o); + if (arg < 0) + return 0; + return compiler_addop_i(c, LOAD_CONST, arg); +} + static int -compiler_addop_load_const(struct compiler *c, PyObject *o) -{ - if (c->c_do_not_emit_bytecode) { - return 1; - } - - Py_ssize_t arg = compiler_add_const(c, o); - if (arg < 0) - return 0; - return compiler_addop_i(c, LOAD_CONST, arg); -} - -static int compiler_addop_o(struct compiler *c, int opcode, PyObject *dict, PyObject *o) { - if (c->c_do_not_emit_bytecode) { - return 1; - } - - Py_ssize_t arg = compiler_add_o(dict, o); + if (c->c_do_not_emit_bytecode) { + return 1; + } + + Py_ssize_t arg = compiler_add_o(dict, o); if (arg < 0) return 0; return compiler_addop_i(c, opcode, arg); @@ -1347,15 +1347,15 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict, PyObject *o) { Py_ssize_t arg; - - if (c->c_do_not_emit_bytecode) { - return 1; - } - + + if (c->c_do_not_emit_bytecode) { + return 1; + } + PyObject *mangled = _Py_Mangle(c->u->u_private, o); if (!mangled) return 0; - arg = compiler_add_o(dict, mangled); + arg = compiler_add_o(dict, mangled); Py_DECREF(mangled); if (arg < 0) return 0; @@ -1372,10 +1372,10 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg) struct instr *i; int off; - if (c->c_do_not_emit_bytecode) { - return 1; - } - + if (c->c_do_not_emit_bytecode) { + return 1; + } + /* oparg value is unsigned, but a signed C int is usually used to store it in the C code (like Python/ceval.c). @@ -1386,13 +1386,13 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg) assert(HAS_ARG(opcode)); assert(0 <= oparg && oparg <= 2147483647); - off = compiler_next_instr(c->u->u_curblock); + off = compiler_next_instr(c->u->u_curblock); if (off < 0) return 0; i = &c->u->u_curblock->b_instr[off]; i->i_opcode = opcode; i->i_oparg = Py_SAFE_DOWNCAST(oparg, Py_ssize_t, int); - i->i_lineno = c->u->u_lineno; + i->i_lineno = c->u->u_lineno; return 1; } @@ -1402,13 +1402,13 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) struct instr *i; int off; - if (c->c_do_not_emit_bytecode) { - return 1; - } - + if (c->c_do_not_emit_bytecode) { + return 1; + } + assert(HAS_ARG(opcode)); assert(b != NULL); - off = compiler_next_instr(c->u->u_curblock); + off = compiler_next_instr(c->u->u_curblock); if (off < 0) return 0; i = &c->u->u_curblock->b_instr[off]; @@ -1418,7 +1418,7 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) i->i_jabs = 1; else i->i_jrel = 1; - i->i_lineno = c->u->u_lineno; + i->i_lineno = c->u->u_lineno; return 1; } @@ -1445,24 +1445,24 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) } \ } -#define ADDOP_LOAD_CONST(C, O) { \ - if (!compiler_addop_load_const((C), (O))) \ - return 0; \ -} - -/* Same as ADDOP_LOAD_CONST, but steals a reference. */ -#define ADDOP_LOAD_CONST_NEW(C, O) { \ - PyObject *__new_const = (O); \ - if (__new_const == NULL) { \ - return 0; \ - } \ - if (!compiler_addop_load_const((C), __new_const)) { \ - Py_DECREF(__new_const); \ - return 0; \ - } \ - Py_DECREF(__new_const); \ -} - +#define ADDOP_LOAD_CONST(C, O) { \ + if (!compiler_addop_load_const((C), (O))) \ + return 0; \ +} + +/* Same as ADDOP_LOAD_CONST, but steals a reference. */ +#define ADDOP_LOAD_CONST_NEW(C, O) { \ + PyObject *__new_const = (O); \ + if (__new_const == NULL) { \ + return 0; \ + } \ + if (!compiler_addop_load_const((C), __new_const)) { \ + Py_DECREF(__new_const); \ + return 0; \ + } \ + Py_DECREF(__new_const); \ +} + #define ADDOP_O(C, OP, O, TYPE) { \ if (!compiler_addop_o((C), (OP), (C)->u->u_ ## TYPE, (O))) \ return 0; \ @@ -1497,12 +1497,12 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) return 0; \ } - -#define ADDOP_COMPARE(C, CMP) { \ - if (!compiler_addcompare((C), (cmpop_ty)(CMP))) \ - return 0; \ -} - + +#define ADDOP_COMPARE(C, CMP) { \ + if (!compiler_addcompare((C), (cmpop_ty)(CMP))) \ + return 0; \ +} + /* VISIT and VISIT_SEQ takes an ASDL type as their second argument. They use the ASDL name to synthesize the name of the C type and the visit function. */ @@ -1546,15 +1546,15 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) } \ } -/* These macros allows to check only for errors and not emmit bytecode - * while visiting nodes. -*/ +/* These macros allows to check only for errors and not emmit bytecode + * while visiting nodes. +*/ -#define BEGIN_DO_NOT_EMIT_BYTECODE { \ - c->c_do_not_emit_bytecode++; +#define BEGIN_DO_NOT_EMIT_BYTECODE { \ + c->c_do_not_emit_bytecode++; -#define END_DO_NOT_EMIT_BYTECODE \ - c->c_do_not_emit_bytecode--; \ +#define END_DO_NOT_EMIT_BYTECODE \ + c->c_do_not_emit_bytecode--; \ } /* Search if variable annotations are present statically in a block. */ @@ -1614,166 +1614,166 @@ find_ann(asdl_seq *stmts) return res; } -/* - * Frame block handling functions - */ - -static int -compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b, - basicblock *exit, void *datum) -{ - struct fblockinfo *f; - if (c->u->u_nfblocks >= CO_MAXBLOCKS) { - return compiler_error(c, "too many statically nested blocks"); - } - f = &c->u->u_fblock[c->u->u_nfblocks++]; - f->fb_type = t; - f->fb_block = b; - f->fb_exit = exit; - f->fb_datum = datum; - return 1; -} - -static void -compiler_pop_fblock(struct compiler *c, enum fblocktype t, basicblock *b) -{ - struct compiler_unit *u = c->u; - assert(u->u_nfblocks > 0); - u->u_nfblocks--; - assert(u->u_fblock[u->u_nfblocks].fb_type == t); - assert(u->u_fblock[u->u_nfblocks].fb_block == b); -} - -static int -compiler_call_exit_with_nones(struct compiler *c) { - ADDOP_O(c, LOAD_CONST, Py_None, consts); - ADDOP(c, DUP_TOP); - ADDOP(c, DUP_TOP); - ADDOP_I(c, CALL_FUNCTION, 3); - return 1; -} - -/* Unwind a frame block. If preserve_tos is true, the TOS before - * popping the blocks will be restored afterwards, unless another - * return, break or continue is found. In which case, the TOS will - * be popped. - */ -static int -compiler_unwind_fblock(struct compiler *c, struct fblockinfo *info, - int preserve_tos) -{ - switch (info->fb_type) { - case WHILE_LOOP: - case EXCEPTION_HANDLER: - return 1; - - case FOR_LOOP: - /* Pop the iterator */ - if (preserve_tos) { - ADDOP(c, ROT_TWO); - } - ADDOP(c, POP_TOP); - return 1; - - case TRY_EXCEPT: - ADDOP(c, POP_BLOCK); - return 1; - - case FINALLY_TRY: - ADDOP(c, POP_BLOCK); - if (preserve_tos) { - if (!compiler_push_fblock(c, POP_VALUE, NULL, NULL, NULL)) { - return 0; - } - } - /* Emit the finally block, restoring the line number when done */ - int saved_lineno = c->u->u_lineno; - VISIT_SEQ(c, stmt, info->fb_datum); - c->u->u_lineno = saved_lineno; - if (preserve_tos) { - compiler_pop_fblock(c, POP_VALUE, NULL); - } - return 1; - - case FINALLY_END: - if (preserve_tos) { - ADDOP(c, ROT_FOUR); - } - ADDOP(c, POP_TOP); - ADDOP(c, POP_TOP); - ADDOP(c, POP_TOP); - if (preserve_tos) { - ADDOP(c, ROT_FOUR); - } - ADDOP(c, POP_EXCEPT); - return 1; - - case WITH: - case ASYNC_WITH: - ADDOP(c, POP_BLOCK); - if (preserve_tos) { - ADDOP(c, ROT_TWO); - } - if(!compiler_call_exit_with_nones(c)) { - return 0; - } - if (info->fb_type == ASYNC_WITH) { - ADDOP(c, GET_AWAITABLE); - ADDOP_LOAD_CONST(c, Py_None); - ADDOP(c, YIELD_FROM); - } - ADDOP(c, POP_TOP); - return 1; - - case HANDLER_CLEANUP: - if (info->fb_datum) { - ADDOP(c, POP_BLOCK); - } - if (preserve_tos) { - ADDOP(c, ROT_FOUR); - } - ADDOP(c, POP_EXCEPT); - if (info->fb_datum) { - ADDOP_LOAD_CONST(c, Py_None); - compiler_nameop(c, info->fb_datum, Store); - compiler_nameop(c, info->fb_datum, Del); - } - return 1; - - case POP_VALUE: - if (preserve_tos) { - ADDOP(c, ROT_TWO); - } - ADDOP(c, POP_TOP); - return 1; - } - Py_UNREACHABLE(); -} - -/** Unwind block stack. If loop is not NULL, then stop when the first loop is encountered. */ -static int -compiler_unwind_fblock_stack(struct compiler *c, int preserve_tos, struct fblockinfo **loop) { - if (c->u->u_nfblocks == 0) { - return 1; - } - struct fblockinfo *top = &c->u->u_fblock[c->u->u_nfblocks-1]; - if (loop != NULL && (top->fb_type == WHILE_LOOP || top->fb_type == FOR_LOOP)) { - *loop = top; - return 1; - } - struct fblockinfo copy = *top; - c->u->u_nfblocks--; - if (!compiler_unwind_fblock(c, ©, preserve_tos)) { - return 0; - } - if (!compiler_unwind_fblock_stack(c, preserve_tos, loop)) { - return 0; - } - c->u->u_fblock[c->u->u_nfblocks] = copy; - c->u->u_nfblocks++; - return 1; -} - +/* + * Frame block handling functions + */ + +static int +compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b, + basicblock *exit, void *datum) +{ + struct fblockinfo *f; + if (c->u->u_nfblocks >= CO_MAXBLOCKS) { + return compiler_error(c, "too many statically nested blocks"); + } + f = &c->u->u_fblock[c->u->u_nfblocks++]; + f->fb_type = t; + f->fb_block = b; + f->fb_exit = exit; + f->fb_datum = datum; + return 1; +} + +static void +compiler_pop_fblock(struct compiler *c, enum fblocktype t, basicblock *b) +{ + struct compiler_unit *u = c->u; + assert(u->u_nfblocks > 0); + u->u_nfblocks--; + assert(u->u_fblock[u->u_nfblocks].fb_type == t); + assert(u->u_fblock[u->u_nfblocks].fb_block == b); +} + +static int +compiler_call_exit_with_nones(struct compiler *c) { + ADDOP_O(c, LOAD_CONST, Py_None, consts); + ADDOP(c, DUP_TOP); + ADDOP(c, DUP_TOP); + ADDOP_I(c, CALL_FUNCTION, 3); + return 1; +} + +/* Unwind a frame block. If preserve_tos is true, the TOS before + * popping the blocks will be restored afterwards, unless another + * return, break or continue is found. In which case, the TOS will + * be popped. + */ +static int +compiler_unwind_fblock(struct compiler *c, struct fblockinfo *info, + int preserve_tos) +{ + switch (info->fb_type) { + case WHILE_LOOP: + case EXCEPTION_HANDLER: + return 1; + + case FOR_LOOP: + /* Pop the iterator */ + if (preserve_tos) { + ADDOP(c, ROT_TWO); + } + ADDOP(c, POP_TOP); + return 1; + + case TRY_EXCEPT: + ADDOP(c, POP_BLOCK); + return 1; + + case FINALLY_TRY: + ADDOP(c, POP_BLOCK); + if (preserve_tos) { + if (!compiler_push_fblock(c, POP_VALUE, NULL, NULL, NULL)) { + return 0; + } + } + /* Emit the finally block, restoring the line number when done */ + int saved_lineno = c->u->u_lineno; + VISIT_SEQ(c, stmt, info->fb_datum); + c->u->u_lineno = saved_lineno; + if (preserve_tos) { + compiler_pop_fblock(c, POP_VALUE, NULL); + } + return 1; + + case FINALLY_END: + if (preserve_tos) { + ADDOP(c, ROT_FOUR); + } + ADDOP(c, POP_TOP); + ADDOP(c, POP_TOP); + ADDOP(c, POP_TOP); + if (preserve_tos) { + ADDOP(c, ROT_FOUR); + } + ADDOP(c, POP_EXCEPT); + return 1; + + case WITH: + case ASYNC_WITH: + ADDOP(c, POP_BLOCK); + if (preserve_tos) { + ADDOP(c, ROT_TWO); + } + if(!compiler_call_exit_with_nones(c)) { + return 0; + } + if (info->fb_type == ASYNC_WITH) { + ADDOP(c, GET_AWAITABLE); + ADDOP_LOAD_CONST(c, Py_None); + ADDOP(c, YIELD_FROM); + } + ADDOP(c, POP_TOP); + return 1; + + case HANDLER_CLEANUP: + if (info->fb_datum) { + ADDOP(c, POP_BLOCK); + } + if (preserve_tos) { + ADDOP(c, ROT_FOUR); + } + ADDOP(c, POP_EXCEPT); + if (info->fb_datum) { + ADDOP_LOAD_CONST(c, Py_None); + compiler_nameop(c, info->fb_datum, Store); + compiler_nameop(c, info->fb_datum, Del); + } + return 1; + + case POP_VALUE: + if (preserve_tos) { + ADDOP(c, ROT_TWO); + } + ADDOP(c, POP_TOP); + return 1; + } + Py_UNREACHABLE(); +} + +/** Unwind block stack. If loop is not NULL, then stop when the first loop is encountered. */ +static int +compiler_unwind_fblock_stack(struct compiler *c, int preserve_tos, struct fblockinfo **loop) { + if (c->u->u_nfblocks == 0) { + return 1; + } + struct fblockinfo *top = &c->u->u_fblock[c->u->u_nfblocks-1]; + if (loop != NULL && (top->fb_type == WHILE_LOOP || top->fb_type == FOR_LOOP)) { + *loop = top; + return 1; + } + struct fblockinfo copy = *top; + c->u->u_nfblocks--; + if (!compiler_unwind_fblock(c, ©, preserve_tos)) { + return 0; + } + if (!compiler_unwind_fblock_stack(c, preserve_tos, loop)) { + return 0; + } + c->u->u_fblock[c->u->u_nfblocks] = copy; + c->u->u_nfblocks++; + return 1; +} + /* Compile a sequence of statements, checking for a docstring and for annotations. */ @@ -1782,15 +1782,15 @@ compiler_body(struct compiler *c, asdl_seq *stmts) { int i = 0; stmt_ty st; - PyObject *docstring; + PyObject *docstring; /* Set current line number to the line number of first statement. This way line number for SETUP_ANNOTATIONS will always coincide with the line number of first "real" statement in module. - If body is empty, then lineno will be set later in assemble. */ - if (c->u->u_scope_type == COMPILER_SCOPE_MODULE && asdl_seq_LEN(stmts)) { + If body is empty, then lineno will be set later in assemble. */ + if (c->u->u_scope_type == COMPILER_SCOPE_MODULE && asdl_seq_LEN(stmts)) { st = (stmt_ty)asdl_seq_GET(stmts, 0); - SET_LOC(c, st); + SET_LOC(c, st); } /* Every annotated class and module should have __annotations__. */ if (find_ann(stmts)) { @@ -1799,16 +1799,16 @@ compiler_body(struct compiler *c, asdl_seq *stmts) if (!asdl_seq_LEN(stmts)) return 1; /* if not -OO mode, set docstring */ - if (c->c_optimize < 2) { - docstring = _PyAST_GetDocString(stmts); - if (docstring) { - i = 1; - st = (stmt_ty)asdl_seq_GET(stmts, 0); - assert(st->kind == Expr_kind); - VISIT(c, expr, st->v.Expr.value); - if (!compiler_nameop(c, __doc__, Store)) - return 0; - } + if (c->c_optimize < 2) { + docstring = _PyAST_GetDocString(stmts); + if (docstring) { + i = 1; + st = (stmt_ty)asdl_seq_GET(stmts, 0); + assert(st->kind == Expr_kind); + VISIT(c, expr, st->v.Expr.value); + if (!compiler_nameop(c, __doc__, Store)) + return 0; + } } for (; i < asdl_seq_LEN(stmts); i++) VISIT(c, stmt, (stmt_ty)asdl_seq_GET(stmts, i)); @@ -1873,15 +1873,15 @@ get_ref_type(struct compiler *c, PyObject *name) return CELL; scope = PyST_GetScope(c->u->u_ste, name); if (scope == 0) { - _Py_FatalErrorFormat(__func__, - "unknown scope for %.100s in %.100s(%s)\n" - "symbols: %s\nlocals: %s\nglobals: %s", - PyUnicode_AsUTF8(name), - PyUnicode_AsUTF8(c->u->u_name), - PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_id)), - PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_symbols)), - PyUnicode_AsUTF8(PyObject_Repr(c->u->u_varnames)), - PyUnicode_AsUTF8(PyObject_Repr(c->u->u_names))); + _Py_FatalErrorFormat(__func__, + "unknown scope for %.100s in %.100s(%s)\n" + "symbols: %s\nlocals: %s\nglobals: %s", + PyUnicode_AsUTF8(name), + PyUnicode_AsUTF8(c->u->u_name), + PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_id)), + PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_symbols)), + PyUnicode_AsUTF8(PyObject_Repr(c->u->u_varnames)), + PyUnicode_AsUTF8(PyObject_Repr(c->u->u_names))); } return scope; @@ -1890,8 +1890,8 @@ get_ref_type(struct compiler *c, PyObject *name) static int compiler_lookup_arg(PyObject *dict, PyObject *name) { - PyObject *v; - v = PyDict_GetItem(dict, name); + PyObject *v; + v = PyDict_GetItem(dict, name); if (v == NULL) return -1; return PyLong_AS_LONG(v); @@ -1916,7 +1916,7 @@ compiler_make_closure(struct compiler *c, PyCodeObject *co, Py_ssize_t flags, Py free variable that has the same name as a method, the name will be considered free *and* local in the class. It should be handled by the closure, as - well as by the normal name lookup logic. + well as by the normal name lookup logic. */ reftype = get_ref_type(c, name); if (reftype == CELL) @@ -1924,7 +1924,7 @@ compiler_make_closure(struct compiler *c, PyCodeObject *co, Py_ssize_t flags, Py else /* (reftype == FREE) */ arg = compiler_lookup_arg(c->u->u_freevars, name); if (arg == -1) { - _Py_FatalErrorFormat(__func__, + _Py_FatalErrorFormat(__func__, "lookup %s in %s %d %d\n" "freevars of %s: %s\n", PyUnicode_AsUTF8(PyObject_Repr(name)), @@ -1938,8 +1938,8 @@ compiler_make_closure(struct compiler *c, PyCodeObject *co, Py_ssize_t flags, Py flags |= 0x08; ADDOP_I(c, BUILD_TUPLE, free); } - ADDOP_LOAD_CONST(c, (PyObject*)co); - ADDOP_LOAD_CONST(c, qualname); + ADDOP_LOAD_CONST(c, (PyObject*)co); + ADDOP_LOAD_CONST(c, qualname); ADDOP_I(c, MAKE_FUNCTION, flags); return 1; } @@ -2001,7 +2001,7 @@ compiler_visit_kwonlydefaults(struct compiler *c, asdl_seq *kwonlyargs, Py_ssize_t default_count = PyList_GET_SIZE(keys); PyObject *keys_tuple = PyList_AsTuple(keys); Py_DECREF(keys); - ADDOP_LOAD_CONST_NEW(c, keys_tuple); + ADDOP_LOAD_CONST_NEW(c, keys_tuple); ADDOP_I(c, BUILD_CONST_KEY_MAP, default_count); assert(default_count > 0); return 1; @@ -2018,7 +2018,7 @@ error: static int compiler_visit_annexpr(struct compiler *c, expr_ty annotation) { - ADDOP_LOAD_CONST_NEW(c, _PyAST_ExprAsUnicode(annotation)); + ADDOP_LOAD_CONST_NEW(c, _PyAST_ExprAsUnicode(annotation)); return 1; } @@ -2081,8 +2081,8 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args, if (!compiler_visit_argannotations(c, args->args, names)) goto error; - if (!compiler_visit_argannotations(c, args->posonlyargs, names)) - goto error; + if (!compiler_visit_argannotations(c, args->posonlyargs, names)) + goto error; if (args->vararg && args->vararg->annotation && !compiler_visit_argannotation(c, args->vararg->arg, args->vararg->annotation, names)) @@ -2107,7 +2107,7 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args, if (len) { PyObject *keytuple = PyList_AsTuple(names); Py_DECREF(names); - ADDOP_LOAD_CONST_NEW(c, keytuple); + ADDOP_LOAD_CONST_NEW(c, keytuple); ADDOP_I(c, BUILD_CONST_KEY_MAP, len); return 1; } @@ -2152,59 +2152,59 @@ compiler_default_arguments(struct compiler *c, arguments_ty args) } static int -forbidden_name(struct compiler *c, identifier name, expr_context_ty ctx) -{ - - if (ctx == Store && _PyUnicode_EqualToASCIIString(name, "__debug__")) { - compiler_error(c, "cannot assign to __debug__"); - return 1; - } - return 0; -} - -static int -compiler_check_debug_one_arg(struct compiler *c, arg_ty arg) -{ - if (arg != NULL) { - if (forbidden_name(c, arg->arg, Store)) - return 0; - } - return 1; -} - -static int -compiler_check_debug_args_seq(struct compiler *c, asdl_seq *args) -{ - if (args != NULL) { - for (Py_ssize_t i = 0, n = asdl_seq_LEN(args); i < n; i++) { - if (!compiler_check_debug_one_arg(c, asdl_seq_GET(args, i))) - return 0; - } - } - return 1; -} - -static int -compiler_check_debug_args(struct compiler *c, arguments_ty args) -{ - if (!compiler_check_debug_args_seq(c, args->posonlyargs)) - return 0; - if (!compiler_check_debug_args_seq(c, args->args)) - return 0; - if (!compiler_check_debug_one_arg(c, args->vararg)) - return 0; - if (!compiler_check_debug_args_seq(c, args->kwonlyargs)) - return 0; - if (!compiler_check_debug_one_arg(c, args->kwarg)) - return 0; - return 1; -} - -static int +forbidden_name(struct compiler *c, identifier name, expr_context_ty ctx) +{ + + if (ctx == Store && _PyUnicode_EqualToASCIIString(name, "__debug__")) { + compiler_error(c, "cannot assign to __debug__"); + return 1; + } + return 0; +} + +static int +compiler_check_debug_one_arg(struct compiler *c, arg_ty arg) +{ + if (arg != NULL) { + if (forbidden_name(c, arg->arg, Store)) + return 0; + } + return 1; +} + +static int +compiler_check_debug_args_seq(struct compiler *c, asdl_seq *args) +{ + if (args != NULL) { + for (Py_ssize_t i = 0, n = asdl_seq_LEN(args); i < n; i++) { + if (!compiler_check_debug_one_arg(c, asdl_seq_GET(args, i))) + return 0; + } + } + return 1; +} + +static int +compiler_check_debug_args(struct compiler *c, arguments_ty args) +{ + if (!compiler_check_debug_args_seq(c, args->posonlyargs)) + return 0; + if (!compiler_check_debug_args_seq(c, args->args)) + return 0; + if (!compiler_check_debug_one_arg(c, args->vararg)) + return 0; + if (!compiler_check_debug_args_seq(c, args->kwonlyargs)) + return 0; + if (!compiler_check_debug_one_arg(c, args->kwarg)) + return 0; + return 1; +} + +static int compiler_function(struct compiler *c, stmt_ty s, int is_async) { PyCodeObject *co; - PyObject *qualname, *docstring = NULL; + PyObject *qualname, *docstring = NULL; arguments_ty args; expr_ty returns; identifier name; @@ -2213,7 +2213,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) Py_ssize_t i, funcflags; int annotations; int scope_type; - int firstlineno; + int firstlineno; if (is_async) { assert(s->kind == AsyncFunctionDef_kind); @@ -2237,17 +2237,17 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) scope_type = COMPILER_SCOPE_FUNCTION; } - if (!compiler_check_debug_args(c, args)) - return 0; - + if (!compiler_check_debug_args(c, args)) + return 0; + if (!compiler_decorators(c, decos)) return 0; - firstlineno = s->lineno; - if (asdl_seq_LEN(decos)) { - firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; - } - + firstlineno = s->lineno; + if (asdl_seq_LEN(decos)) { + firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; + } + funcflags = compiler_default_arguments(c, args); if (funcflags == -1) { return 0; @@ -2261,21 +2261,21 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) funcflags |= 0x04; } - if (!compiler_enter_scope(c, name, scope_type, (void *)s, firstlineno)) { + if (!compiler_enter_scope(c, name, scope_type, (void *)s, firstlineno)) { return 0; } - /* if not -OO mode, add docstring */ - if (c->c_optimize < 2) { - docstring = _PyAST_GetDocString(body); + /* if not -OO mode, add docstring */ + if (c->c_optimize < 2) { + docstring = _PyAST_GetDocString(body); } - if (compiler_add_const(c, docstring ? docstring : Py_None) < 0) { + if (compiler_add_const(c, docstring ? docstring : Py_None) < 0) { compiler_exit_scope(c); return 0; } c->u->u_argcount = asdl_seq_LEN(args->args); - c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs); + c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs); c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs); VISIT_SEQ_IN_SCOPE(c, stmt, body); co = assemble(c, 1); @@ -2305,17 +2305,17 @@ compiler_class(struct compiler *c, stmt_ty s) { PyCodeObject *co; PyObject *str; - int i, firstlineno; + int i, firstlineno; asdl_seq* decos = s->v.ClassDef.decorator_list; if (!compiler_decorators(c, decos)) return 0; - firstlineno = s->lineno; - if (asdl_seq_LEN(decos)) { - firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; - } - + firstlineno = s->lineno; + if (asdl_seq_LEN(decos)) { + firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; + } + /* ultimately generate code for: <name> = __build_class__(<func>, <name>, *<bases>, **<keywords>) where: @@ -2330,7 +2330,7 @@ compiler_class(struct compiler *c, stmt_ty s) /* 1. compile the class body into a code object */ if (!compiler_enter_scope(c, s->v.ClassDef.name, - COMPILER_SCOPE_CLASS, (void *)s, firstlineno)) + COMPILER_SCOPE_CLASS, (void *)s, firstlineno)) return 0; /* this block represents what we do in the new scope */ { @@ -2354,7 +2354,7 @@ compiler_class(struct compiler *c, stmt_ty s) } Py_DECREF(str); assert(c->u->u_qualname); - ADDOP_LOAD_CONST(c, c->u->u_qualname); + ADDOP_LOAD_CONST(c, c->u->u_qualname); str = PyUnicode_InternFromString("__qualname__"); if (!str || !compiler_nameop(c, str, Store)) { Py_XDECREF(str); @@ -2396,7 +2396,7 @@ compiler_class(struct compiler *c, stmt_ty s) else { /* No methods referenced __class__, so just return None */ assert(PyDict_GET_SIZE(c->u->u_cellvars) == 0); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); } ADDOP_IN_SCOPE(c, RETURN_VALUE); /* create the code object */ @@ -2415,7 +2415,7 @@ compiler_class(struct compiler *c, stmt_ty s) Py_DECREF(co); /* 4. load class name */ - ADDOP_LOAD_CONST(c, s->v.ClassDef.name); + ADDOP_LOAD_CONST(c, s->v.ClassDef.name); /* 5. generate the rest of the code for the call */ if (!compiler_call_helper(c, 2, @@ -2434,90 +2434,90 @@ compiler_class(struct compiler *c, stmt_ty s) return 1; } -/* Return 0 if the expression is a constant value except named singletons. - Return 1 otherwise. */ +/* Return 0 if the expression is a constant value except named singletons. + Return 1 otherwise. */ static int -check_is_arg(expr_ty e) -{ - if (e->kind != Constant_kind) { - return 1; - } - PyObject *value = e->v.Constant.value; - return (value == Py_None - || value == Py_False - || value == Py_True - || value == Py_Ellipsis); -} - -/* Check operands of identity chacks ("is" and "is not"). - Emit a warning if any operand is a constant except named singletons. - Return 0 on error. - */ -static int -check_compare(struct compiler *c, expr_ty e) -{ - Py_ssize_t i, n; - int left = check_is_arg(e->v.Compare.left); - n = asdl_seq_LEN(e->v.Compare.ops); - for (i = 0; i < n; i++) { - cmpop_ty op = (cmpop_ty)asdl_seq_GET(e->v.Compare.ops, i); - int right = check_is_arg((expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); - if (op == Is || op == IsNot) { - if (!right || !left) { - const char *msg = (op == Is) - ? "\"is\" with a literal. Did you mean \"==\"?" - : "\"is not\" with a literal. Did you mean \"!=\"?"; - return compiler_warn(c, msg); - } - } - left = right; - } - return 1; -} - -static int compiler_addcompare(struct compiler *c, cmpop_ty op) -{ - int cmp; +check_is_arg(expr_ty e) +{ + if (e->kind != Constant_kind) { + return 1; + } + PyObject *value = e->v.Constant.value; + return (value == Py_None + || value == Py_False + || value == Py_True + || value == Py_Ellipsis); +} + +/* Check operands of identity chacks ("is" and "is not"). + Emit a warning if any operand is a constant except named singletons. + Return 0 on error. + */ +static int +check_compare(struct compiler *c, expr_ty e) +{ + Py_ssize_t i, n; + int left = check_is_arg(e->v.Compare.left); + n = asdl_seq_LEN(e->v.Compare.ops); + for (i = 0; i < n; i++) { + cmpop_ty op = (cmpop_ty)asdl_seq_GET(e->v.Compare.ops, i); + int right = check_is_arg((expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); + if (op == Is || op == IsNot) { + if (!right || !left) { + const char *msg = (op == Is) + ? "\"is\" with a literal. Did you mean \"==\"?" + : "\"is not\" with a literal. Did you mean \"!=\"?"; + return compiler_warn(c, msg); + } + } + left = right; + } + return 1; +} + +static int compiler_addcompare(struct compiler *c, cmpop_ty op) +{ + int cmp; switch (op) { case Eq: - cmp = Py_EQ; - break; + cmp = Py_EQ; + break; case NotEq: - cmp = Py_NE; - break; + cmp = Py_NE; + break; case Lt: - cmp = Py_LT; - break; + cmp = Py_LT; + break; case LtE: - cmp = Py_LE; - break; + cmp = Py_LE; + break; case Gt: - cmp = Py_GT; - break; + cmp = Py_GT; + break; case GtE: - cmp = Py_GE; - break; + cmp = Py_GE; + break; case Is: - ADDOP_I(c, IS_OP, 0); - return 1; + ADDOP_I(c, IS_OP, 0); + return 1; case IsNot: - ADDOP_I(c, IS_OP, 1); - return 1; + ADDOP_I(c, IS_OP, 1); + return 1; case In: - ADDOP_I(c, CONTAINS_OP, 0); - return 1; + ADDOP_I(c, CONTAINS_OP, 0); + return 1; case NotIn: - ADDOP_I(c, CONTAINS_OP, 1); - return 1; + ADDOP_I(c, CONTAINS_OP, 1); + return 1; default: - Py_UNREACHABLE(); + Py_UNREACHABLE(); } - ADDOP_I(c, COMPARE_OP, cmp); - return 1; + ADDOP_I(c, COMPARE_OP, cmp); + return 1; } - - + + static int compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) { @@ -2570,9 +2570,9 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) case Compare_kind: { Py_ssize_t i, n = asdl_seq_LEN(e->v.Compare.ops) - 1; if (n > 0) { - if (!check_compare(c, e)) { - return 0; - } + if (!check_compare(c, e)) { + return 0; + } basicblock *cleanup = compiler_new_block(c); if (cleanup == NULL) return 0; @@ -2582,12 +2582,12 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); - ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); + ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); ADDOP_JABS(c, POP_JUMP_IF_FALSE, cleanup); NEXT_BLOCK(c); } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n)); - ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, n)); + ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, n)); ADDOP_JABS(c, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE, next); basicblock *end = compiler_new_block(c); if (end == NULL) @@ -2647,9 +2647,9 @@ compiler_lambda(struct compiler *c, expr_ty e) arguments_ty args = e->v.Lambda.args; assert(e->kind == Lambda_kind); - if (!compiler_check_debug_args(c, args)) - return 0; - + if (!compiler_check_debug_args(c, args)) + return 0; + if (!name) { name = PyUnicode_InternFromString("<lambda>"); if (!name) @@ -2667,11 +2667,11 @@ compiler_lambda(struct compiler *c, expr_ty e) /* Make None the first constant, so the lambda can't have a docstring. */ - if (compiler_add_const(c, Py_None) < 0) + if (compiler_add_const(c, Py_None) < 0) return 0; c->u->u_argcount = asdl_seq_LEN(args->args); - c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs); + c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs); c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); if (c->u->u_ste->ste_generator) { @@ -2709,31 +2709,31 @@ compiler_if(struct compiler *c, stmt_ty s) * constant = 1: "if 1", "if 2", ... * constant = -1: rest */ if (constant == 0) { - BEGIN_DO_NOT_EMIT_BYTECODE - VISIT_SEQ(c, stmt, s->v.If.body); - END_DO_NOT_EMIT_BYTECODE - if (s->v.If.orelse) { + BEGIN_DO_NOT_EMIT_BYTECODE + VISIT_SEQ(c, stmt, s->v.If.body); + END_DO_NOT_EMIT_BYTECODE + if (s->v.If.orelse) { VISIT_SEQ(c, stmt, s->v.If.orelse); - } + } } else if (constant == 1) { VISIT_SEQ(c, stmt, s->v.If.body); - if (s->v.If.orelse) { - BEGIN_DO_NOT_EMIT_BYTECODE - VISIT_SEQ(c, stmt, s->v.If.orelse); - END_DO_NOT_EMIT_BYTECODE - } + if (s->v.If.orelse) { + BEGIN_DO_NOT_EMIT_BYTECODE + VISIT_SEQ(c, stmt, s->v.If.orelse); + END_DO_NOT_EMIT_BYTECODE + } } else { if (asdl_seq_LEN(s->v.If.orelse)) { next = compiler_new_block(c); if (next == NULL) return 0; } - else { + else { next = end; - } - if (!compiler_jump_if(c, s->v.If.test, next, 0)) { + } + if (!compiler_jump_if(c, s->v.If.test, next, 0)) { return 0; - } + } VISIT_SEQ(c, stmt, s->v.If.body); if (asdl_seq_LEN(s->v.If.orelse)) { ADDOP_JREL(c, JUMP_FORWARD, end); @@ -2753,12 +2753,12 @@ compiler_for(struct compiler *c, stmt_ty s) start = compiler_new_block(c); cleanup = compiler_new_block(c); end = compiler_new_block(c); - if (start == NULL || end == NULL || cleanup == NULL) { + if (start == NULL || end == NULL || cleanup == NULL) { return 0; - } - if (!compiler_push_fblock(c, FOR_LOOP, start, end, NULL)) { + } + if (!compiler_push_fblock(c, FOR_LOOP, start, end, NULL)) { return 0; - } + } VISIT(c, expr, s->v.For.iter); ADDOP(c, GET_ITER); compiler_use_next_block(c, start); @@ -2767,9 +2767,9 @@ compiler_for(struct compiler *c, stmt_ty s) VISIT_SEQ(c, stmt, s->v.For.body); ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, cleanup); - - compiler_pop_fblock(c, FOR_LOOP, start); - + + compiler_pop_fblock(c, FOR_LOOP, start); + VISIT_SEQ(c, stmt, s->v.For.orelse); compiler_use_next_block(c, end); return 1; @@ -2779,52 +2779,52 @@ compiler_for(struct compiler *c, stmt_ty s) static int compiler_async_for(struct compiler *c, stmt_ty s) { - basicblock *start, *except, *end; - if (IS_TOP_LEVEL_AWAIT(c)){ - c->u->u_ste->ste_coroutine = 1; - } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION) { + basicblock *start, *except, *end; + if (IS_TOP_LEVEL_AWAIT(c)){ + c->u->u_ste->ste_coroutine = 1; + } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION) { return compiler_error(c, "'async for' outside async function"); } - start = compiler_new_block(c); + start = compiler_new_block(c); except = compiler_new_block(c); end = compiler_new_block(c); - if (start == NULL || except == NULL || end == NULL) { + if (start == NULL || except == NULL || end == NULL) { return 0; - } + } VISIT(c, expr, s->v.AsyncFor.iter); ADDOP(c, GET_AITER); - compiler_use_next_block(c, start); - if (!compiler_push_fblock(c, FOR_LOOP, start, end, NULL)) { + compiler_use_next_block(c, start); + if (!compiler_push_fblock(c, FOR_LOOP, start, end, NULL)) { return 0; - } - /* SETUP_FINALLY to guard the __anext__ call */ - ADDOP_JREL(c, SETUP_FINALLY, except); + } + /* SETUP_FINALLY to guard the __anext__ call */ + ADDOP_JREL(c, SETUP_FINALLY, except); ADDOP(c, GET_ANEXT); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); - ADDOP(c, POP_BLOCK); /* for SETUP_FINALLY */ - - /* Success block for __anext__ */ + ADDOP(c, POP_BLOCK); /* for SETUP_FINALLY */ + + /* Success block for __anext__ */ VISIT(c, expr, s->v.AsyncFor.target); - VISIT_SEQ(c, stmt, s->v.AsyncFor.body); - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + VISIT_SEQ(c, stmt, s->v.AsyncFor.body); + ADDOP_JABS(c, JUMP_ABSOLUTE, start); - compiler_pop_fblock(c, FOR_LOOP, start); + compiler_pop_fblock(c, FOR_LOOP, start); - /* Except block for __anext__ */ + /* Except block for __anext__ */ compiler_use_next_block(c, except); - - /* We don't want to trace the END_ASYNC_FOR, so make sure - * that it has the same lineno as the following instruction. */ - if (asdl_seq_LEN(s->v.For.orelse)) { - SET_LOC(c, (stmt_ty)asdl_seq_GET(s->v.For.orelse, 0)); - } - ADDOP(c, END_ASYNC_FOR); - - /* `else` block */ + + /* We don't want to trace the END_ASYNC_FOR, so make sure + * that it has the same lineno as the following instruction. */ + if (asdl_seq_LEN(s->v.For.orelse)) { + SET_LOC(c, (stmt_ty)asdl_seq_GET(s->v.For.orelse, 0)); + } + ADDOP(c, END_ASYNC_FOR); + + /* `else` block */ VISIT_SEQ(c, stmt, s->v.For.orelse); compiler_use_next_block(c, end); @@ -2839,20 +2839,20 @@ compiler_while(struct compiler *c, stmt_ty s) int constant = expr_constant(s->v.While.test); if (constant == 0) { - BEGIN_DO_NOT_EMIT_BYTECODE - // Push a dummy block so the VISIT_SEQ knows that we are - // inside a while loop so it can correctly evaluate syntax - // errors. - if (!compiler_push_fblock(c, WHILE_LOOP, NULL, NULL, NULL)) { - return 0; - } - VISIT_SEQ(c, stmt, s->v.While.body); - // Remove the dummy block now that is not needed. - compiler_pop_fblock(c, WHILE_LOOP, NULL); - END_DO_NOT_EMIT_BYTECODE - if (s->v.While.orelse) { + BEGIN_DO_NOT_EMIT_BYTECODE + // Push a dummy block so the VISIT_SEQ knows that we are + // inside a while loop so it can correctly evaluate syntax + // errors. + if (!compiler_push_fblock(c, WHILE_LOOP, NULL, NULL, NULL)) { + return 0; + } + VISIT_SEQ(c, stmt, s->v.While.body); + // Remove the dummy block now that is not needed. + compiler_pop_fblock(c, WHILE_LOOP, NULL); + END_DO_NOT_EMIT_BYTECODE + if (s->v.While.orelse) { VISIT_SEQ(c, stmt, s->v.While.orelse); - } + } return 1; } loop = compiler_new_block(c); @@ -2873,7 +2873,7 @@ compiler_while(struct compiler *c, stmt_ty s) orelse = NULL; compiler_use_next_block(c, loop); - if (!compiler_push_fblock(c, WHILE_LOOP, loop, end, NULL)) + if (!compiler_push_fblock(c, WHILE_LOOP, loop, end, NULL)) return 0; if (constant == -1) { if (!compiler_jump_if(c, s->v.While.test, anchor, 0)) @@ -2888,8 +2888,8 @@ compiler_while(struct compiler *c, stmt_ty s) if (constant == -1) compiler_use_next_block(c, anchor); - compiler_pop_fblock(c, WHILE_LOOP, loop); - + compiler_pop_fblock(c, WHILE_LOOP, loop); + if (orelse != NULL) /* what if orelse is just pass? */ VISIT_SEQ(c, stmt, s->v.While.orelse); compiler_use_next_block(c, end); @@ -2898,76 +2898,76 @@ compiler_while(struct compiler *c, stmt_ty s) } static int -compiler_return(struct compiler *c, stmt_ty s) -{ - int preserve_tos = ((s->v.Return.value != NULL) && - (s->v.Return.value->kind != Constant_kind)); - if (c->u->u_ste->ste_type != FunctionBlock) - return compiler_error(c, "'return' outside function"); - if (s->v.Return.value != NULL && - c->u->u_ste->ste_coroutine && c->u->u_ste->ste_generator) - { - return compiler_error( - c, "'return' with value in async generator"); - } - if (preserve_tos) { - VISIT(c, expr, s->v.Return.value); - } - if (!compiler_unwind_fblock_stack(c, preserve_tos, NULL)) - return 0; - if (s->v.Return.value == NULL) { - ADDOP_LOAD_CONST(c, Py_None); - } - else if (!preserve_tos) { - VISIT(c, expr, s->v.Return.value); - } - ADDOP(c, RETURN_VALUE); +compiler_return(struct compiler *c, stmt_ty s) +{ + int preserve_tos = ((s->v.Return.value != NULL) && + (s->v.Return.value->kind != Constant_kind)); + if (c->u->u_ste->ste_type != FunctionBlock) + return compiler_error(c, "'return' outside function"); + if (s->v.Return.value != NULL && + c->u->u_ste->ste_coroutine && c->u->u_ste->ste_generator) + { + return compiler_error( + c, "'return' with value in async generator"); + } + if (preserve_tos) { + VISIT(c, expr, s->v.Return.value); + } + if (!compiler_unwind_fblock_stack(c, preserve_tos, NULL)) + return 0; + if (s->v.Return.value == NULL) { + ADDOP_LOAD_CONST(c, Py_None); + } + else if (!preserve_tos) { + VISIT(c, expr, s->v.Return.value); + } + ADDOP(c, RETURN_VALUE); + + return 1; +} + +static int +compiler_break(struct compiler *c) +{ + struct fblockinfo *loop = NULL; + if (!compiler_unwind_fblock_stack(c, 0, &loop)) { + return 0; + } + if (loop == NULL) { + return compiler_error(c, "'break' outside loop"); + } + if (!compiler_unwind_fblock(c, loop, 0)) { + return 0; + } + ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_exit); + return 1; +} +static int +compiler_continue(struct compiler *c) +{ + struct fblockinfo *loop = NULL; + if (!compiler_unwind_fblock_stack(c, 0, &loop)) { + return 0; + } + if (loop == NULL) { + return compiler_error(c, "'continue' not properly in loop"); + } + ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_block); return 1; } -static int -compiler_break(struct compiler *c) -{ - struct fblockinfo *loop = NULL; - if (!compiler_unwind_fblock_stack(c, 0, &loop)) { - return 0; - } - if (loop == NULL) { - return compiler_error(c, "'break' outside loop"); - } - if (!compiler_unwind_fblock(c, loop, 0)) { - return 0; - } - ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_exit); - return 1; -} - -static int -compiler_continue(struct compiler *c) -{ - struct fblockinfo *loop = NULL; - if (!compiler_unwind_fblock_stack(c, 0, &loop)) { - return 0; - } - if (loop == NULL) { - return compiler_error(c, "'continue' not properly in loop"); - } - ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_block); - return 1; -} - - + /* Code generated for "try: <body> finally: <finalbody>" is as follows: SETUP_FINALLY L <code for body> POP_BLOCK - <code for finalbody> - JUMP E - L: - <code for finalbody> - E: + <code for finalbody> + JUMP E + L: + <code for finalbody> + E: The special instructions use the block stack. Each block stack entry contains the instruction that created it (here @@ -2978,30 +2978,30 @@ compiler_continue(struct compiler *c) Pushes the current value stack level and the label onto the block stack. POP_BLOCK: - Pops en entry from the block stack. + Pops en entry from the block stack. The block stack is unwound when an exception is raised: - when a SETUP_FINALLY entry is found, the raised and the caught - exceptions are pushed onto the value stack (and the exception - condition is cleared), and the interpreter jumps to the label - gotten from the block stack. + when a SETUP_FINALLY entry is found, the raised and the caught + exceptions are pushed onto the value stack (and the exception + condition is cleared), and the interpreter jumps to the label + gotten from the block stack. */ static int compiler_try_finally(struct compiler *c, stmt_ty s) { - basicblock *body, *end, *exit; - + basicblock *body, *end, *exit; + body = compiler_new_block(c); end = compiler_new_block(c); - exit = compiler_new_block(c); - if (body == NULL || end == NULL || exit == NULL) + exit = compiler_new_block(c); + if (body == NULL || end == NULL || exit == NULL) return 0; - /* `try` block */ + /* `try` block */ ADDOP_JREL(c, SETUP_FINALLY, end); compiler_use_next_block(c, body); - if (!compiler_push_fblock(c, FINALLY_TRY, body, end, s->v.Try.finalbody)) + if (!compiler_push_fblock(c, FINALLY_TRY, body, end, s->v.Try.finalbody)) return 0; if (s->v.Try.handlers && asdl_seq_LEN(s->v.Try.handlers)) { if (!compiler_try_except(c, s)) @@ -3011,17 +3011,17 @@ compiler_try_finally(struct compiler *c, stmt_ty s) VISIT_SEQ(c, stmt, s->v.Try.body); } ADDOP(c, POP_BLOCK); - compiler_pop_fblock(c, FINALLY_TRY, body); - VISIT_SEQ(c, stmt, s->v.Try.finalbody); - ADDOP_JREL(c, JUMP_FORWARD, exit); - /* `finally` block */ - compiler_use_next_block(c, end); - if (!compiler_push_fblock(c, FINALLY_END, end, NULL, NULL)) - return 0; - VISIT_SEQ(c, stmt, s->v.Try.finalbody); - compiler_pop_fblock(c, FINALLY_END, end); - ADDOP(c, RERAISE); - compiler_use_next_block(c, exit); + compiler_pop_fblock(c, FINALLY_TRY, body); + VISIT_SEQ(c, stmt, s->v.Try.finalbody); + ADDOP_JREL(c, JUMP_FORWARD, exit); + /* `finally` block */ + compiler_use_next_block(c, end); + if (!compiler_push_fblock(c, FINALLY_END, end, NULL, NULL)) + return 0; + VISIT_SEQ(c, stmt, s->v.Try.finalbody); + compiler_pop_fblock(c, FINALLY_END, end); + ADDOP(c, RERAISE); + compiler_use_next_block(c, exit); return 1; } @@ -3032,14 +3032,14 @@ compiler_try_finally(struct compiler *c, stmt_ty s) associated value, and 'exc' the exception.) Value stack Label Instruction Argument - [] SETUP_FINALLY L1 + [] SETUP_FINALLY L1 [] <code for S> [] POP_BLOCK [] JUMP_FORWARD L0 [tb, val, exc] L1: DUP ) [tb, val, exc, exc] <evaluate E1> ) - [tb, val, exc, exc, E1] JUMP_IF_NOT_EXC_MATCH L2 ) only if E1 + [tb, val, exc, exc, E1] JUMP_IF_NOT_EXC_MATCH L2 ) only if E1 [tb, val, exc] POP [tb, val] <assign to V1> (or POP if no V1) [tb] POP @@ -3049,7 +3049,7 @@ compiler_try_finally(struct compiler *c, stmt_ty s) [tb, val, exc] L2: DUP .............................etc....................... - [tb, val, exc] Ln+1: RERAISE # re-raise exception + [tb, val, exc] Ln+1: RERAISE # re-raise exception [] L0: <next statement> @@ -3067,32 +3067,32 @@ compiler_try_except(struct compiler *c, stmt_ty s) end = compiler_new_block(c); if (body == NULL || except == NULL || orelse == NULL || end == NULL) return 0; - ADDOP_JREL(c, SETUP_FINALLY, except); + ADDOP_JREL(c, SETUP_FINALLY, except); compiler_use_next_block(c, body); - if (!compiler_push_fblock(c, TRY_EXCEPT, body, NULL, NULL)) + if (!compiler_push_fblock(c, TRY_EXCEPT, body, NULL, NULL)) return 0; VISIT_SEQ(c, stmt, s->v.Try.body); ADDOP(c, POP_BLOCK); - compiler_pop_fblock(c, TRY_EXCEPT, body); + compiler_pop_fblock(c, TRY_EXCEPT, body); ADDOP_JREL(c, JUMP_FORWARD, orelse); n = asdl_seq_LEN(s->v.Try.handlers); compiler_use_next_block(c, except); - /* Runtime will push a block here, so we need to account for that */ - if (!compiler_push_fblock(c, EXCEPTION_HANDLER, NULL, NULL, NULL)) - return 0; + /* Runtime will push a block here, so we need to account for that */ + if (!compiler_push_fblock(c, EXCEPTION_HANDLER, NULL, NULL, NULL)) + return 0; for (i = 0; i < n; i++) { excepthandler_ty handler = (excepthandler_ty)asdl_seq_GET( s->v.Try.handlers, i); if (!handler->v.ExceptHandler.type && i < n-1) return compiler_error(c, "default 'except:' must be last"); - SET_LOC(c, handler); + SET_LOC(c, handler); except = compiler_new_block(c); if (except == NULL) return 0; if (handler->v.ExceptHandler.type) { ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); - ADDOP_JABS(c, JUMP_IF_NOT_EXC_MATCH, except); + ADDOP_JABS(c, JUMP_IF_NOT_EXC_MATCH, except); } ADDOP(c, POP_TOP); if (handler->v.ExceptHandler.name) { @@ -3114,36 +3114,36 @@ compiler_try_except(struct compiler *c, stmt_ty s) try: # body finally: - name = None # in case body contains "del name" + name = None # in case body contains "del name" del name */ /* second try: */ ADDOP_JREL(c, SETUP_FINALLY, cleanup_end); compiler_use_next_block(c, cleanup_body); - if (!compiler_push_fblock(c, HANDLER_CLEANUP, cleanup_body, NULL, handler->v.ExceptHandler.name)) + if (!compiler_push_fblock(c, HANDLER_CLEANUP, cleanup_body, NULL, handler->v.ExceptHandler.name)) return 0; /* second # body */ VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body); - compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body); + compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body); ADDOP(c, POP_BLOCK); - ADDOP(c, POP_EXCEPT); - /* name = None; del name */ - ADDOP_LOAD_CONST(c, Py_None); - compiler_nameop(c, handler->v.ExceptHandler.name, Store); - compiler_nameop(c, handler->v.ExceptHandler.name, Del); - ADDOP_JREL(c, JUMP_FORWARD, end); - - /* except: */ + ADDOP(c, POP_EXCEPT); + /* name = None; del name */ + ADDOP_LOAD_CONST(c, Py_None); + compiler_nameop(c, handler->v.ExceptHandler.name, Store); + compiler_nameop(c, handler->v.ExceptHandler.name, Del); + ADDOP_JREL(c, JUMP_FORWARD, end); + + /* except: */ compiler_use_next_block(c, cleanup_end); - /* name = None; del name */ - ADDOP_LOAD_CONST(c, Py_None); + /* name = None; del name */ + ADDOP_LOAD_CONST(c, Py_None); compiler_nameop(c, handler->v.ExceptHandler.name, Store); compiler_nameop(c, handler->v.ExceptHandler.name, Del); - ADDOP(c, RERAISE); + ADDOP(c, RERAISE); } else { basicblock *cleanup_body; @@ -3155,17 +3155,17 @@ compiler_try_except(struct compiler *c, stmt_ty s) ADDOP(c, POP_TOP); ADDOP(c, POP_TOP); compiler_use_next_block(c, cleanup_body); - if (!compiler_push_fblock(c, HANDLER_CLEANUP, cleanup_body, NULL, NULL)) + if (!compiler_push_fblock(c, HANDLER_CLEANUP, cleanup_body, NULL, NULL)) return 0; VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body); - compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body); + compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body); ADDOP(c, POP_EXCEPT); - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JREL(c, JUMP_FORWARD, end); } compiler_use_next_block(c, except); } - compiler_pop_fblock(c, EXCEPTION_HANDLER, NULL); - ADDOP(c, RERAISE); + compiler_pop_fblock(c, EXCEPTION_HANDLER, NULL); + ADDOP(c, RERAISE); compiler_use_next_block(c, orelse); VISIT_SEQ(c, stmt, s->v.Try.orelse); compiler_use_next_block(c, end); @@ -3237,8 +3237,8 @@ compiler_import(struct compiler *c, stmt_ty s) alias_ty alias = (alias_ty)asdl_seq_GET(s->v.Import.names, i); int r; - ADDOP_LOAD_CONST(c, _PyLong_Zero); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, _PyLong_Zero); + ADDOP_LOAD_CONST(c, Py_None); ADDOP_NAME(c, IMPORT_NAME, alias->name, names); if (alias->asname) { @@ -3270,7 +3270,7 @@ static int compiler_from_import(struct compiler *c, stmt_ty s) { Py_ssize_t i, n = asdl_seq_LEN(s->v.ImportFrom.names); - PyObject *names; + PyObject *names; static PyObject *empty_string; if (!empty_string) { @@ -3279,7 +3279,7 @@ compiler_from_import(struct compiler *c, stmt_ty s) return 0; } - ADDOP_LOAD_CONST_NEW(c, PyLong_FromLong(s->v.ImportFrom.level)); + ADDOP_LOAD_CONST_NEW(c, PyLong_FromLong(s->v.ImportFrom.level)); names = PyTuple_New(n); if (!names) @@ -3298,7 +3298,7 @@ compiler_from_import(struct compiler *c, stmt_ty s) return compiler_error(c, "from __future__ imports must occur " "at the beginning of the file"); } - ADDOP_LOAD_CONST_NEW(c, names); + ADDOP_LOAD_CONST_NEW(c, names); if (s->v.ImportFrom.module) { ADDOP_NAME(c, IMPORT_NAME, s->v.ImportFrom.module, names); @@ -3338,11 +3338,11 @@ compiler_assert(struct compiler *c, stmt_ty s) if (c->c_optimize) return 1; if (s->v.Assert.test->kind == Tuple_kind && - asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) - { - if (!compiler_warn(c, "assertion is always true, " - "perhaps remove parentheses?")) - { + asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) + { + if (!compiler_warn(c, "assertion is always true, " + "perhaps remove parentheses?")) + { return 0; } } @@ -3351,7 +3351,7 @@ compiler_assert(struct compiler *c, stmt_ty s) return 0; if (!compiler_jump_if(c, s->v.Assert.test, end, 1)) return 0; - ADDOP(c, LOAD_ASSERTION_ERROR); + ADDOP(c, LOAD_ASSERTION_ERROR); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); ADDOP_I(c, CALL_FUNCTION, 1); @@ -3370,7 +3370,7 @@ compiler_visit_stmt_expr(struct compiler *c, expr_ty value) return 1; } - if (value->kind == Constant_kind) { + if (value->kind == Constant_kind) { /* ignore constant statement */ return 1; } @@ -3386,7 +3386,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s) Py_ssize_t i, n; /* Always assign a lineno to the next instruction for a stmt. */ - SET_LOC(c, s); + SET_LOC(c, s); switch (s->kind) { case FunctionDef_kind: @@ -3394,7 +3394,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s) case ClassDef_kind: return compiler_class(c, s); case Return_kind: - return compiler_return(c, s); + return compiler_return(c, s); case Delete_kind: VISIT_SEQ(c, expr, s->v.Delete.targets) break; @@ -3446,7 +3446,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s) case Pass_kind: break; case Break_kind: - return compiler_break(c); + return compiler_break(c); case Continue_kind: return compiler_continue(c); case With_kind: @@ -3482,7 +3482,7 @@ unaryop(unaryop_ty op) } static int -binop(operator_ty op) +binop(operator_ty op) { switch (op) { case Add: @@ -3519,7 +3519,7 @@ binop(operator_ty op) } static int -inplace_binop(operator_ty op) +inplace_binop(operator_ty op) { switch (op) { case Add: @@ -3569,9 +3569,9 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) !_PyUnicode_EqualToASCIIString(name, "True") && !_PyUnicode_EqualToASCIIString(name, "False")); - if (forbidden_name(c, name, ctx)) - return 0; - + if (forbidden_name(c, name, ctx)) + return 0; + mangled = _Py_Mangle(c->u->u_private, name); if (!mangled) return 0; @@ -3613,14 +3613,14 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case Load: op = (c->u->u_ste->ste_type == ClassBlock) ? LOAD_CLASSDEREF : LOAD_DEREF; break; - case Store: op = STORE_DEREF; break; + case Store: op = STORE_DEREF; break; case Del: op = DELETE_DEREF; break; } break; case OP_FAST: switch (ctx) { case Load: op = LOAD_FAST; break; - case Store: op = STORE_FAST; break; + case Store: op = STORE_FAST; break; case Del: op = DELETE_FAST; break; } ADDOP_N(c, op, mangled, varnames); @@ -3628,21 +3628,21 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case OP_GLOBAL: switch (ctx) { case Load: op = LOAD_GLOBAL; break; - case Store: op = STORE_GLOBAL; break; + case Store: op = STORE_GLOBAL; break; case Del: op = DELETE_GLOBAL; break; } break; case OP_NAME: switch (ctx) { case Load: op = LOAD_NAME; break; - case Store: op = STORE_NAME; break; + case Store: op = STORE_NAME; break; case Del: op = DELETE_NAME; break; } break; } assert(op); - arg = compiler_add_o(dict, mangled); + arg = compiler_add_o(dict, mangled); Py_DECREF(mangled); if (arg < 0) return 0; @@ -3678,78 +3678,78 @@ compiler_boolop(struct compiler *c, expr_ty e) } static int -starunpack_helper(struct compiler *c, asdl_seq *elts, int pushed, - int build, int add, int extend, int tuple) +starunpack_helper(struct compiler *c, asdl_seq *elts, int pushed, + int build, int add, int extend, int tuple) { Py_ssize_t n = asdl_seq_LEN(elts); - Py_ssize_t i, seen_star = 0; - if (n > 2 && are_all_items_const(elts, 0, n)) { - PyObject *folded = PyTuple_New(n); - if (folded == NULL) { - return 0; - } - PyObject *val; - for (i = 0; i < n; i++) { - val = ((expr_ty)asdl_seq_GET(elts, i))->v.Constant.value; - Py_INCREF(val); - PyTuple_SET_ITEM(folded, i, val); - } - if (tuple) { - ADDOP_LOAD_CONST_NEW(c, folded); - } else { - if (add == SET_ADD) { - Py_SETREF(folded, PyFrozenSet_New(folded)); - if (folded == NULL) { - return 0; - } - } - ADDOP_I(c, build, pushed); - ADDOP_LOAD_CONST_NEW(c, folded); - ADDOP_I(c, extend, 1); - } - return 1; - } - + Py_ssize_t i, seen_star = 0; + if (n > 2 && are_all_items_const(elts, 0, n)) { + PyObject *folded = PyTuple_New(n); + if (folded == NULL) { + return 0; + } + PyObject *val; + for (i = 0; i < n; i++) { + val = ((expr_ty)asdl_seq_GET(elts, i))->v.Constant.value; + Py_INCREF(val); + PyTuple_SET_ITEM(folded, i, val); + } + if (tuple) { + ADDOP_LOAD_CONST_NEW(c, folded); + } else { + if (add == SET_ADD) { + Py_SETREF(folded, PyFrozenSet_New(folded)); + if (folded == NULL) { + return 0; + } + } + ADDOP_I(c, build, pushed); + ADDOP_LOAD_CONST_NEW(c, folded); + ADDOP_I(c, extend, 1); + } + return 1; + } + for (i = 0; i < n; i++) { expr_ty elt = asdl_seq_GET(elts, i); if (elt->kind == Starred_kind) { - seen_star = 1; - } - } - if (seen_star) { - seen_star = 0; - for (i = 0; i < n; i++) { - expr_ty elt = asdl_seq_GET(elts, i); - if (elt->kind == Starred_kind) { - if (seen_star == 0) { - ADDOP_I(c, build, i+pushed); - seen_star = 1; - } - VISIT(c, expr, elt->v.Starred.value); - ADDOP_I(c, extend, 1); + seen_star = 1; + } + } + if (seen_star) { + seen_star = 0; + for (i = 0; i < n; i++) { + expr_ty elt = asdl_seq_GET(elts, i); + if (elt->kind == Starred_kind) { + if (seen_star == 0) { + ADDOP_I(c, build, i+pushed); + seen_star = 1; + } + VISIT(c, expr, elt->v.Starred.value); + ADDOP_I(c, extend, 1); + } + else { + VISIT(c, expr, elt); + if (seen_star) { + ADDOP_I(c, add, 1); + } } - else { - VISIT(c, expr, elt); - if (seen_star) { - ADDOP_I(c, add, 1); - } - } } - assert(seen_star); - if (tuple) { - ADDOP(c, LIST_TO_TUPLE); + assert(seen_star); + if (tuple) { + ADDOP(c, LIST_TO_TUPLE); } } - else { - for (i = 0; i < n; i++) { - expr_ty elt = asdl_seq_GET(elts, i); - VISIT(c, expr, elt); + else { + for (i = 0; i < n; i++) { + expr_ty elt = asdl_seq_GET(elts, i); + VISIT(c, expr, elt); + } + if (tuple) { + ADDOP_I(c, BUILD_TUPLE, n+pushed); + } else { + ADDOP_I(c, build, n+pushed); } - if (tuple) { - ADDOP_I(c, BUILD_TUPLE, n+pushed); - } else { - ADDOP_I(c, build, n+pushed); - } } return 1; } @@ -3773,16 +3773,16 @@ assignment_helper(struct compiler *c, asdl_seq *elts) } else if (elt->kind == Starred_kind) { return compiler_error(c, - "multiple starred expressions in assignment"); + "multiple starred expressions in assignment"); } } if (!seen_star) { ADDOP_I(c, UNPACK_SEQUENCE, n); } - for (i = 0; i < n; i++) { - expr_ty elt = asdl_seq_GET(elts, i); - VISIT(c, expr, elt->kind != Starred_kind ? elt : elt->v.Starred.value); - } + for (i = 0; i < n; i++) { + expr_ty elt = asdl_seq_GET(elts, i); + VISIT(c, expr, elt->kind != Starred_kind ? elt : elt->v.Starred.value); + } return 1; } @@ -3794,8 +3794,8 @@ compiler_list(struct compiler *c, expr_ty e) return assignment_helper(c, elts); } else if (e->v.List.ctx == Load) { - return starunpack_helper(c, elts, 0, BUILD_LIST, - LIST_APPEND, LIST_EXTEND, 0); + return starunpack_helper(c, elts, 0, BUILD_LIST, + LIST_APPEND, LIST_EXTEND, 0); } else VISIT_SEQ(c, expr, elts); @@ -3810,8 +3810,8 @@ compiler_tuple(struct compiler *c, expr_ty e) return assignment_helper(c, elts); } else if (e->v.Tuple.ctx == Load) { - return starunpack_helper(c, elts, 0, BUILD_LIST, - LIST_APPEND, LIST_EXTEND, 1); + return starunpack_helper(c, elts, 0, BUILD_LIST, + LIST_APPEND, LIST_EXTEND, 1); } else VISIT_SEQ(c, expr, elts); @@ -3821,8 +3821,8 @@ compiler_tuple(struct compiler *c, expr_ty e) static int compiler_set(struct compiler *c, expr_ty e) { - return starunpack_helper(c, e->v.Set.elts, 0, BUILD_SET, - SET_ADD, SET_UPDATE, 0); + return starunpack_helper(c, e->v.Set.elts, 0, BUILD_SET, + SET_ADD, SET_UPDATE, 0); } static int @@ -3831,7 +3831,7 @@ are_all_items_const(asdl_seq *seq, Py_ssize_t begin, Py_ssize_t end) Py_ssize_t i; for (i = begin; i < end; i++) { expr_ty key = (expr_ty)asdl_seq_GET(seq, i); - if (key == NULL || key->kind != Constant_kind) + if (key == NULL || key->kind != Constant_kind) return 0; } return 1; @@ -3851,11 +3851,11 @@ compiler_subdict(struct compiler *c, expr_ty e, Py_ssize_t begin, Py_ssize_t end return 0; } for (i = begin; i < end; i++) { - key = ((expr_ty)asdl_seq_GET(e->v.Dict.keys, i))->v.Constant.value; + key = ((expr_ty)asdl_seq_GET(e->v.Dict.keys, i))->v.Constant.value; Py_INCREF(key); PyTuple_SET_ITEM(keys, i - begin, key); } - ADDOP_LOAD_CONST_NEW(c, keys); + ADDOP_LOAD_CONST_NEW(c, keys); ADDOP_I(c, BUILD_CONST_KEY_MAP, n); } else { @@ -3872,58 +3872,58 @@ static int compiler_dict(struct compiler *c, expr_ty e) { Py_ssize_t i, n, elements; - int have_dict; + int have_dict; int is_unpacking = 0; n = asdl_seq_LEN(e->v.Dict.values); - have_dict = 0; + have_dict = 0; elements = 0; for (i = 0; i < n; i++) { is_unpacking = (expr_ty)asdl_seq_GET(e->v.Dict.keys, i) == NULL; if (is_unpacking) { - if (elements) { - if (!compiler_subdict(c, e, i - elements, i)) { - return 0; - } - if (have_dict) { - ADDOP_I(c, DICT_UPDATE, 1); - } - have_dict = 1; - elements = 0; - } - if (have_dict == 0) { - ADDOP_I(c, BUILD_MAP, 0); - have_dict = 1; - } + if (elements) { + if (!compiler_subdict(c, e, i - elements, i)) { + return 0; + } + if (have_dict) { + ADDOP_I(c, DICT_UPDATE, 1); + } + have_dict = 1; + elements = 0; + } + if (have_dict == 0) { + ADDOP_I(c, BUILD_MAP, 0); + have_dict = 1; + } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Dict.values, i)); - ADDOP_I(c, DICT_UPDATE, 1); + ADDOP_I(c, DICT_UPDATE, 1); } else { - if (elements == 0xFFFF) { - if (!compiler_subdict(c, e, i - elements, i + 1)) { - return 0; - } - if (have_dict) { - ADDOP_I(c, DICT_UPDATE, 1); - } - have_dict = 1; - elements = 0; - } - else { - elements++; - } - } - } - if (elements) { - if (!compiler_subdict(c, e, n - elements, n)) { + if (elements == 0xFFFF) { + if (!compiler_subdict(c, e, i - elements, i + 1)) { + return 0; + } + if (have_dict) { + ADDOP_I(c, DICT_UPDATE, 1); + } + have_dict = 1; + elements = 0; + } + else { + elements++; + } + } + } + if (elements) { + if (!compiler_subdict(c, e, n - elements, n)) { return 0; - } - if (have_dict) { - ADDOP_I(c, DICT_UPDATE, 1); - } - have_dict = 1; + } + if (have_dict) { + ADDOP_I(c, DICT_UPDATE, 1); + } + have_dict = 1; } - if (!have_dict) { - ADDOP_I(c, BUILD_MAP, 0); + if (!have_dict) { + ADDOP_I(c, BUILD_MAP, 0); } return 1; } @@ -3933,15 +3933,15 @@ compiler_compare(struct compiler *c, expr_ty e) { Py_ssize_t i, n; - if (!check_compare(c, e)) { - return 0; - } + if (!check_compare(c, e)) { + return 0; + } VISIT(c, expr, e->v.Compare.left); assert(asdl_seq_LEN(e->v.Compare.ops) > 0); n = asdl_seq_LEN(e->v.Compare.ops) - 1; if (n == 0) { VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, 0)); - ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, 0)); + ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, 0)); } else { basicblock *cleanup = compiler_new_block(c); @@ -3952,12 +3952,12 @@ compiler_compare(struct compiler *c, expr_ty e) (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); - ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); + ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n)); - ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, n)); + ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, n)); basicblock *end = compiler_new_block(c); if (end == NULL) return 0; @@ -3970,120 +3970,120 @@ compiler_compare(struct compiler *c, expr_ty e) return 1; } -static PyTypeObject * -infer_type(expr_ty e) -{ - switch (e->kind) { - case Tuple_kind: - return &PyTuple_Type; - case List_kind: - case ListComp_kind: - return &PyList_Type; - case Dict_kind: - case DictComp_kind: - return &PyDict_Type; - case Set_kind: - case SetComp_kind: - return &PySet_Type; - case GeneratorExp_kind: - return &PyGen_Type; - case Lambda_kind: - return &PyFunction_Type; - case JoinedStr_kind: - case FormattedValue_kind: - return &PyUnicode_Type; - case Constant_kind: - return Py_TYPE(e->v.Constant.value); - default: - return NULL; - } -} - -static int -check_caller(struct compiler *c, expr_ty e) -{ - switch (e->kind) { - case Constant_kind: - case Tuple_kind: - case List_kind: - case ListComp_kind: - case Dict_kind: - case DictComp_kind: - case Set_kind: - case SetComp_kind: - case GeneratorExp_kind: - case JoinedStr_kind: - case FormattedValue_kind: - return compiler_warn(c, "'%.200s' object is not callable; " - "perhaps you missed a comma?", - infer_type(e)->tp_name); - default: - return 1; - } -} - -static int -check_subscripter(struct compiler *c, expr_ty e) -{ - PyObject *v; - - switch (e->kind) { - case Constant_kind: - v = e->v.Constant.value; - if (!(v == Py_None || v == Py_Ellipsis || - PyLong_Check(v) || PyFloat_Check(v) || PyComplex_Check(v) || - PyAnySet_Check(v))) - { - return 1; - } - /* fall through */ - case Set_kind: - case SetComp_kind: - case GeneratorExp_kind: - case Lambda_kind: - return compiler_warn(c, "'%.200s' object is not subscriptable; " - "perhaps you missed a comma?", - infer_type(e)->tp_name); - default: - return 1; - } -} - -static int -check_index(struct compiler *c, expr_ty e, expr_ty s) -{ - PyObject *v; - - PyTypeObject *index_type = infer_type(s); - if (index_type == NULL - || PyType_FastSubclass(index_type, Py_TPFLAGS_LONG_SUBCLASS) - || index_type == &PySlice_Type) { - return 1; - } - - switch (e->kind) { - case Constant_kind: - v = e->v.Constant.value; - if (!(PyUnicode_Check(v) || PyBytes_Check(v) || PyTuple_Check(v))) { - return 1; - } - /* fall through */ - case Tuple_kind: - case List_kind: - case ListComp_kind: - case JoinedStr_kind: - case FormattedValue_kind: - return compiler_warn(c, "%.200s indices must be integers or slices, " - "not %.200s; " - "perhaps you missed a comma?", - infer_type(e)->tp_name, - index_type->tp_name); - default: - return 1; - } -} - -// Return 1 if the method call was optimized, -1 if not, and 0 on error. +static PyTypeObject * +infer_type(expr_ty e) +{ + switch (e->kind) { + case Tuple_kind: + return &PyTuple_Type; + case List_kind: + case ListComp_kind: + return &PyList_Type; + case Dict_kind: + case DictComp_kind: + return &PyDict_Type; + case Set_kind: + case SetComp_kind: + return &PySet_Type; + case GeneratorExp_kind: + return &PyGen_Type; + case Lambda_kind: + return &PyFunction_Type; + case JoinedStr_kind: + case FormattedValue_kind: + return &PyUnicode_Type; + case Constant_kind: + return Py_TYPE(e->v.Constant.value); + default: + return NULL; + } +} + +static int +check_caller(struct compiler *c, expr_ty e) +{ + switch (e->kind) { + case Constant_kind: + case Tuple_kind: + case List_kind: + case ListComp_kind: + case Dict_kind: + case DictComp_kind: + case Set_kind: + case SetComp_kind: + case GeneratorExp_kind: + case JoinedStr_kind: + case FormattedValue_kind: + return compiler_warn(c, "'%.200s' object is not callable; " + "perhaps you missed a comma?", + infer_type(e)->tp_name); + default: + return 1; + } +} + +static int +check_subscripter(struct compiler *c, expr_ty e) +{ + PyObject *v; + + switch (e->kind) { + case Constant_kind: + v = e->v.Constant.value; + if (!(v == Py_None || v == Py_Ellipsis || + PyLong_Check(v) || PyFloat_Check(v) || PyComplex_Check(v) || + PyAnySet_Check(v))) + { + return 1; + } + /* fall through */ + case Set_kind: + case SetComp_kind: + case GeneratorExp_kind: + case Lambda_kind: + return compiler_warn(c, "'%.200s' object is not subscriptable; " + "perhaps you missed a comma?", + infer_type(e)->tp_name); + default: + return 1; + } +} + +static int +check_index(struct compiler *c, expr_ty e, expr_ty s) +{ + PyObject *v; + + PyTypeObject *index_type = infer_type(s); + if (index_type == NULL + || PyType_FastSubclass(index_type, Py_TPFLAGS_LONG_SUBCLASS) + || index_type == &PySlice_Type) { + return 1; + } + + switch (e->kind) { + case Constant_kind: + v = e->v.Constant.value; + if (!(PyUnicode_Check(v) || PyBytes_Check(v) || PyTuple_Check(v))) { + return 1; + } + /* fall through */ + case Tuple_kind: + case List_kind: + case ListComp_kind: + case JoinedStr_kind: + case FormattedValue_kind: + return compiler_warn(c, "%.200s indices must be integers or slices, " + "not %.200s; " + "perhaps you missed a comma?", + infer_type(e)->tp_name, + index_type->tp_name); + default: + return 1; + } +} + +// Return 1 if the method call was optimized, -1 if not, and 0 on error. static int maybe_optimize_method_call(struct compiler *c, expr_ty e) { @@ -4115,44 +4115,44 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) } static int -validate_keywords(struct compiler *c, asdl_seq *keywords) -{ - Py_ssize_t nkeywords = asdl_seq_LEN(keywords); - for (Py_ssize_t i = 0; i < nkeywords; i++) { - keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i)); - if (key->arg == NULL) { - continue; - } - if (forbidden_name(c, key->arg, Store)) { - return -1; - } - for (Py_ssize_t j = i + 1; j < nkeywords; j++) { - keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); - if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { - PyObject *msg = PyUnicode_FromFormat("keyword argument repeated: %U", key->arg); - if (msg == NULL) { - return -1; - } - c->u->u_col_offset = other->col_offset; - compiler_error(c, PyUnicode_AsUTF8(msg)); - Py_DECREF(msg); - return -1; - } - } - } - return 0; -} - -static int +validate_keywords(struct compiler *c, asdl_seq *keywords) +{ + Py_ssize_t nkeywords = asdl_seq_LEN(keywords); + for (Py_ssize_t i = 0; i < nkeywords; i++) { + keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i)); + if (key->arg == NULL) { + continue; + } + if (forbidden_name(c, key->arg, Store)) { + return -1; + } + for (Py_ssize_t j = i + 1; j < nkeywords; j++) { + keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); + if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { + PyObject *msg = PyUnicode_FromFormat("keyword argument repeated: %U", key->arg); + if (msg == NULL) { + return -1; + } + c->u->u_col_offset = other->col_offset; + compiler_error(c, PyUnicode_AsUTF8(msg)); + Py_DECREF(msg); + return -1; + } + } + } + return 0; +} + +static int compiler_call(struct compiler *c, expr_ty e) { - int ret = maybe_optimize_method_call(c, e); - if (ret >= 0) { - return ret; - } - if (!check_caller(c, e->v.Call.func)) { - return 0; - } + int ret = maybe_optimize_method_call(c, e); + if (ret >= 0) { + return ret; + } + if (!check_caller(c, e->v.Call.func)) { + return 0; + } VISIT(c, expr, e->v.Call.func); return compiler_call_helper(c, 0, e->v.Call.args, @@ -4175,8 +4175,8 @@ compiler_formatted_value(struct compiler *c, expr_ty e) /* Our oparg encodes 2 pieces of information: the conversion character, and whether or not a format_spec was provided. - Convert the conversion char to 3 bits: - : 000 0x0 FVC_NONE The default if nothing specified. + Convert the conversion char to 3 bits: + : 000 0x0 FVC_NONE The default if nothing specified. !s : 001 0x1 FVC_STR !r : 010 0x2 FVC_REPR !a : 011 0x3 FVC_ASCII @@ -4186,20 +4186,20 @@ compiler_formatted_value(struct compiler *c, expr_ty e) no : 000 0x0 */ - int conversion = e->v.FormattedValue.conversion; + int conversion = e->v.FormattedValue.conversion; int oparg; - /* The expression to be formatted. */ + /* The expression to be formatted. */ VISIT(c, expr, e->v.FormattedValue.value); - switch (conversion) { + switch (conversion) { case 's': oparg = FVC_STR; break; case 'r': oparg = FVC_REPR; break; case 'a': oparg = FVC_ASCII; break; case -1: oparg = FVC_NONE; break; default: - PyErr_Format(PyExc_SystemError, - "Unrecognized conversion character %d", conversion); + PyErr_Format(PyExc_SystemError, + "Unrecognized conversion character %d", conversion); return 0; } if (e->v.FormattedValue.format_spec) { @@ -4210,7 +4210,7 @@ compiler_formatted_value(struct compiler *c, expr_ty e) /* And push our opcode and oparg */ ADDOP_I(c, FORMAT_VALUE, oparg); - + return 1; } @@ -4235,14 +4235,14 @@ compiler_subkwargs(struct compiler *c, asdl_seq *keywords, Py_ssize_t begin, Py_ Py_INCREF(key); PyTuple_SET_ITEM(keys, i - begin, key); } - ADDOP_LOAD_CONST_NEW(c, keys); + ADDOP_LOAD_CONST_NEW(c, keys); ADDOP_I(c, BUILD_CONST_KEY_MAP, n); } else { /* a for loop only executes once */ for (i = begin; i < end; i++) { kw = asdl_seq_GET(keywords, i); - ADDOP_LOAD_CONST(c, kw->arg); + ADDOP_LOAD_CONST(c, kw->arg); VISIT(c, expr, kw->value); } ADDOP_I(c, BUILD_MAP, n); @@ -4259,89 +4259,89 @@ compiler_call_helper(struct compiler *c, { Py_ssize_t i, nseen, nelts, nkwelts; - if (validate_keywords(c, keywords) == -1) { - return 0; - } + if (validate_keywords(c, keywords) == -1) { + return 0; + } nelts = asdl_seq_LEN(args); nkwelts = asdl_seq_LEN(keywords); - for (i = 0; i < nelts; i++) { - expr_ty elt = asdl_seq_GET(args, i); - if (elt->kind == Starred_kind) { - goto ex_call; - } - } + for (i = 0; i < nelts; i++) { + expr_ty elt = asdl_seq_GET(args, i); + if (elt->kind == Starred_kind) { + goto ex_call; + } + } for (i = 0; i < nkwelts; i++) { keyword_ty kw = asdl_seq_GET(keywords, i); if (kw->arg == NULL) { - goto ex_call; + goto ex_call; } } - /* No * or ** args, so can use faster calling sequence */ + /* No * or ** args, so can use faster calling sequence */ for (i = 0; i < nelts; i++) { expr_ty elt = asdl_seq_GET(args, i); - assert(elt->kind != Starred_kind); - VISIT(c, expr, elt); - } - if (nkwelts) { - PyObject *names; - VISIT_SEQ(c, keyword, keywords); - names = PyTuple_New(nkwelts); - if (names == NULL) { - return 0; - } - for (i = 0; i < nkwelts; i++) { - keyword_ty kw = asdl_seq_GET(keywords, i); - Py_INCREF(kw->arg); - PyTuple_SET_ITEM(names, i, kw->arg); - } - ADDOP_LOAD_CONST_NEW(c, names); - ADDOP_I(c, CALL_FUNCTION_KW, n + nelts + nkwelts); - return 1; - } - else { - ADDOP_I(c, CALL_FUNCTION, n + nelts); - return 1; - } - -ex_call: - - /* Do positional arguments. */ - if (n ==0 && nelts == 1 && ((expr_ty)asdl_seq_GET(args, 0))->kind == Starred_kind) { - VISIT(c, expr, ((expr_ty)asdl_seq_GET(args, 0))->v.Starred.value); - } - else if (starunpack_helper(c, args, n, BUILD_LIST, - LIST_APPEND, LIST_EXTEND, 1) == 0) { - return 0; - } - /* Then keyword arguments */ - if (nkwelts) { - /* Has a new dict been pushed */ - int have_dict = 0; - + assert(elt->kind != Starred_kind); + VISIT(c, expr, elt); + } + if (nkwelts) { + PyObject *names; + VISIT_SEQ(c, keyword, keywords); + names = PyTuple_New(nkwelts); + if (names == NULL) { + return 0; + } + for (i = 0; i < nkwelts; i++) { + keyword_ty kw = asdl_seq_GET(keywords, i); + Py_INCREF(kw->arg); + PyTuple_SET_ITEM(names, i, kw->arg); + } + ADDOP_LOAD_CONST_NEW(c, names); + ADDOP_I(c, CALL_FUNCTION_KW, n + nelts + nkwelts); + return 1; + } + else { + ADDOP_I(c, CALL_FUNCTION, n + nelts); + return 1; + } + +ex_call: + + /* Do positional arguments. */ + if (n ==0 && nelts == 1 && ((expr_ty)asdl_seq_GET(args, 0))->kind == Starred_kind) { + VISIT(c, expr, ((expr_ty)asdl_seq_GET(args, 0))->v.Starred.value); + } + else if (starunpack_helper(c, args, n, BUILD_LIST, + LIST_APPEND, LIST_EXTEND, 1) == 0) { + return 0; + } + /* Then keyword arguments */ + if (nkwelts) { + /* Has a new dict been pushed */ + int have_dict = 0; + nseen = 0; /* the number of keyword arguments on the stack following */ for (i = 0; i < nkwelts; i++) { keyword_ty kw = asdl_seq_GET(keywords, i); if (kw->arg == NULL) { /* A keyword argument unpacking. */ if (nseen) { - if (!compiler_subkwargs(c, keywords, i - nseen, i)) { + if (!compiler_subkwargs(c, keywords, i - nseen, i)) { return 0; - } - if (have_dict) { - ADDOP_I(c, DICT_MERGE, 1); - } - have_dict = 1; + } + if (have_dict) { + ADDOP_I(c, DICT_MERGE, 1); + } + have_dict = 1; nseen = 0; } - if (!have_dict) { - ADDOP_I(c, BUILD_MAP, 0); - have_dict = 1; - } + if (!have_dict) { + ADDOP_I(c, BUILD_MAP, 0); + have_dict = 1; + } VISIT(c, expr, kw->value); - ADDOP_I(c, DICT_MERGE, 1); + ADDOP_I(c, DICT_MERGE, 1); } else { nseen++; @@ -4349,18 +4349,18 @@ ex_call: } if (nseen) { /* Pack up any trailing keyword arguments. */ - if (!compiler_subkwargs(c, keywords, nkwelts - nseen, nkwelts)) { + if (!compiler_subkwargs(c, keywords, nkwelts - nseen, nkwelts)) { return 0; - } - if (have_dict) { - ADDOP_I(c, DICT_MERGE, 1); - } - have_dict = 1; + } + if (have_dict) { + ADDOP_I(c, DICT_MERGE, 1); + } + have_dict = 1; } - assert(have_dict); + assert(have_dict); } - ADDOP_I(c, CALL_FUNCTION_EX, nkwelts > 0); - return 1; + ADDOP_I(c, CALL_FUNCTION_EX, nkwelts > 0); + return 1; } @@ -4381,24 +4381,24 @@ ex_call: static int compiler_comprehension_generator(struct compiler *c, asdl_seq *generators, int gen_index, - int depth, + int depth, expr_ty elt, expr_ty val, int type) { comprehension_ty gen; gen = (comprehension_ty)asdl_seq_GET(generators, gen_index); if (gen->is_async) { return compiler_async_comprehension_generator( - c, generators, gen_index, depth, elt, val, type); + c, generators, gen_index, depth, elt, val, type); } else { return compiler_sync_comprehension_generator( - c, generators, gen_index, depth, elt, val, type); + c, generators, gen_index, depth, elt, val, type); } } static int compiler_sync_comprehension_generator(struct compiler *c, asdl_seq *generators, int gen_index, - int depth, + int depth, expr_ty elt, expr_ty val, int type) { /* generate code for the iterator, then each of the ifs, @@ -4426,38 +4426,38 @@ compiler_sync_comprehension_generator(struct compiler *c, } else { /* Sub-iter - calculate on the fly */ - /* Fast path for the temporary variable assignment idiom: - for y in [f(x)] - */ - asdl_seq *elts; - switch (gen->iter->kind) { - case List_kind: - elts = gen->iter->v.List.elts; - break; - case Tuple_kind: - elts = gen->iter->v.Tuple.elts; - break; - default: - elts = NULL; - } - if (asdl_seq_LEN(elts) == 1) { - expr_ty elt = asdl_seq_GET(elts, 0); - if (elt->kind != Starred_kind) { - VISIT(c, expr, elt); - start = NULL; - } - } - if (start) { - VISIT(c, expr, gen->iter); - ADDOP(c, GET_ITER); - } - } - if (start) { - depth++; - compiler_use_next_block(c, start); - ADDOP_JREL(c, FOR_ITER, anchor); - NEXT_BLOCK(c); - } + /* Fast path for the temporary variable assignment idiom: + for y in [f(x)] + */ + asdl_seq *elts; + switch (gen->iter->kind) { + case List_kind: + elts = gen->iter->v.List.elts; + break; + case Tuple_kind: + elts = gen->iter->v.Tuple.elts; + break; + default: + elts = NULL; + } + if (asdl_seq_LEN(elts) == 1) { + expr_ty elt = asdl_seq_GET(elts, 0); + if (elt->kind != Starred_kind) { + VISIT(c, expr, elt); + start = NULL; + } + } + if (start) { + VISIT(c, expr, gen->iter); + ADDOP(c, GET_ITER); + } + } + if (start) { + depth++; + compiler_use_next_block(c, start); + ADDOP_JREL(c, FOR_ITER, anchor); + NEXT_BLOCK(c); + } VISIT(c, expr, gen->target); /* XXX this needs to be cleaned up...a lot! */ @@ -4471,7 +4471,7 @@ compiler_sync_comprehension_generator(struct compiler *c, if (++gen_index < asdl_seq_LEN(generators)) if (!compiler_comprehension_generator(c, - generators, gen_index, depth, + generators, gen_index, depth, elt, val, type)) return 0; @@ -4486,18 +4486,18 @@ compiler_sync_comprehension_generator(struct compiler *c, break; case COMP_LISTCOMP: VISIT(c, expr, elt); - ADDOP_I(c, LIST_APPEND, depth + 1); + ADDOP_I(c, LIST_APPEND, depth + 1); break; case COMP_SETCOMP: VISIT(c, expr, elt); - ADDOP_I(c, SET_ADD, depth + 1); + ADDOP_I(c, SET_ADD, depth + 1); break; case COMP_DICTCOMP: - /* With '{k: v}', k is evaluated before v, so we do + /* With '{k: v}', k is evaluated before v, so we do the same. */ - VISIT(c, expr, elt); + VISIT(c, expr, elt); VISIT(c, expr, val); - ADDOP_I(c, MAP_ADD, depth + 1); + ADDOP_I(c, MAP_ADD, depth + 1); break; default: return 0; @@ -4506,10 +4506,10 @@ compiler_sync_comprehension_generator(struct compiler *c, compiler_use_next_block(c, skip); } compiler_use_next_block(c, if_cleanup); - if (start) { - ADDOP_JABS(c, JUMP_ABSOLUTE, start); - compiler_use_next_block(c, anchor); - } + if (start) { + ADDOP_JABS(c, JUMP_ABSOLUTE, start); + compiler_use_next_block(c, anchor); + } return 1; } @@ -4517,17 +4517,17 @@ compiler_sync_comprehension_generator(struct compiler *c, static int compiler_async_comprehension_generator(struct compiler *c, asdl_seq *generators, int gen_index, - int depth, + int depth, expr_ty elt, expr_ty val, int type) { comprehension_ty gen; - basicblock *start, *if_cleanup, *except; + basicblock *start, *if_cleanup, *except; Py_ssize_t i, n; - start = compiler_new_block(c); + start = compiler_new_block(c); except = compiler_new_block(c); if_cleanup = compiler_new_block(c); - if (start == NULL || if_cleanup == NULL || except == NULL) { + if (start == NULL || if_cleanup == NULL || except == NULL) { return 0; } @@ -4544,13 +4544,13 @@ compiler_async_comprehension_generator(struct compiler *c, ADDOP(c, GET_AITER); } - compiler_use_next_block(c, start); + compiler_use_next_block(c, start); - ADDOP_JREL(c, SETUP_FINALLY, except); + ADDOP_JREL(c, SETUP_FINALLY, except); ADDOP(c, GET_ANEXT); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); - ADDOP(c, POP_BLOCK); + ADDOP(c, POP_BLOCK); VISIT(c, expr, gen->target); n = asdl_seq_LEN(gen->ifs); @@ -4561,10 +4561,10 @@ compiler_async_comprehension_generator(struct compiler *c, NEXT_BLOCK(c); } - depth++; + depth++; if (++gen_index < asdl_seq_LEN(generators)) if (!compiler_comprehension_generator(c, - generators, gen_index, depth, + generators, gen_index, depth, elt, val, type)) return 0; @@ -4579,28 +4579,28 @@ compiler_async_comprehension_generator(struct compiler *c, break; case COMP_LISTCOMP: VISIT(c, expr, elt); - ADDOP_I(c, LIST_APPEND, depth + 1); + ADDOP_I(c, LIST_APPEND, depth + 1); break; case COMP_SETCOMP: VISIT(c, expr, elt); - ADDOP_I(c, SET_ADD, depth + 1); + ADDOP_I(c, SET_ADD, depth + 1); break; case COMP_DICTCOMP: - /* With '{k: v}', k is evaluated before v, so we do + /* With '{k: v}', k is evaluated before v, so we do the same. */ - VISIT(c, expr, elt); + VISIT(c, expr, elt); VISIT(c, expr, val); - ADDOP_I(c, MAP_ADD, depth + 1); + ADDOP_I(c, MAP_ADD, depth + 1); break; default: return 0; } } compiler_use_next_block(c, if_cleanup); - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + ADDOP_JABS(c, JUMP_ABSOLUTE, start); - compiler_use_next_block(c, except); - ADDOP(c, END_ASYNC_FOR); + compiler_use_next_block(c, except); + ADDOP(c, END_ASYNC_FOR); return 1; } @@ -4614,11 +4614,11 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, comprehension_ty outermost; PyObject *qualname = NULL; int is_async_generator = 0; - int top_level_await = IS_TOP_LEVEL_AWAIT(c); + int top_level_await = IS_TOP_LEVEL_AWAIT(c); + + + int is_async_function = c->u->u_ste->ste_coroutine; - - int is_async_function = c->u->u_ste->ste_coroutine; - outermost = (comprehension_ty) asdl_seq_GET(generators, 0); if (!compiler_enter_scope(c, name, COMPILER_SCOPE_COMPREHENSION, (void *)e, e->lineno)) @@ -4628,7 +4628,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, is_async_generator = c->u->u_ste->ste_coroutine; - if (is_async_generator && !is_async_function && type != COMP_GENEXP && !top_level_await) { + if (is_async_generator && !is_async_function && type != COMP_GENEXP && !top_level_await) { compiler_error(c, "asynchronous comprehension outside of " "an asynchronous function"); goto error_in_scope; @@ -4655,7 +4655,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, ADDOP_I(c, op, 0); } - if (!compiler_comprehension_generator(c, generators, 0, 0, elt, + if (!compiler_comprehension_generator(c, generators, 0, 0, elt, val, type)) goto error_in_scope; @@ -4667,9 +4667,9 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, qualname = c->u->u_qualname; Py_INCREF(qualname); compiler_exit_scope(c); - if (top_level_await && is_async_generator){ - c->u->u_ste->ste_coroutine = 1; - } + if (top_level_await && is_async_generator){ + c->u->u_ste->ste_coroutine = 1; + } if (co == NULL) goto error; @@ -4690,7 +4690,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, if (is_async_generator && type != COMP_GENEXP) { ADDOP(c, GET_AWAITABLE); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); } @@ -4708,7 +4708,7 @@ compiler_genexp(struct compiler *c, expr_ty e) { static identifier name; if (!name) { - name = PyUnicode_InternFromString("<genexpr>"); + name = PyUnicode_InternFromString("<genexpr>"); if (!name) return 0; } @@ -4723,7 +4723,7 @@ compiler_listcomp(struct compiler *c, expr_ty e) { static identifier name; if (!name) { - name = PyUnicode_InternFromString("<listcomp>"); + name = PyUnicode_InternFromString("<listcomp>"); if (!name) return 0; } @@ -4738,7 +4738,7 @@ compiler_setcomp(struct compiler *c, expr_ty e) { static identifier name; if (!name) { - name = PyUnicode_InternFromString("<setcomp>"); + name = PyUnicode_InternFromString("<setcomp>"); if (!name) return 0; } @@ -4754,7 +4754,7 @@ compiler_dictcomp(struct compiler *c, expr_ty e) { static identifier name; if (!name) { - name = PyUnicode_InternFromString("<dictcomp>"); + name = PyUnicode_InternFromString("<dictcomp>"); if (!name) return 0; } @@ -4781,28 +4781,28 @@ compiler_visit_keyword(struct compiler *c, keyword_ty k) static int expr_constant(expr_ty e) { - if (e->kind == Constant_kind) { - return PyObject_IsTrue(e->v.Constant.value); + if (e->kind == Constant_kind) { + return PyObject_IsTrue(e->v.Constant.value); } return -1; } -static int -compiler_with_except_finish(struct compiler *c) { - basicblock *exit; - exit = compiler_new_block(c); - if (exit == NULL) - return 0; - ADDOP_JABS(c, POP_JUMP_IF_TRUE, exit); - ADDOP(c, RERAISE); - compiler_use_next_block(c, exit); - ADDOP(c, POP_TOP); - ADDOP(c, POP_TOP); - ADDOP(c, POP_TOP); - ADDOP(c, POP_EXCEPT); - ADDOP(c, POP_TOP); - return 1; -} +static int +compiler_with_except_finish(struct compiler *c) { + basicblock *exit; + exit = compiler_new_block(c); + if (exit == NULL) + return 0; + ADDOP_JABS(c, POP_JUMP_IF_TRUE, exit); + ADDOP(c, RERAISE); + compiler_use_next_block(c, exit); + ADDOP(c, POP_TOP); + ADDOP(c, POP_TOP); + ADDOP(c, POP_TOP); + ADDOP(c, POP_EXCEPT); + ADDOP(c, POP_TOP); + return 1; +} /* Implements the async with statement. @@ -4831,20 +4831,20 @@ compiler_with_except_finish(struct compiler *c) { static int compiler_async_with(struct compiler *c, stmt_ty s, int pos) { - basicblock *block, *final, *exit; + basicblock *block, *final, *exit; withitem_ty item = asdl_seq_GET(s->v.AsyncWith.items, pos); assert(s->kind == AsyncWith_kind); - if (IS_TOP_LEVEL_AWAIT(c)){ - c->u->u_ste->ste_coroutine = 1; - } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION){ + if (IS_TOP_LEVEL_AWAIT(c)){ + c->u->u_ste->ste_coroutine = 1; + } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION){ return compiler_error(c, "'async with' outside async function"); } block = compiler_new_block(c); - final = compiler_new_block(c); - exit = compiler_new_block(c); - if (!block || !final || !exit) + final = compiler_new_block(c); + exit = compiler_new_block(c); + if (!block || !final || !exit) return 0; /* Evaluate EXPR */ @@ -4852,14 +4852,14 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos) ADDOP(c, BEFORE_ASYNC_WITH); ADDOP(c, GET_AWAITABLE); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); - ADDOP_JREL(c, SETUP_ASYNC_WITH, final); + ADDOP_JREL(c, SETUP_ASYNC_WITH, final); /* SETUP_ASYNC_WITH pushes a finally block. */ compiler_use_next_block(c, block); - if (!compiler_push_fblock(c, ASYNC_WITH, block, final, NULL)) { + if (!compiler_push_fblock(c, ASYNC_WITH, block, final, NULL)) { return 0; } @@ -4878,33 +4878,33 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos) else if (!compiler_async_with(c, s, pos)) return 0; - compiler_pop_fblock(c, ASYNC_WITH, block); + compiler_pop_fblock(c, ASYNC_WITH, block); ADDOP(c, POP_BLOCK); - /* End of body; start the cleanup */ + /* End of body; start the cleanup */ - /* For successful outcome: - * call __exit__(None, None, None) - */ - if(!compiler_call_exit_with_nones(c)) + /* For successful outcome: + * call __exit__(None, None, None) + */ + if(!compiler_call_exit_with_nones(c)) return 0; - ADDOP(c, GET_AWAITABLE); - ADDOP_O(c, LOAD_CONST, Py_None, consts); - ADDOP(c, YIELD_FROM); - - ADDOP(c, POP_TOP); - - ADDOP_JABS(c, JUMP_ABSOLUTE, exit); - - /* For exceptional outcome: */ - compiler_use_next_block(c, final); - - ADDOP(c, WITH_EXCEPT_START); ADDOP(c, GET_AWAITABLE); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_O(c, LOAD_CONST, Py_None, consts); + ADDOP(c, YIELD_FROM); + + ADDOP(c, POP_TOP); + + ADDOP_JABS(c, JUMP_ABSOLUTE, exit); + + /* For exceptional outcome: */ + compiler_use_next_block(c, final); + + ADDOP(c, WITH_EXCEPT_START); + ADDOP(c, GET_AWAITABLE); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); - compiler_with_except_finish(c); + compiler_with_except_finish(c); -compiler_use_next_block(c, exit); +compiler_use_next_block(c, exit); return 1; } @@ -4913,45 +4913,45 @@ compiler_use_next_block(c, exit); Implements the with statement from PEP 343. with EXPR as VAR: BLOCK - is implemented as: - <code for EXPR> - SETUP_WITH E - <code to store to VAR> or POP_TOP - <code for BLOCK> - LOAD_CONST (None, None, None) - CALL_FUNCTION_EX 0 - JUMP_FORWARD EXIT - E: WITH_EXCEPT_START (calls EXPR.__exit__) - POP_JUMP_IF_TRUE T: - RERAISE - T: POP_TOP * 3 (remove exception from stack) - POP_EXCEPT - POP_TOP - EXIT: - */ + is implemented as: + <code for EXPR> + SETUP_WITH E + <code to store to VAR> or POP_TOP + <code for BLOCK> + LOAD_CONST (None, None, None) + CALL_FUNCTION_EX 0 + JUMP_FORWARD EXIT + E: WITH_EXCEPT_START (calls EXPR.__exit__) + POP_JUMP_IF_TRUE T: + RERAISE + T: POP_TOP * 3 (remove exception from stack) + POP_EXCEPT + POP_TOP + EXIT: + */ static int compiler_with(struct compiler *c, stmt_ty s, int pos) { - basicblock *block, *final, *exit; + basicblock *block, *final, *exit; withitem_ty item = asdl_seq_GET(s->v.With.items, pos); assert(s->kind == With_kind); block = compiler_new_block(c); - final = compiler_new_block(c); - exit = compiler_new_block(c); - if (!block || !final || !exit) + final = compiler_new_block(c); + exit = compiler_new_block(c); + if (!block || !final || !exit) return 0; /* Evaluate EXPR */ VISIT(c, expr, item->context_expr); - /* Will push bound __exit__ */ - ADDOP_JREL(c, SETUP_WITH, final); + /* Will push bound __exit__ */ + ADDOP_JREL(c, SETUP_WITH, final); /* SETUP_WITH pushes a finally block. */ compiler_use_next_block(c, block); - if (!compiler_push_fblock(c, WITH, block, final, NULL)) { + if (!compiler_push_fblock(c, WITH, block, final, NULL)) { return 0; } @@ -4971,43 +4971,43 @@ compiler_with(struct compiler *c, stmt_ty s, int pos) return 0; ADDOP(c, POP_BLOCK); - compiler_pop_fblock(c, WITH, block); - - /* End of body; start the cleanup. */ - - /* For successful outcome: - * call __exit__(None, None, None) - */ - if (!compiler_call_exit_with_nones(c)) + compiler_pop_fblock(c, WITH, block); + + /* End of body; start the cleanup. */ + + /* For successful outcome: + * call __exit__(None, None, None) + */ + if (!compiler_call_exit_with_nones(c)) return 0; - ADDOP(c, POP_TOP); - ADDOP_JREL(c, JUMP_FORWARD, exit); + ADDOP(c, POP_TOP); + ADDOP_JREL(c, JUMP_FORWARD, exit); - /* For exceptional outcome: */ - compiler_use_next_block(c, final); + /* For exceptional outcome: */ + compiler_use_next_block(c, final); - ADDOP(c, WITH_EXCEPT_START); - compiler_with_except_finish(c); - - compiler_use_next_block(c, exit); + ADDOP(c, WITH_EXCEPT_START); + compiler_with_except_finish(c); + + compiler_use_next_block(c, exit); return 1; } static int -compiler_visit_expr1(struct compiler *c, expr_ty e) +compiler_visit_expr1(struct compiler *c, expr_ty e) { switch (e->kind) { - case NamedExpr_kind: - VISIT(c, expr, e->v.NamedExpr.value); - ADDOP(c, DUP_TOP); - VISIT(c, expr, e->v.NamedExpr.target); - break; + case NamedExpr_kind: + VISIT(c, expr, e->v.NamedExpr.value); + ADDOP(c, DUP_TOP); + VISIT(c, expr, e->v.NamedExpr.target); + break; case BoolOp_kind: return compiler_boolop(c, e); case BinOp_kind: VISIT(c, expr, e->v.BinOp.left); VISIT(c, expr, e->v.BinOp.right); - ADDOP(c, binop(e->v.BinOp.op)); + ADDOP(c, binop(e->v.BinOp.op)); break; case UnaryOp_kind: VISIT(c, expr, e->v.UnaryOp.operand); @@ -5036,7 +5036,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) VISIT(c, expr, e->v.Yield.value); } else { - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); } ADDOP(c, YIELD_VALUE); break; @@ -5049,24 +5049,24 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) VISIT(c, expr, e->v.YieldFrom.value); ADDOP(c, GET_YIELD_FROM_ITER); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); break; case Await_kind: - if (!IS_TOP_LEVEL_AWAIT(c)){ - if (c->u->u_ste->ste_type != FunctionBlock){ - return compiler_error(c, "'await' outside function"); - } + if (!IS_TOP_LEVEL_AWAIT(c)){ + if (c->u->u_ste->ste_type != FunctionBlock){ + return compiler_error(c, "'await' outside function"); + } - if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION && - c->u->u_scope_type != COMPILER_SCOPE_COMPREHENSION){ - return compiler_error(c, "'await' outside async function"); - } - } + if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION && + c->u->u_scope_type != COMPILER_SCOPE_COMPREHENSION){ + return compiler_error(c, "'await' outside async function"); + } + } VISIT(c, expr, e->v.Await.value); ADDOP(c, GET_AWAITABLE); - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); break; case Compare_kind: @@ -5074,7 +5074,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) case Call_kind: return compiler_call(c, e); case Constant_kind: - ADDOP_LOAD_CONST(c, e->v.Constant.value); + ADDOP_LOAD_CONST(c, e->v.Constant.value); break; case JoinedStr_kind: return compiler_joined_str(c, e); @@ -5082,14 +5082,14 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) return compiler_formatted_value(c, e); /* The following exprs can be assignment targets. */ case Attribute_kind: - VISIT(c, expr, e->v.Attribute.value); + VISIT(c, expr, e->v.Attribute.value); switch (e->v.Attribute.ctx) { case Load: ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); break; case Store: - if (forbidden_name(c, e->v.Attribute.attr, e->v.Attribute.ctx)) - return 0; + if (forbidden_name(c, e->v.Attribute.attr, e->v.Attribute.ctx)) + return 0; ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); break; case Del: @@ -5098,7 +5098,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) } break; case Subscript_kind: - return compiler_subscript(c, e); + return compiler_subscript(c, e); case Starred_kind: switch (e->v.Starred.ctx) { case Store: @@ -5110,9 +5110,9 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) return compiler_error(c, "can't use starred expression here"); } - break; - case Slice_kind: - return compiler_slice(c, e); + break; + case Slice_kind: + return compiler_slice(c, e); case Name_kind: return compiler_nameop(c, e->v.Name.id, e->v.Name.ctx); /* child nodes of List and Tuple will have expr_context set */ @@ -5125,72 +5125,72 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) } static int -compiler_visit_expr(struct compiler *c, expr_ty e) -{ - int old_lineno = c->u->u_lineno; - int old_col_offset = c->u->u_col_offset; - SET_LOC(c, e); - int res = compiler_visit_expr1(c, e); - c->u->u_lineno = old_lineno; - c->u->u_col_offset = old_col_offset; - return res; -} - -static int +compiler_visit_expr(struct compiler *c, expr_ty e) +{ + int old_lineno = c->u->u_lineno; + int old_col_offset = c->u->u_col_offset; + SET_LOC(c, e); + int res = compiler_visit_expr1(c, e); + c->u->u_lineno = old_lineno; + c->u->u_col_offset = old_col_offset; + return res; +} + +static int compiler_augassign(struct compiler *c, stmt_ty s) { - assert(s->kind == AugAssign_kind); + assert(s->kind == AugAssign_kind); expr_ty e = s->v.AugAssign.target; - int old_lineno = c->u->u_lineno; - int old_col_offset = c->u->u_col_offset; - SET_LOC(c, e); + int old_lineno = c->u->u_lineno; + int old_col_offset = c->u->u_col_offset; + SET_LOC(c, e); switch (e->kind) { case Attribute_kind: - VISIT(c, expr, e->v.Attribute.value); - ADDOP(c, DUP_TOP); - ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); + VISIT(c, expr, e->v.Attribute.value); + ADDOP(c, DUP_TOP); + ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); break; case Subscript_kind: - VISIT(c, expr, e->v.Subscript.value); - VISIT(c, expr, e->v.Subscript.slice); - ADDOP(c, DUP_TOP_TWO); - ADDOP(c, BINARY_SUBSCR); + VISIT(c, expr, e->v.Subscript.value); + VISIT(c, expr, e->v.Subscript.slice); + ADDOP(c, DUP_TOP_TWO); + ADDOP(c, BINARY_SUBSCR); break; case Name_kind: if (!compiler_nameop(c, e->v.Name.id, Load)) return 0; - break; + break; default: PyErr_Format(PyExc_SystemError, "invalid node type (%d) for augmented assignment", e->kind); return 0; } - - c->u->u_lineno = old_lineno; - c->u->u_col_offset = old_col_offset; - - VISIT(c, expr, s->v.AugAssign.value); - ADDOP(c, inplace_binop(s->v.AugAssign.op)); - - SET_LOC(c, e); - - switch (e->kind) { - case Attribute_kind: - ADDOP(c, ROT_TWO); - ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); - break; - case Subscript_kind: - ADDOP(c, ROT_THREE); - ADDOP(c, STORE_SUBSCR); - break; - case Name_kind: - return compiler_nameop(c, e->v.Name.id, Store); - default: - Py_UNREACHABLE(); - } + + c->u->u_lineno = old_lineno; + c->u->u_col_offset = old_col_offset; + + VISIT(c, expr, s->v.AugAssign.value); + ADDOP(c, inplace_binop(s->v.AugAssign.op)); + + SET_LOC(c, e); + + switch (e->kind) { + case Attribute_kind: + ADDOP(c, ROT_TWO); + ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); + break; + case Subscript_kind: + ADDOP(c, ROT_THREE); + ADDOP(c, STORE_SUBSCR); + break; + case Name_kind: + return compiler_nameop(c, e->v.Name.id, Store); + default: + Py_UNREACHABLE(); + } return 1; } @@ -5214,34 +5214,34 @@ check_annotation(struct compiler *c, stmt_ty s) } static int -check_ann_subscr(struct compiler *c, expr_ty e) +check_ann_subscr(struct compiler *c, expr_ty e) { - /* We check that everything in a subscript is defined at runtime. */ - switch (e->kind) { + /* We check that everything in a subscript is defined at runtime. */ + switch (e->kind) { case Slice_kind: - if (e->v.Slice.lower && !check_ann_expr(c, e->v.Slice.lower)) { + if (e->v.Slice.lower && !check_ann_expr(c, e->v.Slice.lower)) { return 0; } - if (e->v.Slice.upper && !check_ann_expr(c, e->v.Slice.upper)) { + if (e->v.Slice.upper && !check_ann_expr(c, e->v.Slice.upper)) { return 0; } - if (e->v.Slice.step && !check_ann_expr(c, e->v.Slice.step)) { + if (e->v.Slice.step && !check_ann_expr(c, e->v.Slice.step)) { return 0; } - return 1; - case Tuple_kind: { - /* extended slice */ - asdl_seq *elts = e->v.Tuple.elts; - Py_ssize_t i, n = asdl_seq_LEN(elts); + return 1; + case Tuple_kind: { + /* extended slice */ + asdl_seq *elts = e->v.Tuple.elts; + Py_ssize_t i, n = asdl_seq_LEN(elts); for (i = 0; i < n; i++) { - if (!check_ann_subscr(c, asdl_seq_GET(elts, i))) { + if (!check_ann_subscr(c, asdl_seq_GET(elts, i))) { return 0; } } - return 1; - } + return 1; + } default: - return check_ann_expr(c, e); + return check_ann_expr(c, e); } } @@ -5260,8 +5260,8 @@ compiler_annassign(struct compiler *c, stmt_ty s) } switch (targ->kind) { case Name_kind: - if (forbidden_name(c, targ->v.Name.id, Store)) - return 0; + if (forbidden_name(c, targ->v.Name.id, Store)) + return 0; /* If we have a simple name in a module or class, store annotation. */ if (s->v.AnnAssign.simple && (c->u->u_scope_type == COMPILER_SCOPE_MODULE || @@ -5274,13 +5274,13 @@ compiler_annassign(struct compiler *c, stmt_ty s) } ADDOP_NAME(c, LOAD_NAME, __annotations__, names); mangled = _Py_Mangle(c->u->u_private, targ->v.Name.id); - ADDOP_LOAD_CONST_NEW(c, mangled); + ADDOP_LOAD_CONST_NEW(c, mangled); ADDOP(c, STORE_SUBSCR); } break; case Attribute_kind: - if (forbidden_name(c, targ->v.Attribute.attr, Store)) - return 0; + if (forbidden_name(c, targ->v.Attribute.attr, Store)) + return 0; if (!s->v.AnnAssign.value && !check_ann_expr(c, targ->v.Attribute.value)) { return 0; @@ -5322,7 +5322,7 @@ compiler_error(struct compiler *c, const char *errstr) loc = Py_None; } u = Py_BuildValue("(OiiO)", c->c_filename, c->u->u_lineno, - c->u->u_col_offset + 1, loc); + c->u->u_col_offset + 1, loc); if (!u) goto exit; v = Py_BuildValue("(zO)", errstr, u); @@ -5336,70 +5336,70 @@ compiler_error(struct compiler *c, const char *errstr) return 0; } -/* Emits a SyntaxWarning and returns 1 on success. - If a SyntaxWarning raised as error, replaces it with a SyntaxError - and returns 0. -*/ +/* Emits a SyntaxWarning and returns 1 on success. + If a SyntaxWarning raised as error, replaces it with a SyntaxError + and returns 0. +*/ static int -compiler_warn(struct compiler *c, const char *format, ...) -{ - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - PyObject *msg = PyUnicode_FromFormatV(format, vargs); - va_end(vargs); - if (msg == NULL) { - return 0; - } - if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, c->c_filename, - c->u->u_lineno, NULL, NULL) < 0) - { - if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { - /* Replace the SyntaxWarning exception with a SyntaxError - to get a more accurate error report */ - PyErr_Clear(); - assert(PyUnicode_AsUTF8(msg) != NULL); - compiler_error(c, PyUnicode_AsUTF8(msg)); - } - Py_DECREF(msg); - return 0; - } - Py_DECREF(msg); - return 1; -} - -static int -compiler_subscript(struct compiler *c, expr_ty e) -{ - expr_context_ty ctx = e->v.Subscript.ctx; +compiler_warn(struct compiler *c, const char *format, ...) +{ + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + PyObject *msg = PyUnicode_FromFormatV(format, vargs); + va_end(vargs); + if (msg == NULL) { + return 0; + } + if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, c->c_filename, + c->u->u_lineno, NULL, NULL) < 0) + { + if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { + /* Replace the SyntaxWarning exception with a SyntaxError + to get a more accurate error report */ + PyErr_Clear(); + assert(PyUnicode_AsUTF8(msg) != NULL); + compiler_error(c, PyUnicode_AsUTF8(msg)); + } + Py_DECREF(msg); + return 0; + } + Py_DECREF(msg); + return 1; +} + +static int +compiler_subscript(struct compiler *c, expr_ty e) +{ + expr_context_ty ctx = e->v.Subscript.ctx; int op = 0; - if (ctx == Load) { - if (!check_subscripter(c, e->v.Subscript.value)) { - return 0; - } - if (!check_index(c, e->v.Subscript.value, e->v.Subscript.slice)) { - return 0; - } - } - + if (ctx == Load) { + if (!check_subscripter(c, e->v.Subscript.value)) { + return 0; + } + if (!check_index(c, e->v.Subscript.value, e->v.Subscript.slice)) { + return 0; + } + } + switch (ctx) { case Load: op = BINARY_SUBSCR; break; case Store: op = STORE_SUBSCR; break; case Del: op = DELETE_SUBSCR; break; } - assert(op); - VISIT(c, expr, e->v.Subscript.value); - VISIT(c, expr, e->v.Subscript.slice); + assert(op); + VISIT(c, expr, e->v.Subscript.value); + VISIT(c, expr, e->v.Subscript.slice); ADDOP(c, op); return 1; } static int -compiler_slice(struct compiler *c, expr_ty s) +compiler_slice(struct compiler *c, expr_ty s) { int n = 2; assert(s->kind == Slice_kind); @@ -5409,14 +5409,14 @@ compiler_slice(struct compiler *c, expr_ty s) VISIT(c, expr, s->v.Slice.lower); } else { - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); } if (s->v.Slice.upper) { VISIT(c, expr, s->v.Slice.upper); } else { - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); } if (s->v.Slice.step) { @@ -5475,8 +5475,8 @@ dfs(struct compiler *c, basicblock *b, struct assembler *a, int end) Py_LOCAL_INLINE(void) stackdepth_push(basicblock ***sp, basicblock *b, int depth) { - assert(b->b_startdepth < 0 || b->b_startdepth == depth); - if (b->b_startdepth < depth && b->b_startdepth < 100) { + assert(b->b_startdepth < 0 || b->b_startdepth == depth); + if (b->b_startdepth < depth && b->b_startdepth < 100) { assert(b->b_startdepth < 0); b->b_startdepth = depth; *(*sp)++ = b; @@ -5516,8 +5516,8 @@ stackdepth(struct compiler *c) struct instr *instr = &b->b_instr[i]; int effect = stack_effect(instr->i_opcode, instr->i_oparg, 0); if (effect == PY_INVALID_STACK_EFFECT) { - _Py_FatalErrorFormat(__func__, - "opcode = %d", instr->i_opcode); + _Py_FatalErrorFormat(__func__, + "opcode = %d", instr->i_opcode); } int new_depth = depth + effect; if (new_depth > maxdepth) { @@ -5538,8 +5538,8 @@ stackdepth(struct compiler *c) if (instr->i_opcode == JUMP_ABSOLUTE || instr->i_opcode == JUMP_FORWARD || instr->i_opcode == RETURN_VALUE || - instr->i_opcode == RAISE_VARARGS || - instr->i_opcode == RERAISE) + instr->i_opcode == RAISE_VARARGS || + instr->i_opcode == RERAISE) { /* remaining code is dead */ next = NULL; @@ -5610,11 +5610,11 @@ assemble_lnotab(struct assembler *a, struct instr *i) unsigned char *lnotab; d_lineno = i->i_lineno - a->a_lineno; - if (d_lineno == 0) { - return 1; - } + if (d_lineno == 0) { + return 1; + } - d_bytecode = (a->a_offset - a->a_lineno_off) * sizeof(_Py_CODEUNIT); + d_bytecode = (a->a_offset - a->a_lineno_off) * sizeof(_Py_CODEUNIT); assert(d_bytecode >= 0); if (d_bytecode > 255) { @@ -5811,31 +5811,31 @@ dict_keys_inorder(PyObject *dict, Py_ssize_t offset) return tuple; } -static PyObject * -consts_dict_keys_inorder(PyObject *dict) -{ - PyObject *consts, *k, *v; - Py_ssize_t i, pos = 0, size = PyDict_GET_SIZE(dict); - - consts = PyList_New(size); /* PyCode_Optimize() requires a list */ - if (consts == NULL) - return NULL; - while (PyDict_Next(dict, &pos, &k, &v)) { - i = PyLong_AS_LONG(v); - /* The keys of the dictionary can be tuples wrapping a contant. - * (see compiler_add_o and _PyCode_ConstantKey). In that case - * the object we want is always second. */ - if (PyTuple_CheckExact(k)) { - k = PyTuple_GET_ITEM(k, 1); - } - Py_INCREF(k); - assert(i < size); - assert(i >= 0); - PyList_SET_ITEM(consts, i, k); - } - return consts; -} - +static PyObject * +consts_dict_keys_inorder(PyObject *dict) +{ + PyObject *consts, *k, *v; + Py_ssize_t i, pos = 0, size = PyDict_GET_SIZE(dict); + + consts = PyList_New(size); /* PyCode_Optimize() requires a list */ + if (consts == NULL) + return NULL; + while (PyDict_Next(dict, &pos, &k, &v)) { + i = PyLong_AS_LONG(v); + /* The keys of the dictionary can be tuples wrapping a contant. + * (see compiler_add_o and _PyCode_ConstantKey). In that case + * the object we want is always second. */ + if (PyTuple_CheckExact(k)) { + k = PyTuple_GET_ITEM(k, 1); + } + Py_INCREF(k); + assert(i < size); + assert(i >= 0); + PyList_SET_ITEM(consts, i, k); + } + return consts; +} + static int compute_code_flags(struct compiler *c) { @@ -5860,44 +5860,44 @@ compute_code_flags(struct compiler *c) /* (Only) inherit compilerflags in PyCF_MASK */ flags |= (c->c_flags->cf_flags & PyCF_MASK); - if ((IS_TOP_LEVEL_AWAIT(c)) && - ste->ste_coroutine && - !ste->ste_generator) { - flags |= CO_COROUTINE; - } - + if ((IS_TOP_LEVEL_AWAIT(c)) && + ste->ste_coroutine && + !ste->ste_generator) { + flags |= CO_COROUTINE; + } + return flags; } -// Merge *tuple* with constant cache. -// Unlike merge_consts_recursive(), this function doesn't work recursively. -static int -merge_const_tuple(struct compiler *c, PyObject **tuple) -{ - assert(PyTuple_CheckExact(*tuple)); - - PyObject *key = _PyCode_ConstantKey(*tuple); - if (key == NULL) { - return 0; - } - - // t is borrowed reference - PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); - Py_DECREF(key); - if (t == NULL) { - return 0; - } - if (t == key) { // tuple is new constant. - return 1; - } - - PyObject *u = PyTuple_GET_ITEM(t, 1); - Py_INCREF(u); - Py_DECREF(*tuple); - *tuple = u; - return 1; -} - +// Merge *tuple* with constant cache. +// Unlike merge_consts_recursive(), this function doesn't work recursively. +static int +merge_const_tuple(struct compiler *c, PyObject **tuple) +{ + assert(PyTuple_CheckExact(*tuple)); + + PyObject *key = _PyCode_ConstantKey(*tuple); + if (key == NULL) { + return 0; + } + + // t is borrowed reference + PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); + Py_DECREF(key); + if (t == NULL) { + return 0; + } + if (t == key) { // tuple is new constant. + return 1; + } + + PyObject *u = PyTuple_GET_ITEM(t, 1); + Py_INCREF(u); + Py_DECREF(*tuple); + *tuple = u; + return 1; +} + static PyCodeObject * makecode(struct compiler *c, struct assembler *a) { @@ -5913,9 +5913,9 @@ makecode(struct compiler *c, struct assembler *a) Py_ssize_t nlocals; int nlocals_int; int flags; - int posorkeywordargcount, posonlyargcount, kwonlyargcount, maxdepth; + int posorkeywordargcount, posonlyargcount, kwonlyargcount, maxdepth; - consts = consts_dict_keys_inorder(c->u->u_consts); + consts = consts_dict_keys_inorder(c->u->u_consts); names = dict_keys_inorder(c->u->u_names, 0); varnames = dict_keys_inorder(c->u->u_varnames, 0); if (!consts || !names || !varnames) @@ -5924,18 +5924,18 @@ makecode(struct compiler *c, struct assembler *a) cellvars = dict_keys_inorder(c->u->u_cellvars, 0); if (!cellvars) goto error; - freevars = dict_keys_inorder(c->u->u_freevars, PyTuple_GET_SIZE(cellvars)); + freevars = dict_keys_inorder(c->u->u_freevars, PyTuple_GET_SIZE(cellvars)); if (!freevars) goto error; - if (!merge_const_tuple(c, &names) || - !merge_const_tuple(c, &varnames) || - !merge_const_tuple(c, &cellvars) || - !merge_const_tuple(c, &freevars)) - { - goto error; - } - + if (!merge_const_tuple(c, &names) || + !merge_const_tuple(c, &varnames) || + !merge_const_tuple(c, &cellvars) || + !merge_const_tuple(c, &freevars)) + { + goto error; + } + nlocals = PyDict_GET_SIZE(c->u->u_varnames); assert(nlocals < INT_MAX); nlocals_int = Py_SAFE_DOWNCAST(nlocals, Py_ssize_t, int); @@ -5953,22 +5953,22 @@ makecode(struct compiler *c, struct assembler *a) goto error; Py_DECREF(consts); consts = tmp; - if (!merge_const_tuple(c, &consts)) { - goto error; - } + if (!merge_const_tuple(c, &consts)) { + goto error; + } - posonlyargcount = Py_SAFE_DOWNCAST(c->u->u_posonlyargcount, Py_ssize_t, int); - posorkeywordargcount = Py_SAFE_DOWNCAST(c->u->u_argcount, Py_ssize_t, int); + posonlyargcount = Py_SAFE_DOWNCAST(c->u->u_posonlyargcount, Py_ssize_t, int); + posorkeywordargcount = Py_SAFE_DOWNCAST(c->u->u_argcount, Py_ssize_t, int); kwonlyargcount = Py_SAFE_DOWNCAST(c->u->u_kwonlyargcount, Py_ssize_t, int); maxdepth = stackdepth(c); if (maxdepth < 0) { goto error; } - co = PyCode_NewWithPosOnlyArgs(posonlyargcount+posorkeywordargcount, - posonlyargcount, kwonlyargcount, nlocals_int, - maxdepth, flags, bytecode, consts, names, - varnames, freevars, cellvars, c->c_filename, - c->u->u_name, c->u->u_firstlineno, a->a_lnotab); + co = PyCode_NewWithPosOnlyArgs(posonlyargcount+posorkeywordargcount, + posonlyargcount, kwonlyargcount, nlocals_int, + maxdepth, flags, bytecode, consts, names, + varnames, freevars, cellvars, c->c_filename, + c->u->u_name, c->u->u_firstlineno, a->a_lnotab); error: Py_XDECREF(consts); Py_XDECREF(names); @@ -6030,7 +6030,7 @@ assemble(struct compiler *c, int addNone) if (!c->u->u_curblock->b_return) { NEXT_BLOCK(c); if (addNone) - ADDOP_LOAD_CONST(c, Py_None); + ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, RETURN_VALUE); } @@ -6075,7 +6075,7 @@ assemble(struct compiler *c, int addNone) } #undef PyAST_Compile -PyCodeObject * +PyCodeObject * PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags, PyArena *arena) { diff --git a/contrib/tools/python3/src/Python/condvar.h b/contrib/tools/python3/src/Python/condvar.h index c9000c0c49..8cba19b846 100644 --- a/contrib/tools/python3/src/Python/condvar.h +++ b/contrib/tools/python3/src/Python/condvar.h @@ -41,16 +41,16 @@ #define _CONDVAR_IMPL_H_ #include "Python.h" -#include "pycore_condvar.h" +#include "pycore_condvar.h" #ifdef _POSIX_THREADS /* * POSIX support */ -/* These private functions are implemented in Python/thread_pthread.h */ -int _PyThread_cond_init(PyCOND_T *cond); -void _PyThread_cond_after(long long us, struct timespec *abs); +/* These private functions are implemented in Python/thread_pthread.h */ +int _PyThread_cond_init(PyCOND_T *cond); +void _PyThread_cond_after(long long us, struct timespec *abs); /* The following functions return 0 on success, nonzero on error */ #define PyMUTEX_INIT(mut) pthread_mutex_init((mut), NULL) @@ -58,7 +58,7 @@ void _PyThread_cond_after(long long us, struct timespec *abs); #define PyMUTEX_LOCK(mut) pthread_mutex_lock(mut) #define PyMUTEX_UNLOCK(mut) pthread_mutex_unlock(mut) -#define PyCOND_INIT(cond) _PyThread_cond_init(cond) +#define PyCOND_INIT(cond) _PyThread_cond_init(cond) #define PyCOND_FINI(cond) pthread_cond_destroy(cond) #define PyCOND_SIGNAL(cond) pthread_cond_signal(cond) #define PyCOND_BROADCAST(cond) pthread_cond_broadcast(cond) @@ -68,16 +68,16 @@ void _PyThread_cond_after(long long us, struct timespec *abs); Py_LOCAL_INLINE(int) PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long long us) { - struct timespec abs; - _PyThread_cond_after(us, &abs); - int ret = pthread_cond_timedwait(cond, mut, &abs); - if (ret == ETIMEDOUT) { + struct timespec abs; + _PyThread_cond_after(us, &abs); + int ret = pthread_cond_timedwait(cond, mut, &abs); + if (ret == ETIMEDOUT) { return 1; - } - if (ret) { + } + if (ret) { return -1; - } - return 0; + } + return 0; } #elif defined(NT_THREADS) @@ -178,7 +178,7 @@ _PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms) * just means an extra spurious wakeup for a waiting thread. * ('waiting' corresponds to the semaphore's "negative" count and * we may end up with e.g. (waiting == -1 && sem.count == 1). When - * a new thread comes along, it will pass right through, having + * a new thread comes along, it will pass right through, having * adjusted it to (waiting == 0 && sem.count == 0). */ diff --git a/contrib/tools/python3/src/Python/context.c b/contrib/tools/python3/src/Python/context.c index a3bfd99e5f..bacc7010c4 100644 --- a/contrib/tools/python3/src/Python/context.c +++ b/contrib/tools/python3/src/Python/context.c @@ -1,12 +1,12 @@ #include "Python.h" -#include "pycore_context.h" -#include "pycore_gc.h" // _PyObject_GC_MAY_BE_TRACKED() -#include "pycore_hamt.h" -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "structmember.h" // PyMemberDef +#include "pycore_context.h" +#include "pycore_gc.h" // _PyObject_GC_MAY_BE_TRACKED() +#include "pycore_hamt.h" +#include "pycore_object.h" +#include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "structmember.h" // PyMemberDef #define CONTEXT_FREELIST_MAXLEN 255 @@ -103,15 +103,15 @@ PyContext_CopyCurrent(void) } -static int -_PyContext_Enter(PyThreadState *ts, PyObject *octx) +static int +_PyContext_Enter(PyThreadState *ts, PyObject *octx) { ENSURE_Context(octx, -1) PyContext *ctx = (PyContext *)octx; if (ctx->ctx_entered) { - _PyErr_Format(ts, PyExc_RuntimeError, - "cannot enter context: %R is already entered", ctx); + _PyErr_Format(ts, PyExc_RuntimeError, + "cannot enter context: %R is already entered", ctx); return -1; } @@ -127,17 +127,17 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx) int -PyContext_Enter(PyObject *octx) +PyContext_Enter(PyObject *octx) +{ + PyThreadState *ts = _PyThreadState_GET(); + assert(ts != NULL); + return _PyContext_Enter(ts, octx); +} + + +static int +_PyContext_Exit(PyThreadState *ts, PyObject *octx) { - PyThreadState *ts = _PyThreadState_GET(); - assert(ts != NULL); - return _PyContext_Enter(ts, octx); -} - - -static int -_PyContext_Exit(PyThreadState *ts, PyObject *octx) -{ ENSURE_Context(octx, -1) PyContext *ctx = (PyContext *)octx; @@ -164,15 +164,15 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx) return 0; } -int -PyContext_Exit(PyObject *octx) -{ - PyThreadState *ts = _PyThreadState_GET(); - assert(ts != NULL); - return _PyContext_Exit(ts, octx); -} +int +PyContext_Exit(PyObject *octx) +{ + PyThreadState *ts = _PyThreadState_GET(); + assert(ts != NULL); + return _PyContext_Exit(ts, octx); +} + - PyObject * PyContextVar_New(const char *name, PyObject *def) { @@ -192,7 +192,7 @@ PyContextVar_Get(PyObject *ovar, PyObject *def, PyObject **val) ENSURE_ContextVar(ovar, -1) PyContextVar *var = (PyContextVar *)ovar; - PyThreadState *ts = _PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); if (ts->context == NULL) { goto not_found; @@ -396,7 +396,7 @@ context_new_from_vars(PyHamtObject *vars) static inline PyContext * context_get(void) { - PyThreadState *ts = _PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); PyContext *current_ctx = (PyContext *)ts->context; if (current_ctx == NULL) { @@ -542,17 +542,17 @@ _contextvars.Context.get key: object default: object = None / - -Return the value for `key` if `key` has the value in the context object. - -If `key` does not exist, return `default`. If `default` is not given, -return None. + +Return the value for `key` if `key` has the value in the context object. + +If `key` does not exist, return `default`. If `default` is not given, +return None. [clinic start generated code]*/ static PyObject * _contextvars_Context_get_impl(PyContext *self, PyObject *key, PyObject *default_value) -/*[clinic end generated code: output=0c54aa7664268189 input=c8eeb81505023995]*/ +/*[clinic end generated code: output=0c54aa7664268189 input=c8eeb81505023995]*/ { if (context_check_key_type(key)) { return NULL; @@ -574,15 +574,15 @@ _contextvars_Context_get_impl(PyContext *self, PyObject *key, /*[clinic input] _contextvars.Context.items - -Return all variables and their values in the context object. - -The result is returned as a list of 2-tuples (variable, value). + +Return all variables and their values in the context object. + +The result is returned as a list of 2-tuples (variable, value). [clinic start generated code]*/ static PyObject * _contextvars_Context_items_impl(PyContext *self) -/*[clinic end generated code: output=fa1655c8a08502af input=00db64ae379f9f42]*/ +/*[clinic end generated code: output=fa1655c8a08502af input=00db64ae379f9f42]*/ { return _PyHamt_NewIterItems(self->ctx_vars); } @@ -590,13 +590,13 @@ _contextvars_Context_items_impl(PyContext *self) /*[clinic input] _contextvars.Context.keys - -Return a list of all variables in the context object. + +Return a list of all variables in the context object. [clinic start generated code]*/ static PyObject * _contextvars_Context_keys_impl(PyContext *self) -/*[clinic end generated code: output=177227c6b63ec0e2 input=114b53aebca3449c]*/ +/*[clinic end generated code: output=177227c6b63ec0e2 input=114b53aebca3449c]*/ { return _PyHamt_NewIterKeys(self->ctx_vars); } @@ -604,13 +604,13 @@ _contextvars_Context_keys_impl(PyContext *self) /*[clinic input] _contextvars.Context.values - -Return a list of all variables' values in the context object. + +Return a list of all variables' values in the context object. [clinic start generated code]*/ static PyObject * _contextvars_Context_values_impl(PyContext *self) -/*[clinic end generated code: output=d286dabfc8db6dde input=ce8075d04a6ea526]*/ +/*[clinic end generated code: output=d286dabfc8db6dde input=ce8075d04a6ea526]*/ { return _PyHamt_NewIterValues(self->ctx_vars); } @@ -618,13 +618,13 @@ _contextvars_Context_values_impl(PyContext *self) /*[clinic input] _contextvars.Context.copy - -Return a shallow copy of the context object. + +Return a shallow copy of the context object. [clinic start generated code]*/ static PyObject * _contextvars_Context_copy_impl(PyContext *self) -/*[clinic end generated code: output=30ba8896c4707a15 input=ebafdbdd9c72d592]*/ +/*[clinic end generated code: output=30ba8896c4707a15 input=ebafdbdd9c72d592]*/ { return (PyObject *)context_new_from_vars(self->ctx_vars); } @@ -634,22 +634,22 @@ static PyObject * context_run(PyContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyThreadState *ts = _PyThreadState_GET(); - + PyThreadState *ts = _PyThreadState_GET(); + if (nargs < 1) { - _PyErr_SetString(ts, PyExc_TypeError, - "run() missing 1 required positional argument"); + _PyErr_SetString(ts, PyExc_TypeError, + "run() missing 1 required positional argument"); return NULL; } - if (_PyContext_Enter(ts, (PyObject *)self)) { + if (_PyContext_Enter(ts, (PyObject *)self)) { return NULL; } - PyObject *call_result = _PyObject_VectorcallTstate( - ts, args[0], args + 1, nargs - 1, kwnames); + PyObject *call_result = _PyObject_VectorcallTstate( + ts, args[0], args + 1, nargs - 1, kwnames); - if (_PyContext_Exit(ts, (PyObject *)self)) { + if (_PyContext_Exit(ts, (PyObject *)self)) { return NULL; } @@ -663,7 +663,7 @@ static PyMethodDef PyContext_methods[] = { _CONTEXTVARS_CONTEXT_KEYS_METHODDEF _CONTEXTVARS_CONTEXT_VALUES_METHODDEF _CONTEXTVARS_CONTEXT_COPY_METHODDEF - {"run", (PyCFunction)(void(*)(void))context_run, METH_FASTCALL | METH_KEYWORDS, NULL}, + {"run", (PyCFunction)(void(*)(void))context_run, METH_FASTCALL | METH_KEYWORDS, NULL}, {NULL, NULL} }; @@ -942,19 +942,19 @@ error: _contextvars.ContextVar.get default: object = NULL / - -Return a value for the context variable for the current context. - -If there is no value for the variable in the current context, the method will: - * return the value of the default argument of the method, if provided; or - * return the default value for the context variable, if it was created - with one; or - * raise a LookupError. + +Return a value for the context variable for the current context. + +If there is no value for the variable in the current context, the method will: + * return the value of the default argument of the method, if provided; or + * return the default value for the context variable, if it was created + with one; or + * raise a LookupError. [clinic start generated code]*/ static PyObject * _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value) -/*[clinic end generated code: output=0746bd0aa2ced7bf input=30aa2ab9e433e401]*/ +/*[clinic end generated code: output=0746bd0aa2ced7bf input=30aa2ab9e433e401]*/ { if (!PyContextVar_CheckExact(self)) { PyErr_SetString( @@ -979,18 +979,18 @@ _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value) _contextvars.ContextVar.set value: object / - -Call to set a new value for the context variable in the current context. - -The required value argument is the new value for the context variable. - -Returns a Token object that can be used to restore the variable to its previous -value via the `ContextVar.reset()` method. + +Call to set a new value for the context variable in the current context. + +The required value argument is the new value for the context variable. + +Returns a Token object that can be used to restore the variable to its previous +value via the `ContextVar.reset()` method. [clinic start generated code]*/ static PyObject * _contextvars_ContextVar_set(PyContextVar *self, PyObject *value) -/*[clinic end generated code: output=446ed5e820d6d60b input=c0a6887154227453]*/ +/*[clinic end generated code: output=446ed5e820d6d60b input=c0a6887154227453]*/ { return PyContextVar_Set((PyObject *)self, value); } @@ -999,16 +999,16 @@ _contextvars_ContextVar_set(PyContextVar *self, PyObject *value) _contextvars.ContextVar.reset token: object / - -Reset the context variable. - -The variable is reset to the value it had before the `ContextVar.set()` that -created the token was used. + +Reset the context variable. + +The variable is reset to the value it had before the `ContextVar.set()` that +created the token was used. [clinic start generated code]*/ static PyObject * _contextvars_ContextVar_reset(PyContextVar *self, PyObject *token) -/*[clinic end generated code: output=d4ee34d0742d62ee input=ebe2881e5af4ffda]*/ +/*[clinic end generated code: output=d4ee34d0742d62ee input=ebe2881e5af4ffda]*/ { if (!PyContextToken_CheckExact(token)) { PyErr_Format(PyExc_TypeError, @@ -1033,8 +1033,8 @@ static PyMethodDef PyContextVar_methods[] = { _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF - {"__class_getitem__", (PyCFunction)Py_GenericAlias, - METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} }; @@ -1173,17 +1173,17 @@ static PyGetSetDef PyContextTokenType_getsetlist[] = { {NULL} }; -static PyMethodDef PyContextTokenType_methods[] = { - {"__class_getitem__", (PyCFunction)Py_GenericAlias, - METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, - {NULL} -}; - +static PyMethodDef PyContextTokenType_methods[] = { + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, + {NULL} +}; + PyTypeObject PyContextToken_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "Token", sizeof(PyContextToken), - .tp_methods = PyContextTokenType_methods, + .tp_methods = PyContextTokenType_methods, .tp_getset = PyContextTokenType_getsetlist, .tp_dealloc = (destructor)token_tp_dealloc, .tp_getattro = PyObject_GenericGetAttr, @@ -1270,10 +1270,10 @@ get_token_missing(void) /////////////////////////// -void -_PyContext_ClearFreeList(void) +void +_PyContext_ClearFreeList(void) { - for (; ctx_freelist_len; ctx_freelist_len--) { + for (; ctx_freelist_len; ctx_freelist_len--) { PyContext *ctx = ctx_freelist; ctx_freelist = (PyContext *)ctx->ctx_weakreflist; ctx->ctx_weakreflist = NULL; @@ -1286,8 +1286,8 @@ void _PyContext_Fini(void) { Py_CLEAR(_token_missing); - _PyContext_ClearFreeList(); - _PyHamt_Fini(); + _PyContext_ClearFreeList(); + _PyHamt_Fini(); } diff --git a/contrib/tools/python3/src/Python/dtoa.c b/contrib/tools/python3/src/Python/dtoa.c index 503934dcd6..e629b29642 100644 --- a/contrib/tools/python3/src/Python/dtoa.c +++ b/contrib/tools/python3/src/Python/dtoa.c @@ -64,9 +64,9 @@ * 7. _Py_dg_strtod has been modified so that it doesn't accept strings with * leading whitespace. * - * 8. A corner case where _Py_dg_dtoa didn't strip trailing zeros has been - * fixed. (bugs.python.org/issue40780) - * + * 8. A corner case where _Py_dg_dtoa didn't strip trailing zeros has been + * fixed. (bugs.python.org/issue40780) + * ***************************************************************/ /* Please send bug reports for the original dtoa.c code to David M. Gay (dmg @@ -118,7 +118,7 @@ /* Linking of Python's #defines to Gay's #defines starts here. */ #include "Python.h" -#include "pycore_dtoa.h" +#include "pycore_dtoa.h" /* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile the following code */ @@ -1445,9 +1445,9 @@ _Py_dg_strtod(const char *s00, char **se) ULong y, z, abs_exp; Long L; BCinfo bc; - Bigint *bb = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL; + Bigint *bb = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL; size_t ndigits, fraclen; - double result; + double result; dval(&rv) = 0.; @@ -1874,7 +1874,7 @@ _Py_dg_strtod(const char *s00, char **se) if (bs == NULL) { goto failed_malloc; } - Bigint *bb1 = mult(bs, bb); + Bigint *bb1 = mult(bs, bb); Bfree(bb); bb = bb1; if (bb == NULL) { @@ -2107,10 +2107,10 @@ _Py_dg_strtod(const char *s00, char **se) } } cont: - Bfree(bb); bb = NULL; - Bfree(bd); bd = NULL; - Bfree(bs); bs = NULL; - Bfree(delta); delta = NULL; + Bfree(bb); bb = NULL; + Bfree(bd); bd = NULL; + Bfree(bs); bs = NULL; + Bfree(delta); delta = NULL; } if (bc.nd > nd) { error = bigcomp(&rv, s0, &bc); @@ -2125,38 +2125,38 @@ _Py_dg_strtod(const char *s00, char **se) } ret: - result = sign ? -dval(&rv) : dval(&rv); - goto done; + result = sign ? -dval(&rv) : dval(&rv); + goto done; parse_error: - result = 0.0; - goto done; + result = 0.0; + goto done; failed_malloc: errno = ENOMEM; - result = -1.0; - goto done; + result = -1.0; + goto done; undfl: - result = sign ? -0.0 : 0.0; - goto done; + result = sign ? -0.0 : 0.0; + goto done; ovfl: errno = ERANGE; /* Can't trust HUGE_VAL */ word0(&rv) = Exp_mask; word1(&rv) = 0; - result = sign ? -dval(&rv) : dval(&rv); - goto done; - - done: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); - return result; - + result = sign ? -dval(&rv) : dval(&rv); + goto done; + + done: + Bfree(bb); + Bfree(bd); + Bfree(bs); + Bfree(bd0); + Bfree(delta); + return result; + } static char * @@ -2566,14 +2566,14 @@ _Py_dg_dtoa(double dd, int mode, int ndigits, } ++*s++; } - else { - /* Strip trailing zeros. This branch was missing from the - original dtoa.c, leading to surplus trailing zeros in - some cases. See bugs.python.org/issue40780. */ - while (s > s0 && s[-1] == '0') { - --s; - } - } + else { + /* Strip trailing zeros. This branch was missing from the + original dtoa.c, leading to surplus trailing zeros in + some cases. See bugs.python.org/issue40780. */ + while (s > s0 && s[-1] == '0') { + --s; + } + } break; } } diff --git a/contrib/tools/python3/src/Python/dynload_shlib.c b/contrib/tools/python3/src/Python/dynload_shlib.c index 613c894fa5..23828898d3 100644 --- a/contrib/tools/python3/src/Python/dynload_shlib.c +++ b/contrib/tools/python3/src/Python/dynload_shlib.c @@ -2,8 +2,8 @@ /* Support for dynamic loading of extension modules */ #include "Python.h" -#include "pycore_interp.h" // _PyInterpreterState.dlopenflags -#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_interp.h" // _PyInterpreterState.dlopenflags +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "importdl.h" #include <sys/types.h> @@ -39,9 +39,9 @@ const char *_PyImport_DynLoadFiletab[] = { ".dll", #else /* !__CYGWIN__ */ "." SOABI ".so", -#ifdef ALT_SOABI - "." ALT_SOABI ".so", -#endif +#ifdef ALT_SOABI + "." ALT_SOABI ".so", +#endif ".abi" PYTHON_ABI_STRING ".so", ".so", #endif /* __CYGWIN__ */ @@ -95,7 +95,7 @@ _PyImport_FindSharedFuncptr(const char *prefix, } } - dlopenflags = _PyInterpreterState_GET()->dlopenflags; + dlopenflags = _PyInterpreterState_GET()->dlopenflags; handle = dlopen(pathname, dlopenflags); @@ -106,7 +106,7 @@ _PyImport_FindSharedFuncptr(const char *prefix, const char *error = dlerror(); if (error == NULL) error = "unknown dlopen() error"; - error_ob = PyUnicode_DecodeLocale(error, "surrogateescape"); + error_ob = PyUnicode_DecodeLocale(error, "surrogateescape"); if (error_ob == NULL) return NULL; mod_name = PyUnicode_FromString(shortname); @@ -114,7 +114,7 @@ _PyImport_FindSharedFuncptr(const char *prefix, Py_DECREF(error_ob); return NULL; } - path = PyUnicode_DecodeFSDefault(pathname); + path = PyUnicode_DecodeFSDefault(pathname); if (path == NULL) { Py_DECREF(error_ob); Py_DECREF(mod_name); diff --git a/contrib/tools/python3/src/Python/dynload_win.c b/contrib/tools/python3/src/Python/dynload_win.c index 7dc227ed80..81787e5f22 100644 --- a/contrib/tools/python3/src/Python/dynload_win.c +++ b/contrib/tools/python3/src/Python/dynload_win.c @@ -170,10 +170,10 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, _Py_CheckPython3(); -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpathname = _PyUnicode_AsUnicode(pathname); -_Py_COMP_DIAG_POP +_Py_COMP_DIAG_POP if (wpathname == NULL) return NULL; @@ -186,15 +186,15 @@ _Py_COMP_DIAG_POP /* Don't display a message box when Python can't load a DLL */ old_mode = SetErrorMode(SEM_FAILCRITICALERRORS); - /* bpo-36085: We use LoadLibraryEx with restricted search paths - to avoid DLL preloading attacks and enable use of the - AddDllDirectory function. We add SEARCH_DLL_LOAD_DIR to - ensure DLLs adjacent to the PYD are preferred. */ - Py_BEGIN_ALLOW_THREADS + /* bpo-36085: We use LoadLibraryEx with restricted search paths + to avoid DLL preloading attacks and enable use of the + AddDllDirectory function. We add SEARCH_DLL_LOAD_DIR to + ensure DLLs adjacent to the PYD are preferred. */ + Py_BEGIN_ALLOW_THREADS hDLL = LoadLibraryExW(wpathname, NULL, - LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | - LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); - Py_END_ALLOW_THREADS + LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); + Py_END_ALLOW_THREADS /* restore old error mode settings */ SetErrorMode(old_mode); @@ -226,8 +226,8 @@ _Py_COMP_DIAG_POP This should not happen if called correctly. */ if (theLength == 0) { message = PyUnicode_FromFormat( - "DLL load failed with error code %u while importing %s", - errorCode, shortname); + "DLL load failed with error code %u while importing %s", + errorCode, shortname); } else { /* For some reason a \r\n is appended to the text */ @@ -237,8 +237,8 @@ _Py_COMP_DIAG_POP theLength -= 2; theInfo[theLength] = '\0'; } - message = PyUnicode_FromFormat( - "DLL load failed while importing %s: ", shortname); + message = PyUnicode_FromFormat( + "DLL load failed while importing %s: ", shortname); PyUnicode_AppendAndDel(&message, PyUnicode_FromWideChar( @@ -265,20 +265,20 @@ _Py_COMP_DIAG_POP import_python = GetPythonImport(hDLL); if (import_python && - _stricmp(buffer,import_python)) { + _stricmp(buffer,import_python)) { PyErr_Format(PyExc_ImportError, "Module use of %.150s conflicts " "with this version of Python.", import_python); - Py_BEGIN_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS FreeLibrary(hDLL); - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS return NULL; } } - Py_BEGIN_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS p = GetProcAddress(hDLL, funcname); - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS } return p; diff --git a/contrib/tools/python3/src/Python/errors.c b/contrib/tools/python3/src/Python/errors.c index 313702e4d1..79278764cc 100644 --- a/contrib/tools/python3/src/Python/errors.c +++ b/contrib/tools/python3/src/Python/errors.c @@ -2,12 +2,12 @@ /* Error handling */ #include "Python.h" -#include "pycore_initconfig.h" -#include "pycore_object.h" // _PyType_GetQualName -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_sysmodule.h" -#include "pycore_traceback.h" +#include "pycore_initconfig.h" +#include "pycore_object.h" // _PyType_GetQualName +#include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_sysmodule.h" +#include "pycore_traceback.h" #ifndef __STDC__ #ifndef MS_WINDOWS @@ -26,20 +26,20 @@ extern char *strerror(int); extern "C" { #endif -_Py_IDENTIFIER(__module__); +_Py_IDENTIFIER(__module__); _Py_IDENTIFIER(builtins); _Py_IDENTIFIER(stderr); -_Py_IDENTIFIER(flush); - -/* Forward declarations */ -static PyObject * -_PyErr_FormatV(PyThreadState *tstate, PyObject *exception, - const char *format, va_list vargs); - - +_Py_IDENTIFIER(flush); + +/* Forward declarations */ +static PyObject * +_PyErr_FormatV(PyThreadState *tstate, PyObject *exception, + const char *format, va_list vargs); + + void -_PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value, - PyObject *traceback) +_PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value, + PyObject *traceback) { PyObject *oldtype, *oldvalue, *oldtraceback; @@ -65,14 +65,14 @@ _PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value, Py_XDECREF(oldtraceback); } -void -PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Restore(tstate, type, value, traceback); -} - - +void +PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_Restore(tstate, type, value, traceback); +} + + _PyErr_StackItem * _PyErr_GetTopmostException(PyThreadState *tstate) { @@ -86,43 +86,43 @@ _PyErr_GetTopmostException(PyThreadState *tstate) } static PyObject* -_PyErr_CreateException(PyObject *exception_type, PyObject *value) +_PyErr_CreateException(PyObject *exception_type, PyObject *value) { - PyObject *exc; - + PyObject *exc; + if (value == NULL || value == Py_None) { - exc = _PyObject_CallNoArg(exception_type); + exc = _PyObject_CallNoArg(exception_type); } else if (PyTuple_Check(value)) { - exc = PyObject_Call(exception_type, value, NULL); + exc = PyObject_Call(exception_type, value, NULL); } else { - exc = PyObject_CallOneArg(exception_type, value); + exc = PyObject_CallOneArg(exception_type, value); + } + + if (exc != NULL && !PyExceptionInstance_Check(exc)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %s", + exception_type, Py_TYPE(exc)->tp_name); + Py_CLEAR(exc); } - - if (exc != NULL && !PyExceptionInstance_Check(exc)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %s", - exception_type, Py_TYPE(exc)->tp_name); - Py_CLEAR(exc); - } - - return exc; + + return exc; } void -_PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) +_PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) { PyObject *exc_value; PyObject *tb = NULL; if (exception != NULL && !PyExceptionClass_Check(exception)) { - _PyErr_Format(tstate, PyExc_SystemError, - "_PyErr_SetObject: " - "exception %R is not a BaseException subclass", - exception); + _PyErr_Format(tstate, PyExc_SystemError, + "_PyErr_SetObject: " + "exception %R is not a BaseException subclass", + exception); return; } @@ -137,7 +137,7 @@ _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) /* Issue #23571: functions must not be called with an exception set */ - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); fixed_value = _PyErr_CreateException(exception, value); Py_XDECREF(value); @@ -149,16 +149,16 @@ _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) value = fixed_value; } - /* Avoid creating new reference cycles through the - context chain, while taking care not to hang on - pre-existing ones. + /* Avoid creating new reference cycles through the + context chain, while taking care not to hang on + pre-existing ones. This is O(chain length) but context chains are usually very short. Sensitive readers may try to inline the call to PyException_GetContext. */ if (exc_value != value) { PyObject *o = exc_value, *context; - PyObject *slow_o = o; /* Floyd's cycle detection algo */ - int slow_update_toggle = 0; + PyObject *slow_o = o; /* Floyd's cycle detection algo */ + int slow_update_toggle = 0; while ((context = PyException_GetContext(o))) { Py_DECREF(context); if (context == value) { @@ -166,16 +166,16 @@ _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) break; } o = context; - if (o == slow_o) { - /* pre-existing cycle - all exceptions on the - path were visited and checked. */ - break; - } - if (slow_update_toggle) { - slow_o = PyException_GetContext(slow_o); - Py_DECREF(slow_o); - } - slow_update_toggle = !slow_update_toggle; + if (o == slow_o) { + /* pre-existing cycle - all exceptions on the + path were visited and checked. */ + break; + } + if (slow_update_toggle) { + slow_o = PyException_GetContext(slow_o); + Py_DECREF(slow_o); + } + slow_update_toggle = !slow_update_toggle; } PyException_SetContext(value, exc_value); } @@ -186,72 +186,72 @@ _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value) if (value != NULL && PyExceptionInstance_Check(value)) tb = PyException_GetTraceback(value); Py_XINCREF(exception); - _PyErr_Restore(tstate, exception, value, tb); + _PyErr_Restore(tstate, exception, value, tb); +} + +void +PyErr_SetObject(PyObject *exception, PyObject *value) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetObject(tstate, exception, value); } -void -PyErr_SetObject(PyObject *exception, PyObject *value) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetObject(tstate, exception, value); -} - /* Set a key error with the specified argument, wrapping it in a * tuple automatically so that tuple keys are not unpacked as the * exception arguments. */ void _PyErr_SetKeyError(PyObject *arg) { - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *tup = PyTuple_Pack(1, arg); - if (!tup) { - /* caller will expect error to be set anyway */ - return; - } - _PyErr_SetObject(tstate, PyExc_KeyError, tup); + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *tup = PyTuple_Pack(1, arg); + if (!tup) { + /* caller will expect error to be set anyway */ + return; + } + _PyErr_SetObject(tstate, PyExc_KeyError, tup); Py_DECREF(tup); } void -_PyErr_SetNone(PyThreadState *tstate, PyObject *exception) -{ - _PyErr_SetObject(tstate, exception, (PyObject *)NULL); -} - - -void +_PyErr_SetNone(PyThreadState *tstate, PyObject *exception) +{ + _PyErr_SetObject(tstate, exception, (PyObject *)NULL); +} + + +void PyErr_SetNone(PyObject *exception) { - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetNone(tstate, exception); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetNone(tstate, exception); } - + void -_PyErr_SetString(PyThreadState *tstate, PyObject *exception, - const char *string) +_PyErr_SetString(PyThreadState *tstate, PyObject *exception, + const char *string) { PyObject *value = PyUnicode_FromString(string); - _PyErr_SetObject(tstate, exception, value); + _PyErr_SetObject(tstate, exception, value); Py_XDECREF(value); } -void -PyErr_SetString(PyObject *exception, const char *string) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetString(tstate, exception, string); -} +void +PyErr_SetString(PyObject *exception, const char *string) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetString(tstate, exception, string); +} + - PyObject* _Py_HOT_FUNCTION PyErr_Occurred(void) { - /* The caller must hold the GIL. */ - assert(PyGILState_Check()); - - PyThreadState *tstate = _PyThreadState_GET(); - return _PyErr_Occurred(tstate); + /* The caller must hold the GIL. */ + assert(PyGILState_Check()); + + PyThreadState *tstate = _PyThreadState_GET(); + return _PyErr_Occurred(tstate); } @@ -288,17 +288,17 @@ PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc) int -_PyErr_ExceptionMatches(PyThreadState *tstate, PyObject *exc) -{ - return PyErr_GivenExceptionMatches(_PyErr_Occurred(tstate), exc); -} - - -int +_PyErr_ExceptionMatches(PyThreadState *tstate, PyObject *exc) +{ + return PyErr_GivenExceptionMatches(_PyErr_Occurred(tstate), exc); +} + + +int PyErr_ExceptionMatches(PyObject *exc) { - PyThreadState *tstate = _PyThreadState_GET(); - return _PyErr_ExceptionMatches(tstate, exc); + PyThreadState *tstate = _PyThreadState_GET(); + return _PyErr_ExceptionMatches(tstate, exc); } @@ -313,18 +313,18 @@ PyErr_ExceptionMatches(PyObject *exc) PyException_SetTraceback() with the resulting value and tb? */ void -_PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, - PyObject **val, PyObject **tb) +_PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, + PyObject **val, PyObject **tb) { int recursion_depth = 0; - tstate->overflowed++; + tstate->overflowed++; PyObject *type, *value, *initial_tb; restart: type = *exc; if (type == NULL) { /* There was no exception, so nothing to do. */ - tstate->overflowed--; + tstate->overflowed--; return; } @@ -376,7 +376,7 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, } *exc = type; *val = value; - tstate->overflowed--; + tstate->overflowed--; return; error: @@ -384,16 +384,16 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, Py_DECREF(value); recursion_depth++; if (recursion_depth == Py_NORMALIZE_RECURSION_LIMIT) { - _PyErr_SetString(tstate, PyExc_RecursionError, - "maximum recursion depth exceeded " - "while normalizing an exception"); + _PyErr_SetString(tstate, PyExc_RecursionError, + "maximum recursion depth exceeded " + "while normalizing an exception"); } /* If the new exception doesn't set a traceback and the old exception had a traceback, use the old traceback for the new exception. It's better than nothing. */ initial_tb = *tb; - _PyErr_Fetch(tstate, exc, val, tb); + _PyErr_Fetch(tstate, exc, val, tb); assert(*exc != NULL); if (initial_tb != NULL) { if (*tb == NULL) @@ -420,17 +420,17 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, void -PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) +PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) { - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_NormalizeException(tstate, exc, val, tb); -} + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_NormalizeException(tstate, exc, val, tb); +} + - -void -_PyErr_Fetch(PyThreadState *tstate, PyObject **p_type, PyObject **p_value, - PyObject **p_traceback) -{ +void +_PyErr_Fetch(PyThreadState *tstate, PyObject **p_type, PyObject **p_value, + PyObject **p_traceback) +{ *p_type = tstate->curexc_type; *p_value = tstate->curexc_value; *p_traceback = tstate->curexc_traceback; @@ -440,33 +440,33 @@ _PyErr_Fetch(PyThreadState *tstate, PyObject **p_type, PyObject **p_value, tstate->curexc_traceback = NULL; } - + +void +PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_Fetch(tstate, p_type, p_value, p_traceback); +} + + +void +_PyErr_Clear(PyThreadState *tstate) +{ + _PyErr_Restore(tstate, NULL, NULL, NULL); +} + + void -PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Fetch(tstate, p_type, p_value, p_traceback); -} - - -void -_PyErr_Clear(PyThreadState *tstate) -{ - _PyErr_Restore(tstate, NULL, NULL, NULL); -} - - -void PyErr_Clear(void) { - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Clear(tstate); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_Clear(tstate); } - + void -_PyErr_GetExcInfo(PyThreadState *tstate, - PyObject **p_type, PyObject **p_value, PyObject **p_traceback) +_PyErr_GetExcInfo(PyThreadState *tstate, + PyObject **p_type, PyObject **p_value, PyObject **p_traceback) { _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate); *p_type = exc_info->exc_type; @@ -478,19 +478,19 @@ _PyErr_GetExcInfo(PyThreadState *tstate, Py_XINCREF(*p_traceback); } - + +void +PyErr_GetExcInfo(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_GetExcInfo(tstate, p_type, p_value, p_traceback); +} + void -PyErr_GetExcInfo(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_GetExcInfo(tstate, p_type, p_value, p_traceback); -} - -void PyErr_SetExcInfo(PyObject *p_type, PyObject *p_value, PyObject *p_traceback) { PyObject *oldtype, *oldvalue, *oldtraceback; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); oldtype = tstate->exc_info->exc_type; oldvalue = tstate->exc_info->exc_value; @@ -507,153 +507,153 @@ PyErr_SetExcInfo(PyObject *p_type, PyObject *p_value, PyObject *p_traceback) /* Like PyErr_Restore(), but if an exception is already set, set the context associated with it. - - The caller is responsible for ensuring that this call won't create - any cycles in the exception context chain. */ + + The caller is responsible for ensuring that this call won't create + any cycles in the exception context chain. */ void _PyErr_ChainExceptions(PyObject *exc, PyObject *val, PyObject *tb) { if (exc == NULL) return; - PyThreadState *tstate = _PyThreadState_GET(); - - if (!PyExceptionClass_Check(exc)) { - _PyErr_Format(tstate, PyExc_SystemError, - "_PyErr_ChainExceptions: " - "exception %R is not a BaseException subclass", - exc); - return; - } - - if (_PyErr_Occurred(tstate)) { + PyThreadState *tstate = _PyThreadState_GET(); + + if (!PyExceptionClass_Check(exc)) { + _PyErr_Format(tstate, PyExc_SystemError, + "_PyErr_ChainExceptions: " + "exception %R is not a BaseException subclass", + exc); + return; + } + + if (_PyErr_Occurred(tstate)) { PyObject *exc2, *val2, *tb2; - _PyErr_Fetch(tstate, &exc2, &val2, &tb2); - _PyErr_NormalizeException(tstate, &exc, &val, &tb); + _PyErr_Fetch(tstate, &exc2, &val2, &tb2); + _PyErr_NormalizeException(tstate, &exc, &val, &tb); if (tb != NULL) { PyException_SetTraceback(val, tb); Py_DECREF(tb); } Py_DECREF(exc); - _PyErr_NormalizeException(tstate, &exc2, &val2, &tb2); + _PyErr_NormalizeException(tstate, &exc2, &val2, &tb2); PyException_SetContext(val2, val); - _PyErr_Restore(tstate, exc2, val2, tb2); + _PyErr_Restore(tstate, exc2, val2, tb2); } else { - _PyErr_Restore(tstate, exc, val, tb); - } -} - -/* Set the currently set exception's context to the given exception. - - If the provided exc_info is NULL, then the current Python thread state's - exc_info will be used for the context instead. - - This function can only be called when _PyErr_Occurred() is true. - Also, this function won't create any cycles in the exception context - chain to the extent that _PyErr_SetObject ensures this. */ -void -_PyErr_ChainStackItem(_PyErr_StackItem *exc_info) -{ - PyThreadState *tstate = _PyThreadState_GET(); - assert(_PyErr_Occurred(tstate)); - - int exc_info_given; - if (exc_info == NULL) { - exc_info_given = 0; - exc_info = tstate->exc_info; - } else { - exc_info_given = 1; - } - if (exc_info->exc_type == NULL || exc_info->exc_type == Py_None) { - return; - } - - _PyErr_StackItem *saved_exc_info; - if (exc_info_given) { - /* Temporarily set the thread state's exc_info since this is what - _PyErr_SetObject uses for implicit exception chaining. */ - saved_exc_info = tstate->exc_info; - tstate->exc_info = exc_info; - } - - PyObject *exc, *val, *tb; - _PyErr_Fetch(tstate, &exc, &val, &tb); - - PyObject *exc2, *val2, *tb2; - exc2 = exc_info->exc_type; - val2 = exc_info->exc_value; - tb2 = exc_info->exc_traceback; - _PyErr_NormalizeException(tstate, &exc2, &val2, &tb2); - if (tb2 != NULL) { - PyException_SetTraceback(val2, tb2); - } - - /* _PyErr_SetObject sets the context from PyThreadState. */ - _PyErr_SetObject(tstate, exc, val); - Py_DECREF(exc); // since _PyErr_Occurred was true - Py_XDECREF(val); - Py_XDECREF(tb); - - if (exc_info_given) { - tstate->exc_info = saved_exc_info; - } -} - + _PyErr_Restore(tstate, exc, val, tb); + } +} + +/* Set the currently set exception's context to the given exception. + + If the provided exc_info is NULL, then the current Python thread state's + exc_info will be used for the context instead. + + This function can only be called when _PyErr_Occurred() is true. + Also, this function won't create any cycles in the exception context + chain to the extent that _PyErr_SetObject ensures this. */ +void +_PyErr_ChainStackItem(_PyErr_StackItem *exc_info) +{ + PyThreadState *tstate = _PyThreadState_GET(); + assert(_PyErr_Occurred(tstate)); + + int exc_info_given; + if (exc_info == NULL) { + exc_info_given = 0; + exc_info = tstate->exc_info; + } else { + exc_info_given = 1; + } + if (exc_info->exc_type == NULL || exc_info->exc_type == Py_None) { + return; + } + + _PyErr_StackItem *saved_exc_info; + if (exc_info_given) { + /* Temporarily set the thread state's exc_info since this is what + _PyErr_SetObject uses for implicit exception chaining. */ + saved_exc_info = tstate->exc_info; + tstate->exc_info = exc_info; + } + + PyObject *exc, *val, *tb; + _PyErr_Fetch(tstate, &exc, &val, &tb); + + PyObject *exc2, *val2, *tb2; + exc2 = exc_info->exc_type; + val2 = exc_info->exc_value; + tb2 = exc_info->exc_traceback; + _PyErr_NormalizeException(tstate, &exc2, &val2, &tb2); + if (tb2 != NULL) { + PyException_SetTraceback(val2, tb2); + } + + /* _PyErr_SetObject sets the context from PyThreadState. */ + _PyErr_SetObject(tstate, exc, val); + Py_DECREF(exc); // since _PyErr_Occurred was true + Py_XDECREF(val); + Py_XDECREF(tb); + + if (exc_info_given) { + tstate->exc_info = saved_exc_info; + } +} + static PyObject * -_PyErr_FormatVFromCause(PyThreadState *tstate, PyObject *exception, - const char *format, va_list vargs) +_PyErr_FormatVFromCause(PyThreadState *tstate, PyObject *exception, + const char *format, va_list vargs) { PyObject *exc, *val, *val2, *tb; - assert(_PyErr_Occurred(tstate)); - _PyErr_Fetch(tstate, &exc, &val, &tb); - _PyErr_NormalizeException(tstate, &exc, &val, &tb); + assert(_PyErr_Occurred(tstate)); + _PyErr_Fetch(tstate, &exc, &val, &tb); + _PyErr_NormalizeException(tstate, &exc, &val, &tb); if (tb != NULL) { PyException_SetTraceback(val, tb); Py_DECREF(tb); } Py_DECREF(exc); - assert(!_PyErr_Occurred(tstate)); + assert(!_PyErr_Occurred(tstate)); - _PyErr_FormatV(tstate, exception, format, vargs); + _PyErr_FormatV(tstate, exception, format, vargs); - _PyErr_Fetch(tstate, &exc, &val2, &tb); - _PyErr_NormalizeException(tstate, &exc, &val2, &tb); + _PyErr_Fetch(tstate, &exc, &val2, &tb); + _PyErr_NormalizeException(tstate, &exc, &val2, &tb); Py_INCREF(val); PyException_SetCause(val2, val); PyException_SetContext(val2, val); - _PyErr_Restore(tstate, exc, val2, tb); + _PyErr_Restore(tstate, exc, val2, tb); return NULL; } PyObject * -_PyErr_FormatFromCauseTstate(PyThreadState *tstate, PyObject *exception, - const char *format, ...) -{ - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - _PyErr_FormatVFromCause(tstate, exception, format, vargs); - va_end(vargs); - return NULL; -} - -PyObject * +_PyErr_FormatFromCauseTstate(PyThreadState *tstate, PyObject *exception, + const char *format, ...) +{ + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + _PyErr_FormatVFromCause(tstate, exception, format, vargs); + va_end(vargs); + return NULL; +} + +PyObject * _PyErr_FormatFromCause(PyObject *exception, const char *format, ...) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); va_list vargs; #ifdef HAVE_STDARG_PROTOTYPES va_start(vargs, format); #else va_start(vargs); #endif - _PyErr_FormatVFromCause(tstate, exception, format, vargs); + _PyErr_FormatVFromCause(tstate, exception, format, vargs); va_end(vargs); return NULL; } @@ -663,33 +663,33 @@ _PyErr_FormatFromCause(PyObject *exception, const char *format, ...) int PyErr_BadArgument(void) { - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetString(tstate, PyExc_TypeError, - "bad argument type for built-in operation"); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetString(tstate, PyExc_TypeError, + "bad argument type for built-in operation"); return 0; } PyObject * -_PyErr_NoMemory(PyThreadState *tstate) +_PyErr_NoMemory(PyThreadState *tstate) { - if (Py_IS_TYPE(PyExc_MemoryError, NULL)) { + if (Py_IS_TYPE(PyExc_MemoryError, NULL)) { /* PyErr_NoMemory() has been called before PyExc_MemoryError has been initialized by _PyExc_Init() */ Py_FatalError("Out of memory and PyExc_MemoryError is not " "initialized yet"); } - _PyErr_SetNone(tstate, PyExc_MemoryError); + _PyErr_SetNone(tstate, PyExc_MemoryError); return NULL; } PyObject * -PyErr_NoMemory(void) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return _PyErr_NoMemory(tstate); -} - -PyObject * +PyErr_NoMemory(void) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return _PyErr_NoMemory(tstate); +} + +PyObject * PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject) { return PyErr_SetFromErrnoWithFilenameObjects(exc, filenameObject, NULL); @@ -698,7 +698,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject) PyObject * PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, PyObject *filenameObject2) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *message; PyObject *v, *args; int i = errno; @@ -713,7 +713,7 @@ PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, P #ifndef MS_WINDOWS if (i != 0) { - const char *s = strerror(i); + const char *s = strerror(i); message = PyUnicode_DecodeLocale(s, "surrogateescape"); } else { @@ -784,7 +784,7 @@ PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, P v = PyObject_Call(exc, args, NULL); Py_DECREF(args); if (v != NULL) { - _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v); + _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v); Py_DECREF(v); } } @@ -837,17 +837,17 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObjects( PyObject *filenameObject, PyObject *filenameObject2) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int len; WCHAR *s_buf = NULL; /* Free via LocalFree */ PyObject *message; PyObject *args, *v; - + DWORD err = (DWORD)ierr; - if (err==0) { - err = GetLastError(); - } - + if (err==0) { + err = GetLastError(); + } + len = FormatMessageW( /* Error API error */ FORMAT_MESSAGE_ALLOCATE_BUFFER | @@ -892,7 +892,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObjects( v = PyObject_Call(exc, args, NULL); Py_DECREF(args); if (v != NULL) { - _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v); + _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v); Py_DECREF(v); } } @@ -968,7 +968,7 @@ PyObject * PyErr_SetImportErrorSubclass(PyObject *exception, PyObject *msg, PyObject *name, PyObject *path) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int issubclass; PyObject *kwargs, *error; @@ -977,14 +977,14 @@ PyErr_SetImportErrorSubclass(PyObject *exception, PyObject *msg, return NULL; } else if (!issubclass) { - _PyErr_SetString(tstate, PyExc_TypeError, - "expected a subclass of ImportError"); + _PyErr_SetString(tstate, PyExc_TypeError, + "expected a subclass of ImportError"); return NULL; } if (msg == NULL) { - _PyErr_SetString(tstate, PyExc_TypeError, - "expected a message argument"); + _PyErr_SetString(tstate, PyExc_TypeError, + "expected a message argument"); return NULL; } @@ -1006,9 +1006,9 @@ PyErr_SetImportErrorSubclass(PyObject *exception, PyObject *msg, goto done; } - error = PyObject_VectorcallDict(exception, &msg, 1, kwargs); + error = PyObject_VectorcallDict(exception, &msg, 1, kwargs); if (error != NULL) { - _PyErr_SetObject(tstate, (PyObject *)Py_TYPE(error), error); + _PyErr_SetObject(tstate, (PyObject *)Py_TYPE(error), error); Py_DECREF(error); } @@ -1026,10 +1026,10 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path) void _PyErr_BadInternalCall(const char *filename, int lineno) { - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Format(tstate, PyExc_SystemError, - "%s:%d: bad argument to internal function", - filename, lineno); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_Format(tstate, PyExc_SystemError, + "%s:%d: bad argument to internal function", + filename, lineno); } /* Remove the preprocessor macro for PyErr_BadInternalCall() so that we can @@ -1039,66 +1039,66 @@ void PyErr_BadInternalCall(void) { assert(0 && "bad argument to internal function"); - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetString(tstate, PyExc_SystemError, - "bad argument to internal function"); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetString(tstate, PyExc_SystemError, + "bad argument to internal function"); } #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) -static PyObject * -_PyErr_FormatV(PyThreadState *tstate, PyObject *exception, - const char *format, va_list vargs) +static PyObject * +_PyErr_FormatV(PyThreadState *tstate, PyObject *exception, + const char *format, va_list vargs) { PyObject* string; /* Issue #23571: PyUnicode_FromFormatV() must not be called with an exception set, it calls arbitrary Python code like PyObject_Repr() */ - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); string = PyUnicode_FromFormatV(format, vargs); - _PyErr_SetObject(tstate, exception, string); + _PyErr_SetObject(tstate, exception, string); Py_XDECREF(string); return NULL; } PyObject * -PyErr_FormatV(PyObject *exception, const char *format, va_list vargs) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return _PyErr_FormatV(tstate, exception, format, vargs); -} - - -PyObject * -_PyErr_Format(PyThreadState *tstate, PyObject *exception, - const char *format, ...) -{ - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - _PyErr_FormatV(tstate, exception, format, vargs); - va_end(vargs); - return NULL; -} - - -PyObject * +PyErr_FormatV(PyObject *exception, const char *format, va_list vargs) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return _PyErr_FormatV(tstate, exception, format, vargs); +} + + +PyObject * +_PyErr_Format(PyThreadState *tstate, PyObject *exception, + const char *format, ...) +{ + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + _PyErr_FormatV(tstate, exception, format, vargs); + va_end(vargs); + return NULL; +} + + +PyObject * PyErr_Format(PyObject *exception, const char *format, ...) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); va_list vargs; #ifdef HAVE_STDARG_PROTOTYPES va_start(vargs, format); #else va_start(vargs); #endif - _PyErr_FormatV(tstate, exception, format, vargs); + _PyErr_FormatV(tstate, exception, format, vargs); va_end(vargs); return NULL; } @@ -1107,37 +1107,37 @@ PyErr_Format(PyObject *exception, const char *format, ...) PyObject * PyErr_NewException(const char *name, PyObject *base, PyObject *dict) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *modulename = NULL; PyObject *classname = NULL; PyObject *mydict = NULL; PyObject *bases = NULL; PyObject *result = NULL; - - const char *dot = strrchr(name, '.'); + + const char *dot = strrchr(name, '.'); if (dot == NULL) { - _PyErr_SetString(tstate, PyExc_SystemError, - "PyErr_NewException: name must be module.class"); + _PyErr_SetString(tstate, PyExc_SystemError, + "PyErr_NewException: name must be module.class"); return NULL; } - if (base == NULL) { + if (base == NULL) { base = PyExc_Exception; - } + } if (dict == NULL) { dict = mydict = PyDict_New(); if (dict == NULL) goto failure; } - - if (_PyDict_GetItemIdWithError(dict, &PyId___module__) == NULL) { - if (_PyErr_Occurred(tstate)) { - goto failure; - } + + if (_PyDict_GetItemIdWithError(dict, &PyId___module__) == NULL) { + if (_PyErr_Occurred(tstate)) { + goto failure; + } modulename = PyUnicode_FromStringAndSize(name, (Py_ssize_t)(dot-name)); if (modulename == NULL) goto failure; - if (_PyDict_SetItemId(dict, &PyId___module__, modulename) != 0) + if (_PyDict_SetItemId(dict, &PyId___module__, modulename) != 0) goto failure; } if (PyTuple_Check(base)) { @@ -1195,372 +1195,372 @@ PyErr_NewExceptionWithDoc(const char *name, const char *doc, } -PyDoc_STRVAR(UnraisableHookArgs__doc__, -"UnraisableHookArgs\n\ -\n\ -Type used to pass arguments to sys.unraisablehook."); - -static PyTypeObject UnraisableHookArgsType; - -static PyStructSequence_Field UnraisableHookArgs_fields[] = { - {"exc_type", "Exception type"}, - {"exc_value", "Exception value"}, - {"exc_traceback", "Exception traceback"}, - {"err_msg", "Error message"}, - {"object", "Object causing the exception"}, - {0} -}; - -static PyStructSequence_Desc UnraisableHookArgs_desc = { - .name = "UnraisableHookArgs", - .doc = UnraisableHookArgs__doc__, - .fields = UnraisableHookArgs_fields, - .n_in_sequence = 5 -}; - - -PyStatus -_PyErr_Init(void) -{ - if (UnraisableHookArgsType.tp_name == NULL) { - if (PyStructSequence_InitType2(&UnraisableHookArgsType, - &UnraisableHookArgs_desc) < 0) { - return _PyStatus_ERR("failed to initialize UnraisableHookArgs type"); - } - } - return _PyStatus_OK(); -} - - -static PyObject * -make_unraisable_hook_args(PyThreadState *tstate, PyObject *exc_type, - PyObject *exc_value, PyObject *exc_tb, - PyObject *err_msg, PyObject *obj) -{ - PyObject *args = PyStructSequence_New(&UnraisableHookArgsType); - if (args == NULL) { - return NULL; - } - - Py_ssize_t pos = 0; -#define ADD_ITEM(exc_type) \ - do { \ - if (exc_type == NULL) { \ - exc_type = Py_None; \ - } \ - Py_INCREF(exc_type); \ - PyStructSequence_SET_ITEM(args, pos++, exc_type); \ - } while (0) - - - ADD_ITEM(exc_type); - ADD_ITEM(exc_value); - ADD_ITEM(exc_tb); - ADD_ITEM(err_msg); - ADD_ITEM(obj); -#undef ADD_ITEM - - if (_PyErr_Occurred(tstate)) { - Py_DECREF(args); - return NULL; - } - return args; -} - - - -/* Default implementation of sys.unraisablehook. - - It can be called to log the exception of a custom sys.unraisablehook. - - Do nothing if sys.stderr attribute doesn't exist or is set to None. */ -static int -write_unraisable_exc_file(PyThreadState *tstate, PyObject *exc_type, - PyObject *exc_value, PyObject *exc_tb, - PyObject *err_msg, PyObject *obj, PyObject *file) -{ - if (obj != NULL && obj != Py_None) { - if (err_msg != NULL && err_msg != Py_None) { - if (PyFile_WriteObject(err_msg, file, Py_PRINT_RAW) < 0) { - return -1; - } - if (PyFile_WriteString(": ", file) < 0) { - return -1; - } - } - else { - if (PyFile_WriteString("Exception ignored in: ", file) < 0) { - return -1; - } - } - - if (PyFile_WriteObject(obj, file, 0) < 0) { - _PyErr_Clear(tstate); - if (PyFile_WriteString("<object repr() failed>", file) < 0) { - return -1; +PyDoc_STRVAR(UnraisableHookArgs__doc__, +"UnraisableHookArgs\n\ +\n\ +Type used to pass arguments to sys.unraisablehook."); + +static PyTypeObject UnraisableHookArgsType; + +static PyStructSequence_Field UnraisableHookArgs_fields[] = { + {"exc_type", "Exception type"}, + {"exc_value", "Exception value"}, + {"exc_traceback", "Exception traceback"}, + {"err_msg", "Error message"}, + {"object", "Object causing the exception"}, + {0} +}; + +static PyStructSequence_Desc UnraisableHookArgs_desc = { + .name = "UnraisableHookArgs", + .doc = UnraisableHookArgs__doc__, + .fields = UnraisableHookArgs_fields, + .n_in_sequence = 5 +}; + + +PyStatus +_PyErr_Init(void) +{ + if (UnraisableHookArgsType.tp_name == NULL) { + if (PyStructSequence_InitType2(&UnraisableHookArgsType, + &UnraisableHookArgs_desc) < 0) { + return _PyStatus_ERR("failed to initialize UnraisableHookArgs type"); + } + } + return _PyStatus_OK(); +} + + +static PyObject * +make_unraisable_hook_args(PyThreadState *tstate, PyObject *exc_type, + PyObject *exc_value, PyObject *exc_tb, + PyObject *err_msg, PyObject *obj) +{ + PyObject *args = PyStructSequence_New(&UnraisableHookArgsType); + if (args == NULL) { + return NULL; + } + + Py_ssize_t pos = 0; +#define ADD_ITEM(exc_type) \ + do { \ + if (exc_type == NULL) { \ + exc_type = Py_None; \ + } \ + Py_INCREF(exc_type); \ + PyStructSequence_SET_ITEM(args, pos++, exc_type); \ + } while (0) + + + ADD_ITEM(exc_type); + ADD_ITEM(exc_value); + ADD_ITEM(exc_tb); + ADD_ITEM(err_msg); + ADD_ITEM(obj); +#undef ADD_ITEM + + if (_PyErr_Occurred(tstate)) { + Py_DECREF(args); + return NULL; + } + return args; +} + + + +/* Default implementation of sys.unraisablehook. + + It can be called to log the exception of a custom sys.unraisablehook. + + Do nothing if sys.stderr attribute doesn't exist or is set to None. */ +static int +write_unraisable_exc_file(PyThreadState *tstate, PyObject *exc_type, + PyObject *exc_value, PyObject *exc_tb, + PyObject *err_msg, PyObject *obj, PyObject *file) +{ + if (obj != NULL && obj != Py_None) { + if (err_msg != NULL && err_msg != Py_None) { + if (PyFile_WriteObject(err_msg, file, Py_PRINT_RAW) < 0) { + return -1; + } + if (PyFile_WriteString(": ", file) < 0) { + return -1; } } - if (PyFile_WriteString("\n", file) < 0) { - return -1; - } - } - else if (err_msg != NULL && err_msg != Py_None) { - if (PyFile_WriteObject(err_msg, file, Py_PRINT_RAW) < 0) { - return -1; - } - if (PyFile_WriteString(":\n", file) < 0) { - return -1; - } - } - - if (exc_tb != NULL && exc_tb != Py_None) { - if (PyTraceBack_Print(exc_tb, file) < 0) { - /* continue even if writing the traceback failed */ - _PyErr_Clear(tstate); - } - } - - if (exc_type == NULL || exc_type == Py_None) { - return -1; - } - - assert(PyExceptionClass_Check(exc_type)); - - PyObject *modulename = _PyObject_GetAttrId(exc_type, &PyId___module__); - if (modulename == NULL || !PyUnicode_Check(modulename)) { - Py_XDECREF(modulename); - _PyErr_Clear(tstate); - if (PyFile_WriteString("<unknown>", file) < 0) { - return -1; - } + else { + if (PyFile_WriteString("Exception ignored in: ", file) < 0) { + return -1; + } + } + + if (PyFile_WriteObject(obj, file, 0) < 0) { + _PyErr_Clear(tstate); + if (PyFile_WriteString("<object repr() failed>", file) < 0) { + return -1; + } + } + if (PyFile_WriteString("\n", file) < 0) { + return -1; + } + } + else if (err_msg != NULL && err_msg != Py_None) { + if (PyFile_WriteObject(err_msg, file, Py_PRINT_RAW) < 0) { + return -1; + } + if (PyFile_WriteString(":\n", file) < 0) { + return -1; + } + } + + if (exc_tb != NULL && exc_tb != Py_None) { + if (PyTraceBack_Print(exc_tb, file) < 0) { + /* continue even if writing the traceback failed */ + _PyErr_Clear(tstate); + } + } + + if (exc_type == NULL || exc_type == Py_None) { + return -1; + } + + assert(PyExceptionClass_Check(exc_type)); + + PyObject *modulename = _PyObject_GetAttrId(exc_type, &PyId___module__); + if (modulename == NULL || !PyUnicode_Check(modulename)) { + Py_XDECREF(modulename); + _PyErr_Clear(tstate); + if (PyFile_WriteString("<unknown>", file) < 0) { + return -1; + } } else { - if (!_PyUnicode_EqualToASCIIId(modulename, &PyId_builtins)) { - if (PyFile_WriteObject(modulename, file, Py_PRINT_RAW) < 0) { - Py_DECREF(modulename); - return -1; - } - Py_DECREF(modulename); - if (PyFile_WriteString(".", file) < 0) { - return -1; - } + if (!_PyUnicode_EqualToASCIIId(modulename, &PyId_builtins)) { + if (PyFile_WriteObject(modulename, file, Py_PRINT_RAW) < 0) { + Py_DECREF(modulename); + return -1; + } + Py_DECREF(modulename); + if (PyFile_WriteString(".", file) < 0) { + return -1; + } + } + else { + Py_DECREF(modulename); + } + } + + PyObject *qualname = _PyType_GetQualName((PyTypeObject *)exc_type); + if (qualname == NULL || !PyUnicode_Check(qualname)) { + Py_XDECREF(qualname); + _PyErr_Clear(tstate); + if (PyFile_WriteString("<unknown>", file) < 0) { + return -1; } - else { - Py_DECREF(modulename); - } - } - - PyObject *qualname = _PyType_GetQualName((PyTypeObject *)exc_type); - if (qualname == NULL || !PyUnicode_Check(qualname)) { - Py_XDECREF(qualname); - _PyErr_Clear(tstate); - if (PyFile_WriteString("<unknown>", file) < 0) { - return -1; - } } else { - if (PyFile_WriteObject(qualname, file, Py_PRINT_RAW) < 0) { - Py_DECREF(qualname); - return -1; - } - Py_DECREF(qualname); - } - - if (exc_value && exc_value != Py_None) { - if (PyFile_WriteString(": ", file) < 0) { - return -1; - } - if (PyFile_WriteObject(exc_value, file, Py_PRINT_RAW) < 0) { - _PyErr_Clear(tstate); - if (PyFile_WriteString("<exception str() failed>", file) < 0) { - return -1; + if (PyFile_WriteObject(qualname, file, Py_PRINT_RAW) < 0) { + Py_DECREF(qualname); + return -1; + } + Py_DECREF(qualname); + } + + if (exc_value && exc_value != Py_None) { + if (PyFile_WriteString(": ", file) < 0) { + return -1; + } + if (PyFile_WriteObject(exc_value, file, Py_PRINT_RAW) < 0) { + _PyErr_Clear(tstate); + if (PyFile_WriteString("<exception str() failed>", file) < 0) { + return -1; + } + } + } + + if (PyFile_WriteString("\n", file) < 0) { + return -1; + } + + /* Explicitly call file.flush() */ + PyObject *res = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); + if (!res) { + return -1; + } + Py_DECREF(res); + + return 0; +} + + +static int +write_unraisable_exc(PyThreadState *tstate, PyObject *exc_type, + PyObject *exc_value, PyObject *exc_tb, PyObject *err_msg, + PyObject *obj) +{ + PyObject *file = _PySys_GetObjectId(&PyId_stderr); + if (file == NULL || file == Py_None) { + return 0; + } + + /* Hold a strong reference to ensure that sys.stderr doesn't go away + while we use it */ + Py_INCREF(file); + int res = write_unraisable_exc_file(tstate, exc_type, exc_value, exc_tb, + err_msg, obj, file); + Py_DECREF(file); + + return res; +} + + +PyObject* +_PyErr_WriteUnraisableDefaultHook(PyObject *args) +{ + PyThreadState *tstate = _PyThreadState_GET(); + + if (!Py_IS_TYPE(args, &UnraisableHookArgsType)) { + _PyErr_SetString(tstate, PyExc_TypeError, + "sys.unraisablehook argument type " + "must be UnraisableHookArgs"); + return NULL; + } + + /* Borrowed references */ + PyObject *exc_type = PyStructSequence_GET_ITEM(args, 0); + PyObject *exc_value = PyStructSequence_GET_ITEM(args, 1); + PyObject *exc_tb = PyStructSequence_GET_ITEM(args, 2); + PyObject *err_msg = PyStructSequence_GET_ITEM(args, 3); + PyObject *obj = PyStructSequence_GET_ITEM(args, 4); + + if (write_unraisable_exc(tstate, exc_type, exc_value, exc_tb, err_msg, obj) < 0) { + return NULL; + } + Py_RETURN_NONE; +} + + +/* Call sys.unraisablehook(). + + This function can be used when an exception has occurred but there is no way + for Python to handle it. For example, when a destructor raises an exception + or during garbage collection (gc.collect()). + + If err_msg_str is non-NULL, the error message is formatted as: + "Exception ignored %s" % err_msg_str. Otherwise, use "Exception ignored in" + error message. + + An exception must be set when calling this function. */ +void +_PyErr_WriteUnraisableMsg(const char *err_msg_str, PyObject *obj) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _Py_EnsureTstateNotNULL(tstate); + + PyObject *err_msg = NULL; + PyObject *exc_type, *exc_value, *exc_tb; + _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); + + assert(exc_type != NULL); + + if (exc_type == NULL) { + /* sys.unraisablehook requires that at least exc_type is set */ + goto default_hook; + } + + if (exc_tb == NULL) { + PyFrameObject *frame = tstate->frame; + if (frame != NULL) { + exc_tb = _PyTraceBack_FromFrame(NULL, frame); + if (exc_tb == NULL) { + _PyErr_Clear(tstate); } } } - - if (PyFile_WriteString("\n", file) < 0) { - return -1; - } - - /* Explicitly call file.flush() */ - PyObject *res = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); - if (!res) { - return -1; - } - Py_DECREF(res); - - return 0; -} - - -static int -write_unraisable_exc(PyThreadState *tstate, PyObject *exc_type, - PyObject *exc_value, PyObject *exc_tb, PyObject *err_msg, - PyObject *obj) -{ - PyObject *file = _PySys_GetObjectId(&PyId_stderr); - if (file == NULL || file == Py_None) { - return 0; - } - - /* Hold a strong reference to ensure that sys.stderr doesn't go away - while we use it */ - Py_INCREF(file); - int res = write_unraisable_exc_file(tstate, exc_type, exc_value, exc_tb, - err_msg, obj, file); - Py_DECREF(file); - - return res; -} - - -PyObject* -_PyErr_WriteUnraisableDefaultHook(PyObject *args) -{ - PyThreadState *tstate = _PyThreadState_GET(); - - if (!Py_IS_TYPE(args, &UnraisableHookArgsType)) { - _PyErr_SetString(tstate, PyExc_TypeError, - "sys.unraisablehook argument type " - "must be UnraisableHookArgs"); - return NULL; - } - - /* Borrowed references */ - PyObject *exc_type = PyStructSequence_GET_ITEM(args, 0); - PyObject *exc_value = PyStructSequence_GET_ITEM(args, 1); - PyObject *exc_tb = PyStructSequence_GET_ITEM(args, 2); - PyObject *err_msg = PyStructSequence_GET_ITEM(args, 3); - PyObject *obj = PyStructSequence_GET_ITEM(args, 4); - - if (write_unraisable_exc(tstate, exc_type, exc_value, exc_tb, err_msg, obj) < 0) { - return NULL; - } - Py_RETURN_NONE; -} - - -/* Call sys.unraisablehook(). - - This function can be used when an exception has occurred but there is no way - for Python to handle it. For example, when a destructor raises an exception - or during garbage collection (gc.collect()). - - If err_msg_str is non-NULL, the error message is formatted as: - "Exception ignored %s" % err_msg_str. Otherwise, use "Exception ignored in" - error message. - - An exception must be set when calling this function. */ -void -_PyErr_WriteUnraisableMsg(const char *err_msg_str, PyObject *obj) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _Py_EnsureTstateNotNULL(tstate); - - PyObject *err_msg = NULL; - PyObject *exc_type, *exc_value, *exc_tb; - _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); - - assert(exc_type != NULL); - - if (exc_type == NULL) { - /* sys.unraisablehook requires that at least exc_type is set */ - goto default_hook; - } - - if (exc_tb == NULL) { - PyFrameObject *frame = tstate->frame; - if (frame != NULL) { - exc_tb = _PyTraceBack_FromFrame(NULL, frame); - if (exc_tb == NULL) { - _PyErr_Clear(tstate); - } - } - } - - _PyErr_NormalizeException(tstate, &exc_type, &exc_value, &exc_tb); - - if (exc_tb != NULL && exc_tb != Py_None && PyTraceBack_Check(exc_tb)) { - if (PyException_SetTraceback(exc_value, exc_tb) < 0) { - _PyErr_Clear(tstate); - } - } - - if (err_msg_str != NULL) { - err_msg = PyUnicode_FromFormat("Exception ignored %s", err_msg_str); - if (err_msg == NULL) { - PyErr_Clear(); - } - } - - PyObject *hook_args = make_unraisable_hook_args( - tstate, exc_type, exc_value, exc_tb, err_msg, obj); - if (hook_args == NULL) { - err_msg_str = ("Exception ignored on building " - "sys.unraisablehook arguments"); - goto error; - } - - _Py_IDENTIFIER(unraisablehook); - PyObject *hook = _PySys_GetObjectId(&PyId_unraisablehook); - if (hook == NULL) { - Py_DECREF(hook_args); - goto default_hook; - } - - if (_PySys_Audit(tstate, "sys.unraisablehook", "OO", hook, hook_args) < 0) { - Py_DECREF(hook_args); - err_msg_str = "Exception ignored in audit hook"; - obj = NULL; - goto error; - } - - if (hook == Py_None) { - Py_DECREF(hook_args); - goto default_hook; - } - - PyObject *res = PyObject_CallOneArg(hook, hook_args); - Py_DECREF(hook_args); - if (res != NULL) { - Py_DECREF(res); - goto done; - } - - /* sys.unraisablehook failed: log its error using default hook */ - obj = hook; - err_msg_str = NULL; - -error: - /* err_msg_str and obj have been updated and we have a new exception */ - Py_XSETREF(err_msg, PyUnicode_FromString(err_msg_str ? - err_msg_str : "Exception ignored in sys.unraisablehook")); - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); - -default_hook: - /* Call the default unraisable hook (ignore failure) */ - (void)write_unraisable_exc(tstate, exc_type, exc_value, exc_tb, - err_msg, obj); - -done: - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - Py_XDECREF(err_msg); - _PyErr_Clear(tstate); /* Just in case */ -} - - -void -PyErr_WriteUnraisable(PyObject *obj) -{ - _PyErr_WriteUnraisableMsg(NULL, obj); -} - - + + _PyErr_NormalizeException(tstate, &exc_type, &exc_value, &exc_tb); + + if (exc_tb != NULL && exc_tb != Py_None && PyTraceBack_Check(exc_tb)) { + if (PyException_SetTraceback(exc_value, exc_tb) < 0) { + _PyErr_Clear(tstate); + } + } + + if (err_msg_str != NULL) { + err_msg = PyUnicode_FromFormat("Exception ignored %s", err_msg_str); + if (err_msg == NULL) { + PyErr_Clear(); + } + } + + PyObject *hook_args = make_unraisable_hook_args( + tstate, exc_type, exc_value, exc_tb, err_msg, obj); + if (hook_args == NULL) { + err_msg_str = ("Exception ignored on building " + "sys.unraisablehook arguments"); + goto error; + } + + _Py_IDENTIFIER(unraisablehook); + PyObject *hook = _PySys_GetObjectId(&PyId_unraisablehook); + if (hook == NULL) { + Py_DECREF(hook_args); + goto default_hook; + } + + if (_PySys_Audit(tstate, "sys.unraisablehook", "OO", hook, hook_args) < 0) { + Py_DECREF(hook_args); + err_msg_str = "Exception ignored in audit hook"; + obj = NULL; + goto error; + } + + if (hook == Py_None) { + Py_DECREF(hook_args); + goto default_hook; + } + + PyObject *res = PyObject_CallOneArg(hook, hook_args); + Py_DECREF(hook_args); + if (res != NULL) { + Py_DECREF(res); + goto done; + } + + /* sys.unraisablehook failed: log its error using default hook */ + obj = hook; + err_msg_str = NULL; + +error: + /* err_msg_str and obj have been updated and we have a new exception */ + Py_XSETREF(err_msg, PyUnicode_FromString(err_msg_str ? + err_msg_str : "Exception ignored in sys.unraisablehook")); + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); + +default_hook: + /* Call the default unraisable hook (ignore failure) */ + (void)write_unraisable_exc(tstate, exc_type, exc_value, exc_tb, + err_msg, obj); + +done: + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + Py_XDECREF(err_msg); + _PyErr_Clear(tstate); /* Just in case */ +} + + +void +PyErr_WriteUnraisable(PyObject *obj) +{ + _PyErr_WriteUnraisableMsg(NULL, obj); +} + + extern PyObject *PyModule_GetWarningsModule(void); @@ -1585,43 +1585,43 @@ PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset) _Py_IDENTIFIER(offset); _Py_IDENTIFIER(print_file_and_line); _Py_IDENTIFIER(text); - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); /* add attributes for the line number and filename for the error */ - _PyErr_Fetch(tstate, &exc, &v, &tb); - _PyErr_NormalizeException(tstate, &exc, &v, &tb); + _PyErr_Fetch(tstate, &exc, &v, &tb); + _PyErr_NormalizeException(tstate, &exc, &v, &tb); /* XXX check that it is, indeed, a syntax error. It might not * be, though. */ tmp = PyLong_FromLong(lineno); if (tmp == NULL) - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); else { - if (_PyObject_SetAttrId(v, &PyId_lineno, tmp)) { - _PyErr_Clear(tstate); - } + if (_PyObject_SetAttrId(v, &PyId_lineno, tmp)) { + _PyErr_Clear(tstate); + } Py_DECREF(tmp); } tmp = NULL; if (col_offset >= 0) { tmp = PyLong_FromLong(col_offset); - if (tmp == NULL) { - _PyErr_Clear(tstate); - } + if (tmp == NULL) { + _PyErr_Clear(tstate); + } + } + if (_PyObject_SetAttrId(v, &PyId_offset, tmp ? tmp : Py_None)) { + _PyErr_Clear(tstate); } - if (_PyObject_SetAttrId(v, &PyId_offset, tmp ? tmp : Py_None)) { - _PyErr_Clear(tstate); - } Py_XDECREF(tmp); if (filename != NULL) { - if (_PyObject_SetAttrId(v, &PyId_filename, filename)) { - _PyErr_Clear(tstate); - } + if (_PyObject_SetAttrId(v, &PyId_filename, filename)) { + _PyErr_Clear(tstate); + } tmp = PyErr_ProgramTextObject(filename, lineno); if (tmp) { - if (_PyObject_SetAttrId(v, &PyId_text, tmp)) { - _PyErr_Clear(tstate); - } + if (_PyObject_SetAttrId(v, &PyId_text, tmp)) { + _PyErr_Clear(tstate); + } Py_DECREF(tmp); } } @@ -1629,39 +1629,39 @@ PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset) if (!_PyObject_HasAttrId(v, &PyId_msg)) { tmp = PyObject_Str(v); if (tmp) { - if (_PyObject_SetAttrId(v, &PyId_msg, tmp)) { - _PyErr_Clear(tstate); - } + if (_PyObject_SetAttrId(v, &PyId_msg, tmp)) { + _PyErr_Clear(tstate); + } Py_DECREF(tmp); } - else { - _PyErr_Clear(tstate); - } + else { + _PyErr_Clear(tstate); + } } if (!_PyObject_HasAttrId(v, &PyId_print_file_and_line)) { if (_PyObject_SetAttrId(v, &PyId_print_file_and_line, - Py_None)) { - _PyErr_Clear(tstate); - } + Py_None)) { + _PyErr_Clear(tstate); + } } } - _PyErr_Restore(tstate, exc, v, tb); + _PyErr_Restore(tstate, exc, v, tb); } void PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *fileobj; if (filename != NULL) { fileobj = PyUnicode_DecodeFSDefault(filename); - if (fileobj == NULL) { - _PyErr_Clear(tstate); - } + if (fileobj == NULL) { + _PyErr_Clear(tstate); + } } - else { + else { fileobj = NULL; - } + } PyErr_SyntaxLocationObject(fileobj, lineno, col_offset); Py_XDECREF(fileobj); } @@ -1673,22 +1673,22 @@ PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset) functionality in tb_displayline() in traceback.c. */ static PyObject * -err_programtext(PyThreadState *tstate, FILE *fp, int lineno) +err_programtext(PyThreadState *tstate, FILE *fp, int lineno) { int i; char linebuf[1000]; - if (fp == NULL) { - return NULL; - } + if (fp == NULL) { + return NULL; + } for (i = 0; i < lineno; i++) { char *pLastChar = &linebuf[sizeof(linebuf) - 2]; do { *pLastChar = '\0'; if (Py_UniversalNewlineFgets(linebuf, sizeof linebuf, - fp, NULL) == NULL) { - goto after_loop; - } + fp, NULL) == NULL) { + goto after_loop; + } /* fgets read *something*; if it didn't get as far as pLastChar, it must have found a newline or hit the end of the file; if pLastChar is \n, @@ -1696,14 +1696,14 @@ err_programtext(PyThreadState *tstate, FILE *fp, int lineno) yet seen a newline, so must continue */ } while (*pLastChar != '\0' && *pLastChar != '\n'); } - -after_loop: + +after_loop: fclose(fp); if (i == lineno) { PyObject *res; res = PyUnicode_FromString(linebuf); if (res == NULL) - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); return res; } return NULL; @@ -1713,28 +1713,28 @@ PyObject * PyErr_ProgramText(const char *filename, int lineno) { FILE *fp; - if (filename == NULL || *filename == '\0' || lineno <= 0) { + if (filename == NULL || *filename == '\0' || lineno <= 0) { return NULL; - } - PyThreadState *tstate = _PyThreadState_GET(); + } + PyThreadState *tstate = _PyThreadState_GET(); fp = _Py_fopen(filename, "r" PY_STDIOTEXTMODE); - return err_programtext(tstate, fp, lineno); + return err_programtext(tstate, fp, lineno); } PyObject * PyErr_ProgramTextObject(PyObject *filename, int lineno) { - if (filename == NULL || lineno <= 0) { + if (filename == NULL || lineno <= 0) { return NULL; - } - - PyThreadState *tstate = _PyThreadState_GET(); - FILE *fp = _Py_fopen_obj(filename, "r" PY_STDIOTEXTMODE); + } + + PyThreadState *tstate = _PyThreadState_GET(); + FILE *fp = _Py_fopen_obj(filename, "r" PY_STDIOTEXTMODE); if (fp == NULL) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); return NULL; } - return err_programtext(tstate, fp, lineno); + return err_programtext(tstate, fp, lineno); } #ifdef __cplusplus diff --git a/contrib/tools/python3/src/Python/fileutils.c b/contrib/tools/python3/src/Python/fileutils.c index ce0a9ef8ce..26e97df4ef 100644 --- a/contrib/tools/python3/src/Python/fileutils.c +++ b/contrib/tools/python3/src/Python/fileutils.c @@ -1,6 +1,6 @@ #include "Python.h" -#include "pycore_fileutils.h" -#include "osdefs.h" // SEP +#include "pycore_fileutils.h" +#include "osdefs.h" // SEP #include <locale.h> #ifdef MS_WINDOWS @@ -17,10 +17,10 @@ extern int winerror_to_errno(int); #include <sys/ioctl.h> #endif -#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION -#include <iconv.h> -#endif - +#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION +#include <iconv.h> +#endif + #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif /* HAVE_FCNTL_H */ @@ -37,31 +37,31 @@ extern int winerror_to_errno(int); int _Py_open_cloexec_works = -1; #endif -// The value must be the same in unicodeobject.c. -#define MAX_UNICODE 0x10ffff - -// mbstowcs() and mbrtowc() errors -static const size_t DECODE_ERROR = ((size_t)-1); -static const size_t INCOMPLETE_CHARACTER = (size_t)-2; - - -static int -get_surrogateescape(_Py_error_handler errors, int *surrogateescape) -{ - switch (errors) - { - case _Py_ERROR_STRICT: - *surrogateescape = 0; - return 0; - case _Py_ERROR_SURROGATEESCAPE: - *surrogateescape = 1; - return 0; - default: - return -1; - } -} - - +// The value must be the same in unicodeobject.c. +#define MAX_UNICODE 0x10ffff + +// mbstowcs() and mbrtowc() errors +static const size_t DECODE_ERROR = ((size_t)-1); +static const size_t INCOMPLETE_CHARACTER = (size_t)-2; + + +static int +get_surrogateescape(_Py_error_handler errors, int *surrogateescape) +{ + switch (errors) + { + case _Py_ERROR_STRICT: + *surrogateescape = 0; + return 0; + case _Py_ERROR_SURROGATEESCAPE: + *surrogateescape = 1; + return 0; + default: + return -1; + } +} + + PyObject * _Py_device_encoding(int fd) { @@ -69,11 +69,11 @@ _Py_device_encoding(int fd) UINT cp; #endif int valid; - Py_BEGIN_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH valid = isatty(fd); _Py_END_SUPPRESS_IPH - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS if (!valid) Py_RETURN_NONE; @@ -98,71 +98,71 @@ _Py_device_encoding(int fd) Py_RETURN_NONE; } - -static size_t -is_valid_wide_char(wchar_t ch) -{ -#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION - /* Oracle Solaris doesn't use Unicode code points as wchar_t encoding - for non-Unicode locales, which makes values higher than MAX_UNICODE - possibly valid. */ - return 1; -#endif - if (Py_UNICODE_IS_SURROGATE(ch)) { - // Reject lone surrogate characters - return 0; - } - if (ch > MAX_UNICODE) { - // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. - // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, - // it creates characters outside the [U+0000; U+10ffff] range: - // https://sourceware.org/bugzilla/show_bug.cgi?id=2373 - return 0; - } - return 1; -} - - -static size_t -_Py_mbstowcs(wchar_t *dest, const char *src, size_t n) -{ - size_t count = mbstowcs(dest, src, n); - if (dest != NULL && count != DECODE_ERROR) { - for (size_t i=0; i < count; i++) { - wchar_t ch = dest[i]; - if (!is_valid_wide_char(ch)) { - return DECODE_ERROR; - } - } - } - return count; -} - - -#ifdef HAVE_MBRTOWC -static size_t -_Py_mbrtowc(wchar_t *pwc, const char *str, size_t len, mbstate_t *pmbs) -{ - assert(pwc != NULL); - size_t count = mbrtowc(pwc, str, len, pmbs); - if (count != 0 && count != DECODE_ERROR && count != INCOMPLETE_CHARACTER) { - if (!is_valid_wide_char(*pwc)) { - return DECODE_ERROR; - } - } - return count; -} -#endif - - -#if !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) + +static size_t +is_valid_wide_char(wchar_t ch) +{ +#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION + /* Oracle Solaris doesn't use Unicode code points as wchar_t encoding + for non-Unicode locales, which makes values higher than MAX_UNICODE + possibly valid. */ + return 1; +#endif + if (Py_UNICODE_IS_SURROGATE(ch)) { + // Reject lone surrogate characters + return 0; + } + if (ch > MAX_UNICODE) { + // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. + // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, + // it creates characters outside the [U+0000; U+10ffff] range: + // https://sourceware.org/bugzilla/show_bug.cgi?id=2373 + return 0; + } + return 1; +} + + +static size_t +_Py_mbstowcs(wchar_t *dest, const char *src, size_t n) +{ + size_t count = mbstowcs(dest, src, n); + if (dest != NULL && count != DECODE_ERROR) { + for (size_t i=0; i < count; i++) { + wchar_t ch = dest[i]; + if (!is_valid_wide_char(ch)) { + return DECODE_ERROR; + } + } + } + return count; +} + + +#ifdef HAVE_MBRTOWC +static size_t +_Py_mbrtowc(wchar_t *pwc, const char *str, size_t len, mbstate_t *pmbs) +{ + assert(pwc != NULL); + size_t count = mbrtowc(pwc, str, len, pmbs); + if (count != 0 && count != DECODE_ERROR && count != INCOMPLETE_CHARACTER) { + if (!is_valid_wide_char(*pwc)) { + return DECODE_ERROR; + } + } + return count; +} +#endif + + +#if !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) #define USE_FORCE_ASCII extern int _Py_normalize_encoding(const char *, char *, size_t); -/* Workaround FreeBSD and OpenIndiana locale encoding issue with the C locale - and POSIX locale. nl_langinfo(CODESET) announces an alias of the +/* Workaround FreeBSD and OpenIndiana locale encoding issue with the C locale + and POSIX locale. nl_langinfo(CODESET) announces an alias of the ASCII encoding, whereas mbstowcs() and wcstombs() functions use the ISO-8859-1 encoding. The problem is that os.fsencode() and os.fsdecode() use locale.getpreferredencoding() codec. For example, if command line arguments @@ -175,10 +175,10 @@ extern int _Py_normalize_encoding(const char *, char *, size_t); workaround is also enabled on error, for example if getting the locale failed. - On HP-UX with the C locale or the POSIX locale, nl_langinfo(CODESET) - announces "roman8" but mbstowcs() uses Latin1 in practice. Force also the - ASCII encoding in this case. - + On HP-UX with the C locale or the POSIX locale, nl_langinfo(CODESET) + announces "roman8" but mbstowcs() uses Latin1 in practice. Force also the + ASCII encoding in this case. + Values of force_ascii: 1: the workaround is used: Py_EncodeLocale() uses @@ -193,46 +193,46 @@ static int force_ascii = -1; static int check_force_ascii(void) { - char *loc = setlocale(LC_CTYPE, NULL); - if (loc == NULL) { - goto error; - } - if (strcmp(loc, "C") != 0 && strcmp(loc, "POSIX") != 0) { - /* the LC_CTYPE locale is different than C and POSIX */ - return 0; - } - + char *loc = setlocale(LC_CTYPE, NULL); + if (loc == NULL) { + goto error; + } + if (strcmp(loc, "C") != 0 && strcmp(loc, "POSIX") != 0) { + /* the LC_CTYPE locale is different than C and POSIX */ + return 0; + } + #if defined(HAVE_LANGINFO_H) && defined(CODESET) - const char *codeset = nl_langinfo(CODESET); - if (!codeset || codeset[0] == '\0') { - /* CODESET is not set or empty */ - goto error; - } - + const char *codeset = nl_langinfo(CODESET); + if (!codeset || codeset[0] == '\0') { + /* CODESET is not set or empty */ + goto error; + } + char encoding[20]; /* longest name: "iso_646.irv_1991\0" */ - if (!_Py_normalize_encoding(codeset, encoding, sizeof(encoding))) { - goto error; - } - -#ifdef __hpux - if (strcmp(encoding, "roman8") == 0) { - unsigned char ch; - wchar_t wch; - size_t res; - - ch = (unsigned char)0xA7; - res = _Py_mbstowcs(&wch, (char*)&ch, 1); - if (res != DECODE_ERROR && wch == L'\xA7') { - /* On HP-UX with C locale or the POSIX locale, - nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses - Latin1 encoding in practice. Force ASCII in this case. - - Roman8 decodes 0xA7 to U+00CF. Latin1 decodes 0xA7 to U+00A7. */ - return 1; - } - } -#else - const char* ascii_aliases[] = { + if (!_Py_normalize_encoding(codeset, encoding, sizeof(encoding))) { + goto error; + } + +#ifdef __hpux + if (strcmp(encoding, "roman8") == 0) { + unsigned char ch; + wchar_t wch; + size_t res; + + ch = (unsigned char)0xA7; + res = _Py_mbstowcs(&wch, (char*)&ch, 1); + if (res != DECODE_ERROR && wch == L'\xA7') { + /* On HP-UX with C locale or the POSIX locale, + nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses + Latin1 encoding in practice. Force ASCII in this case. + + Roman8 decodes 0xA7 to U+00CF. Latin1 decodes 0xA7 to U+00A7. */ + return 1; + } + } +#else + const char* ascii_aliases[] = { "ascii", /* Aliases from Lib/encodings/aliases.py */ "646", @@ -250,8 +250,8 @@ check_force_ascii(void) NULL }; - int is_ascii = 0; - for (const char **alias=ascii_aliases; *alias != NULL; alias++) { + int is_ascii = 0; + for (const char **alias=ascii_aliases; *alias != NULL; alias++) { if (strcmp(encoding, *alias) == 0) { is_ascii = 1; break; @@ -262,15 +262,15 @@ check_force_ascii(void) return 0; } - for (unsigned int i=0x80; i<=0xff; i++) { - char ch[1]; - wchar_t wch[1]; + for (unsigned int i=0x80; i<=0xff; i++) { + char ch[1]; + wchar_t wch[1]; size_t res; - unsigned uch = (unsigned char)i; - ch[0] = (char)uch; - res = _Py_mbstowcs(wch, ch, 1); - if (res != DECODE_ERROR) { + unsigned uch = (unsigned char)i; + ch[0] = (char)uch; + res = _Py_mbstowcs(wch, ch, 1); + if (res != DECODE_ERROR) { /* decoding a non-ASCII character from the locale encoding succeed: the locale encoding is not ASCII, force ASCII */ return 1; @@ -278,12 +278,12 @@ check_force_ascii(void) } /* None of the bytes in the range 0x80-0xff can be decoded from the locale encoding: the locale encoding is really ASCII */ -#endif /* !defined(__hpux) */ +#endif /* !defined(__hpux) */ return 0; #else /* nl_langinfo(CODESET) is not available: always force ASCII */ return 1; -#endif /* defined(HAVE_LANGINFO_H) && defined(CODESET) */ +#endif /* defined(HAVE_LANGINFO_H) && defined(CODESET) */ error: /* if an error occurred, force the ASCII encoding */ @@ -311,17 +311,17 @@ _Py_ResetForceASCII(void) static int encode_ascii(const wchar_t *text, char **str, size_t *error_pos, const char **reason, - int raw_malloc, _Py_error_handler errors) + int raw_malloc, _Py_error_handler errors) { char *result = NULL, *out; size_t len, i; wchar_t ch; - int surrogateescape; - if (get_surrogateescape(errors, &surrogateescape) < 0) { - return -3; - } - + int surrogateescape; + if (get_surrogateescape(errors, &surrogateescape) < 0) { + return -3; + } + len = wcslen(text); /* +1 for NULL byte */ @@ -379,24 +379,24 @@ _Py_ResetForceASCII(void) { /* nothing to do */ } -#endif /* !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) */ +#endif /* !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) */ #if !defined(HAVE_MBRTOWC) || defined(USE_FORCE_ASCII) static int decode_ascii(const char *arg, wchar_t **wstr, size_t *wlen, - const char **reason, _Py_error_handler errors) + const char **reason, _Py_error_handler errors) { wchar_t *res; unsigned char *in; wchar_t *out; size_t argsize = strlen(arg) + 1; - int surrogateescape; - if (get_surrogateescape(errors, &surrogateescape) < 0) { - return -3; - } - + int surrogateescape; + if (get_surrogateescape(errors, &surrogateescape) < 0) { + return -3; + } + if (argsize > PY_SSIZE_T_MAX / sizeof(wchar_t)) { return -1; } @@ -437,7 +437,7 @@ decode_ascii(const char *arg, wchar_t **wstr, size_t *wlen, static int decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, - const char **reason, _Py_error_handler errors) + const char **reason, _Py_error_handler errors) { wchar_t *res; size_t argsize; @@ -448,11 +448,11 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, mbstate_t mbs; #endif - int surrogateescape; - if (get_surrogateescape(errors, &surrogateescape) < 0) { - return -3; - } - + int surrogateescape; + if (get_surrogateescape(errors, &surrogateescape) < 0) { + return -3; + } + #ifdef HAVE_BROKEN_MBSTOWCS /* Some platforms have a broken implementation of * mbstowcs which does not count the characters that @@ -460,9 +460,9 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, */ argsize = strlen(arg); #else - argsize = _Py_mbstowcs(NULL, arg, 0); + argsize = _Py_mbstowcs(NULL, arg, 0); #endif - if (argsize != DECODE_ERROR) { + if (argsize != DECODE_ERROR) { if (argsize > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { return -1; } @@ -471,13 +471,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, return -1; } - count = _Py_mbstowcs(res, arg, argsize + 1); - if (count != DECODE_ERROR) { - *wstr = res; - if (wlen != NULL) { - *wlen = count; + count = _Py_mbstowcs(res, arg, argsize + 1); + if (count != DECODE_ERROR) { + *wstr = res; + if (wlen != NULL) { + *wlen = count; } - return 0; + return 0; } PyMem_RawFree(res); } @@ -501,13 +501,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, out = res; memset(&mbs, 0, sizeof mbs); while (argsize) { - size_t converted = _Py_mbrtowc(out, (char*)in, argsize, &mbs); + size_t converted = _Py_mbrtowc(out, (char*)in, argsize, &mbs); if (converted == 0) { /* Reached end of string; null char stored. */ break; } - if (converted == INCOMPLETE_CHARACTER) { + if (converted == INCOMPLETE_CHARACTER) { /* Incomplete character. This should never happen, since we provide everything that we have - unless there is a bug in the C library, or I @@ -515,21 +515,21 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, goto decode_error; } - if (converted == DECODE_ERROR) { + if (converted == DECODE_ERROR) { if (!surrogateescape) { goto decode_error; } - /* Decoding error. Escape as UTF-8b, and start over in the initial - shift state. */ + /* Decoding error. Escape as UTF-8b, and start over in the initial + shift state. */ *out++ = 0xdc00 + *in++; argsize--; memset(&mbs, 0, sizeof mbs); continue; } - // _Py_mbrtowc() reject lone surrogate characters - assert(!Py_UNICODE_IS_SURROGATE(*out)); + // _Py_mbrtowc() reject lone surrogate characters + assert(!Py_UNICODE_IS_SURROGATE(*out)); /* successfully converted some bytes */ in += converted; @@ -555,7 +555,7 @@ decode_error: /* Cannot use C locale for escaping; manually escape as if charset is ASCII (i.e. escape all bytes > 128. This will still roundtrip correctly in the locale's charset, which must be an ASCII superset. */ - return decode_ascii(arg, wstr, wlen, reason, errors); + return decode_ascii(arg, wstr, wlen, reason, errors); #endif /* HAVE_MBRTOWC */ } @@ -578,35 +578,35 @@ decode_error: invalid byte sequence in the input string into *wlen. If reason is not NULL, write the decoding error message into *reason. - Return -3 if the error handler 'errors' is not supported. - + Return -3 if the error handler 'errors' is not supported. + Use the Py_EncodeLocaleEx() function to encode the character string back to a byte string. */ int _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen, const char **reason, - int current_locale, _Py_error_handler errors) + int current_locale, _Py_error_handler errors) { if (current_locale) { -#ifdef _Py_FORCE_UTF8_LOCALE +#ifdef _Py_FORCE_UTF8_LOCALE return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason, - errors); + errors); #else - return decode_current_locale(arg, wstr, wlen, reason, errors); + return decode_current_locale(arg, wstr, wlen, reason, errors); #endif } -#ifdef _Py_FORCE_UTF8_FS_ENCODING +#ifdef _Py_FORCE_UTF8_FS_ENCODING return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason, - errors); + errors); #else - int use_utf8 = (Py_UTF8Mode == 1); -#ifdef MS_WINDOWS - use_utf8 |= !Py_LegacyWindowsFSEncodingFlag; -#endif - if (use_utf8) { + int use_utf8 = (Py_UTF8Mode == 1); +#ifdef MS_WINDOWS + use_utf8 |= !Py_LegacyWindowsFSEncodingFlag; +#endif + if (use_utf8) { return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason, - errors); + errors); } #ifdef USE_FORCE_ASCII @@ -616,12 +616,12 @@ _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen, if (force_ascii) { /* force ASCII encoding to workaround mbstowcs() issue */ - return decode_ascii(arg, wstr, wlen, reason, errors); + return decode_ascii(arg, wstr, wlen, reason, errors); } #endif - return decode_current_locale(arg, wstr, wlen, reason, errors); -#endif /* !_Py_FORCE_UTF8_FS_ENCODING */ + return decode_current_locale(arg, wstr, wlen, reason, errors); +#endif /* !_Py_FORCE_UTF8_FS_ENCODING */ } @@ -648,11 +648,11 @@ wchar_t* Py_DecodeLocale(const char* arg, size_t *wlen) { wchar_t *wstr; - int res = _Py_DecodeLocaleEx(arg, &wstr, wlen, - NULL, 0, - _Py_ERROR_SURROGATEESCAPE); + int res = _Py_DecodeLocaleEx(arg, &wstr, wlen, + NULL, 0, + _Py_ERROR_SURROGATEESCAPE); if (res != 0) { - assert(res != -3); + assert(res != -3); if (wlen != NULL) { *wlen = (size_t)res; } @@ -665,18 +665,18 @@ Py_DecodeLocale(const char* arg, size_t *wlen) static int encode_current_locale(const wchar_t *text, char **str, size_t *error_pos, const char **reason, - int raw_malloc, _Py_error_handler errors) + int raw_malloc, _Py_error_handler errors) { const size_t len = wcslen(text); char *result = NULL, *bytes = NULL; size_t i, size, converted; wchar_t c, buf[2]; - int surrogateescape; - if (get_surrogateescape(errors, &surrogateescape) < 0) { - return -3; - } - + int surrogateescape; + if (get_surrogateescape(errors, &surrogateescape) < 0) { + return -3; + } + /* The function works in two steps: 1. compute the length of the output buffer in bytes (size) 2. outputs the bytes */ @@ -707,7 +707,7 @@ encode_current_locale(const wchar_t *text, char **str, else { converted = wcstombs(NULL, buf, 0); } - if (converted == DECODE_ERROR) { + if (converted == DECODE_ERROR) { goto encode_error; } if (bytes != NULL) { @@ -755,50 +755,50 @@ encode_error: return -2; } - -/* Encode a string to the locale encoding. - - Parameters: - - * raw_malloc: if non-zero, allocate memory using PyMem_RawMalloc() instead - of PyMem_Malloc(). - * current_locale: if non-zero, use the current LC_CTYPE, otherwise use - Python filesystem encoding. - * errors: error handler like "strict" or "surrogateescape". - - Return value: - - 0: success, *str is set to a newly allocated decoded string. - -1: memory allocation failure - -2: encoding error, set *error_pos and *reason (if set). - -3: the error handler 'errors' is not supported. - */ + +/* Encode a string to the locale encoding. + + Parameters: + + * raw_malloc: if non-zero, allocate memory using PyMem_RawMalloc() instead + of PyMem_Malloc(). + * current_locale: if non-zero, use the current LC_CTYPE, otherwise use + Python filesystem encoding. + * errors: error handler like "strict" or "surrogateescape". + + Return value: + + 0: success, *str is set to a newly allocated decoded string. + -1: memory allocation failure + -2: encoding error, set *error_pos and *reason (if set). + -3: the error handler 'errors' is not supported. + */ static int encode_locale_ex(const wchar_t *text, char **str, size_t *error_pos, const char **reason, - int raw_malloc, int current_locale, _Py_error_handler errors) + int raw_malloc, int current_locale, _Py_error_handler errors) { if (current_locale) { -#ifdef _Py_FORCE_UTF8_LOCALE +#ifdef _Py_FORCE_UTF8_LOCALE return _Py_EncodeUTF8Ex(text, str, error_pos, reason, - raw_malloc, errors); + raw_malloc, errors); #else return encode_current_locale(text, str, error_pos, reason, - raw_malloc, errors); + raw_malloc, errors); #endif } -#ifdef _Py_FORCE_UTF8_FS_ENCODING +#ifdef _Py_FORCE_UTF8_FS_ENCODING return _Py_EncodeUTF8Ex(text, str, error_pos, reason, - raw_malloc, errors); -#else - int use_utf8 = (Py_UTF8Mode == 1); -#ifdef MS_WINDOWS - use_utf8 |= !Py_LegacyWindowsFSEncodingFlag; -#endif - if (use_utf8) { + raw_malloc, errors); +#else + int use_utf8 = (Py_UTF8Mode == 1); +#ifdef MS_WINDOWS + use_utf8 |= !Py_LegacyWindowsFSEncodingFlag; +#endif + if (use_utf8) { return _Py_EncodeUTF8Ex(text, str, error_pos, reason, - raw_malloc, errors); + raw_malloc, errors); } #ifdef USE_FORCE_ASCII @@ -808,13 +808,13 @@ encode_locale_ex(const wchar_t *text, char **str, size_t *error_pos, if (force_ascii) { return encode_ascii(text, str, error_pos, reason, - raw_malloc, errors); + raw_malloc, errors); } #endif return encode_current_locale(text, str, error_pos, reason, - raw_malloc, errors); -#endif /* _Py_FORCE_UTF8_FS_ENCODING */ + raw_malloc, errors); +#endif /* _Py_FORCE_UTF8_FS_ENCODING */ } static char* @@ -823,8 +823,8 @@ encode_locale(const wchar_t *text, size_t *error_pos, { char *str; int res = encode_locale_ex(text, &str, error_pos, NULL, - raw_malloc, current_locale, - _Py_ERROR_SURROGATEESCAPE); + raw_malloc, current_locale, + _Py_ERROR_SURROGATEESCAPE); if (res != -2 && error_pos) { *error_pos = (size_t)-1; } @@ -865,109 +865,109 @@ _Py_EncodeLocaleRaw(const wchar_t *text, size_t *error_pos) int _Py_EncodeLocaleEx(const wchar_t *text, char **str, size_t *error_pos, const char **reason, - int current_locale, _Py_error_handler errors) + int current_locale, _Py_error_handler errors) { return encode_locale_ex(text, str, error_pos, reason, 1, - current_locale, errors); + current_locale, errors); } -#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION - -/* Check whether current locale uses Unicode as internal wchar_t form. */ -int -_Py_LocaleUsesNonUnicodeWchar(void) -{ - /* Oracle Solaris uses non-Unicode internal wchar_t form for - non-Unicode locales and hence needs conversion to UTF first. */ - char* codeset = nl_langinfo(CODESET); - if (!codeset) { - return 0; - } - /* 646 refers to ISO/IEC 646 standard that corresponds to ASCII encoding */ - return (strcmp(codeset, "UTF-8") != 0 && strcmp(codeset, "646") != 0); -} - -static wchar_t * -_Py_ConvertWCharForm(const wchar_t *source, Py_ssize_t size, - const char *tocode, const char *fromcode) -{ - Py_BUILD_ASSERT(sizeof(wchar_t) == 4); - - /* Ensure we won't overflow the size. */ - if (size > (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t))) { - PyErr_NoMemory(); - return NULL; - } - - /* the string doesn't have to be NULL terminated */ - wchar_t* target = PyMem_Malloc(size * sizeof(wchar_t)); - if (target == NULL) { - PyErr_NoMemory(); - return NULL; - } - - iconv_t cd = iconv_open(tocode, fromcode); - if (cd == (iconv_t)-1) { - PyErr_Format(PyExc_ValueError, "iconv_open() failed"); - PyMem_Free(target); - return NULL; - } - - char *inbuf = (char *) source; - char *outbuf = (char *) target; - size_t inbytesleft = sizeof(wchar_t) * size; - size_t outbytesleft = inbytesleft; - - size_t ret = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (ret == DECODE_ERROR) { - PyErr_Format(PyExc_ValueError, "iconv() failed"); - PyMem_Free(target); - iconv_close(cd); - return NULL; - } - - iconv_close(cd); - return target; -} - -/* Convert a wide character string to the UCS-4 encoded string. This - is necessary on systems where internal form of wchar_t are not Unicode - code points (e.g. Oracle Solaris). - - Return a pointer to a newly allocated string, use PyMem_Free() to free - the memory. Return NULL and raise exception on conversion or memory - allocation error. */ -wchar_t * -_Py_DecodeNonUnicodeWchar(const wchar_t *native, Py_ssize_t size) -{ - return _Py_ConvertWCharForm(native, size, "UCS-4-INTERNAL", "wchar_t"); -} - -/* Convert a UCS-4 encoded string to native wide character string. This - is necessary on systems where internal form of wchar_t are not Unicode - code points (e.g. Oracle Solaris). - - The conversion is done in place. This can be done because both wchar_t - and UCS-4 use 4-byte encoding, and one wchar_t symbol always correspond - to a single UCS-4 symbol and vice versa. (This is true for Oracle Solaris, - which is currently the only system using these functions; it doesn't have - to be for other systems). - - Return 0 on success. Return -1 and raise exception on conversion - or memory allocation error. */ -int -_Py_EncodeNonUnicodeWchar_InPlace(wchar_t *unicode, Py_ssize_t size) -{ - wchar_t* result = _Py_ConvertWCharForm(unicode, size, "wchar_t", "UCS-4-INTERNAL"); - if (!result) { - return -1; - } - memcpy(unicode, result, size * sizeof(wchar_t)); - PyMem_Free(result); - return 0; -} -#endif /* HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */ - +#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION + +/* Check whether current locale uses Unicode as internal wchar_t form. */ +int +_Py_LocaleUsesNonUnicodeWchar(void) +{ + /* Oracle Solaris uses non-Unicode internal wchar_t form for + non-Unicode locales and hence needs conversion to UTF first. */ + char* codeset = nl_langinfo(CODESET); + if (!codeset) { + return 0; + } + /* 646 refers to ISO/IEC 646 standard that corresponds to ASCII encoding */ + return (strcmp(codeset, "UTF-8") != 0 && strcmp(codeset, "646") != 0); +} + +static wchar_t * +_Py_ConvertWCharForm(const wchar_t *source, Py_ssize_t size, + const char *tocode, const char *fromcode) +{ + Py_BUILD_ASSERT(sizeof(wchar_t) == 4); + + /* Ensure we won't overflow the size. */ + if (size > (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t))) { + PyErr_NoMemory(); + return NULL; + } + + /* the string doesn't have to be NULL terminated */ + wchar_t* target = PyMem_Malloc(size * sizeof(wchar_t)); + if (target == NULL) { + PyErr_NoMemory(); + return NULL; + } + + iconv_t cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)-1) { + PyErr_Format(PyExc_ValueError, "iconv_open() failed"); + PyMem_Free(target); + return NULL; + } + + char *inbuf = (char *) source; + char *outbuf = (char *) target; + size_t inbytesleft = sizeof(wchar_t) * size; + size_t outbytesleft = inbytesleft; + + size_t ret = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (ret == DECODE_ERROR) { + PyErr_Format(PyExc_ValueError, "iconv() failed"); + PyMem_Free(target); + iconv_close(cd); + return NULL; + } + + iconv_close(cd); + return target; +} + +/* Convert a wide character string to the UCS-4 encoded string. This + is necessary on systems where internal form of wchar_t are not Unicode + code points (e.g. Oracle Solaris). + + Return a pointer to a newly allocated string, use PyMem_Free() to free + the memory. Return NULL and raise exception on conversion or memory + allocation error. */ +wchar_t * +_Py_DecodeNonUnicodeWchar(const wchar_t *native, Py_ssize_t size) +{ + return _Py_ConvertWCharForm(native, size, "UCS-4-INTERNAL", "wchar_t"); +} + +/* Convert a UCS-4 encoded string to native wide character string. This + is necessary on systems where internal form of wchar_t are not Unicode + code points (e.g. Oracle Solaris). + + The conversion is done in place. This can be done because both wchar_t + and UCS-4 use 4-byte encoding, and one wchar_t symbol always correspond + to a single UCS-4 symbol and vice versa. (This is true for Oracle Solaris, + which is currently the only system using these functions; it doesn't have + to be for other systems). + + Return 0 on success. Return -1 and raise exception on conversion + or memory allocation error. */ +int +_Py_EncodeNonUnicodeWchar_InPlace(wchar_t *unicode, Py_ssize_t size) +{ + wchar_t* result = _Py_ConvertWCharForm(unicode, size, "wchar_t", "UCS-4-INTERNAL"); + if (!result) { + return -1; + } + memcpy(unicode, result, size * sizeof(wchar_t)); + PyMem_Free(result); + return 0; +} +#endif /* HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */ + #ifdef MS_WINDOWS static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 and 1.1.1970 */ @@ -1026,12 +1026,12 @@ _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, FILE_TIME_to_time_t_nsec(&info->ftLastAccessTime, &result->st_atime, &result->st_atime_nsec); result->st_nlink = info->nNumberOfLinks; result->st_ino = (((uint64_t)info->nFileIndexHigh) << 32) + info->nFileIndexLow; - /* bpo-37834: Only actual symlinks set the S_IFLNK flag. But lstat() will - open other name surrogate reparse points without traversing them. To - detect/handle these, check st_file_attributes and st_reparse_tag. */ - result->st_reparse_tag = reparse_tag; - if (info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && - reparse_tag == IO_REPARSE_TAG_SYMLINK) { + /* bpo-37834: Only actual symlinks set the S_IFLNK flag. But lstat() will + open other name surrogate reparse points without traversing them. To + detect/handle these, check st_file_attributes and st_reparse_tag. */ + result->st_reparse_tag = reparse_tag; + if (info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && + reparse_tag == IO_REPARSE_TAG_SYMLINK) { /* first clear the S_IFMT bits */ result->st_mode ^= (result->st_mode & S_IFMT); /* now set the bits that make this a symlink */ @@ -1158,10 +1158,10 @@ _Py_stat(PyObject *path, struct stat *statbuf) struct _stat wstatbuf; const wchar_t *wpath; -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); -_Py_COMP_DIAG_POP +_Py_COMP_DIAG_POP if (wpath == NULL) return -2; @@ -1285,18 +1285,18 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works) flags = HANDLE_FLAG_INHERIT; else flags = 0; - - /* This check can be removed once support for Windows 7 ends. */ -#define CONSOLE_PSEUDOHANDLE(handle) (((ULONG_PTR)(handle) & 0x3) == 0x3 && \ - GetFileType(handle) == FILE_TYPE_CHAR) - - if (!CONSOLE_PSEUDOHANDLE(handle) && - !SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) { + + /* This check can be removed once support for Windows 7 ends. */ +#define CONSOLE_PSEUDOHANDLE(handle) (((ULONG_PTR)(handle) & 0x3) == 0x3 && \ + GetFileType(handle) == FILE_TYPE_CHAR) + + if (!CONSOLE_PSEUDOHANDLE(handle) && + !SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) { if (raise) PyErr_SetFromWindowsErr(0); return -1; } -#undef CONSOLE_PSEUDOHANDLE +#undef CONSOLE_PSEUDOHANDLE return 0; #else @@ -1316,14 +1316,14 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works) return 0; } -#ifdef O_PATH - if (errno == EBADF) { - // bpo-44849: On Linux and FreeBSD, ioctl(FIOCLEX) fails with EBADF - // on O_PATH file descriptors. Fall through to the fcntl() - // implementation. - } - else -#endif +#ifdef O_PATH + if (errno == EBADF) { + // bpo-44849: On Linux and FreeBSD, ioctl(FIOCLEX) fails with EBADF + // on O_PATH file descriptors. Fall through to the fcntl() + // implementation. + } + else +#endif if (errno != ENOTTY && errno != EACCES) { if (raise) PyErr_SetFromErrno(PyExc_OSError); @@ -1433,31 +1433,31 @@ _Py_open_impl(const char *pathname, int flags, int gil_held) #endif if (gil_held) { - PyObject *pathname_obj = PyUnicode_DecodeFSDefault(pathname); - if (pathname_obj == NULL) { - return -1; - } - if (PySys_Audit("open", "OOi", pathname_obj, Py_None, flags) < 0) { - Py_DECREF(pathname_obj); - return -1; - } - + PyObject *pathname_obj = PyUnicode_DecodeFSDefault(pathname); + if (pathname_obj == NULL) { + return -1; + } + if (PySys_Audit("open", "OOi", pathname_obj, Py_None, flags) < 0) { + Py_DECREF(pathname_obj); + return -1; + } + do { Py_BEGIN_ALLOW_THREADS fd = open(pathname, flags); Py_END_ALLOW_THREADS } while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); - if (async_err) { - Py_DECREF(pathname_obj); + if (async_err) { + Py_DECREF(pathname_obj); return -1; - } + } if (fd < 0) { - PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError, pathname_obj, NULL); - Py_DECREF(pathname_obj); + PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError, pathname_obj, NULL); + Py_DECREF(pathname_obj); return -1; } - Py_DECREF(pathname_obj); + Py_DECREF(pathname_obj); } else { fd = open(pathname, flags); @@ -1515,15 +1515,15 @@ FILE * _Py_wfopen(const wchar_t *path, const wchar_t *mode) { FILE *f; - if (PySys_Audit("open", "uui", path, mode, 0) < 0) { - return NULL; - } + if (PySys_Audit("open", "uui", path, mode, 0) < 0) { + return NULL; + } #ifndef MS_WINDOWS char *cpath; char cmode[10]; size_t r; r = wcstombs(cmode, mode, 10); - if (r == DECODE_ERROR || r >= 10) { + if (r == DECODE_ERROR || r >= 10) { errno = EINVAL; return NULL; } @@ -1553,16 +1553,16 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode) FILE* _Py_fopen(const char *pathname, const char *mode) { - PyObject *pathname_obj = PyUnicode_DecodeFSDefault(pathname); - if (pathname_obj == NULL) { - return NULL; - } - if (PySys_Audit("open", "Osi", pathname_obj, mode, 0) < 0) { - Py_DECREF(pathname_obj); - return NULL; - } - Py_DECREF(pathname_obj); - + PyObject *pathname_obj = PyUnicode_DecodeFSDefault(pathname); + if (pathname_obj == NULL) { + return NULL; + } + if (PySys_Audit("open", "Osi", pathname_obj, mode, 0) < 0) { + Py_DECREF(pathname_obj); + return NULL; + } + Py_DECREF(pathname_obj); + FILE *f = fopen(pathname, mode); if (f == NULL) return NULL; @@ -1598,19 +1598,19 @@ _Py_fopen_obj(PyObject *path, const char *mode) assert(PyGILState_Check()); - if (PySys_Audit("open", "Osi", path, mode, 0) < 0) { - return NULL; - } + if (PySys_Audit("open", "Osi", path, mode, 0) < 0) { + return NULL; + } if (!PyUnicode_Check(path)) { PyErr_Format(PyExc_TypeError, "str file path expected under Windows, got %R", Py_TYPE(path)); return NULL; } -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); -_Py_COMP_DIAG_POP +_Py_COMP_DIAG_POP if (wpath == NULL) return NULL; @@ -1629,7 +1629,7 @@ _Py_COMP_DIAG_POP && errno == EINTR && !(async_err = PyErr_CheckSignals())); #else PyObject *bytes; - const char *path_bytes; + const char *path_bytes; assert(PyGILState_Check()); @@ -1637,11 +1637,11 @@ _Py_COMP_DIAG_POP return NULL; path_bytes = PyBytes_AS_STRING(bytes); - if (PySys_Audit("open", "Osi", path, mode, 0) < 0) { - Py_DECREF(bytes); - return NULL; - } - + if (PySys_Audit("open", "Osi", path, mode, 0) < 0) { + Py_DECREF(bytes); + return NULL; + } + do { Py_BEGIN_ALLOW_THREADS f = fopen(path_bytes, mode); @@ -1739,22 +1739,22 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) _Py_BEGIN_SUPPRESS_IPH #ifdef MS_WINDOWS - if (count > 32767) { + if (count > 32767) { /* Issue #11395: the Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage). */ - if (gil_held) { - Py_BEGIN_ALLOW_THREADS - if (isatty(fd)) { - count = 32767; - } - Py_END_ALLOW_THREADS - } else { - if (isatty(fd)) { - count = 32767; - } - } + if (gil_held) { + Py_BEGIN_ALLOW_THREADS + if (isatty(fd)) { + count = 32767; + } + Py_END_ALLOW_THREADS + } else { + if (isatty(fd)) { + count = 32767; + } + } } #endif if (count > _PY_WRITE_MAX) { @@ -1847,18 +1847,18 @@ _Py_write_noraise(int fd, const void *buf, size_t count) #ifdef HAVE_READLINK /* Read value of symbolic link. Encode the path to the locale encoding, decode - the result from the locale encoding. + the result from the locale encoding. - Return -1 on encoding error, on readlink() error, if the internal buffer is - too short, on decoding error, or if 'buf' is too short. */ + Return -1 on encoding error, on readlink() error, if the internal buffer is + too short, on decoding error, or if 'buf' is too short. */ int -_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t buflen) +_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t buflen) { char *cpath; char cbuf[MAXPATHLEN]; - size_t cbuf_len = Py_ARRAY_LENGTH(cbuf); + size_t cbuf_len = Py_ARRAY_LENGTH(cbuf); wchar_t *wbuf; - Py_ssize_t res; + Py_ssize_t res; size_t r1; cpath = _Py_EncodeLocaleRaw(path, NULL); @@ -1866,12 +1866,12 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t buflen) errno = EINVAL; return -1; } - res = readlink(cpath, cbuf, cbuf_len); + res = readlink(cpath, cbuf, cbuf_len); PyMem_RawFree(cpath); - if (res == -1) { + if (res == -1) { return -1; - } - if ((size_t)res == cbuf_len) { + } + if ((size_t)res == cbuf_len) { errno = EINVAL; return -1; } @@ -1881,13 +1881,13 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t buflen) errno = EINVAL; return -1; } - /* wbuf must have space to store the trailing NUL character */ - if (buflen <= r1) { + /* wbuf must have space to store the trailing NUL character */ + if (buflen <= r1) { PyMem_RawFree(wbuf); errno = EINVAL; return -1; } - wcsncpy(buf, wbuf, buflen); + wcsncpy(buf, wbuf, buflen); PyMem_RawFree(wbuf); return (int)r1; } @@ -1898,11 +1898,11 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t buflen) /* Return the canonicalized absolute pathname. Encode path to the locale encoding, decode the result from the locale encoding. - Return NULL on encoding error, realpath() error, decoding error - or if 'resolved_path' is too short. */ + Return NULL on encoding error, realpath() error, decoding error + or if 'resolved_path' is too short. */ wchar_t* _Py_wrealpath(const wchar_t *path, - wchar_t *resolved_path, size_t resolved_path_len) + wchar_t *resolved_path, size_t resolved_path_len) { char *cpath; char cresolved_path[MAXPATHLEN]; @@ -1924,126 +1924,126 @@ _Py_wrealpath(const wchar_t *path, errno = EINVAL; return NULL; } - /* wresolved_path must have space to store the trailing NUL character */ - if (resolved_path_len <= r) { + /* wresolved_path must have space to store the trailing NUL character */ + if (resolved_path_len <= r) { PyMem_RawFree(wresolved_path); errno = EINVAL; return NULL; } - wcsncpy(resolved_path, wresolved_path, resolved_path_len); + wcsncpy(resolved_path, wresolved_path, resolved_path_len); PyMem_RawFree(wresolved_path); return resolved_path; } #endif - -#ifndef MS_WINDOWS -int -_Py_isabs(const wchar_t *path) -{ - return (path[0] == SEP); -} -#endif - - -/* Get an absolute path. - On error (ex: fail to get the current directory), return -1. - On memory allocation failure, set *abspath_p to NULL and return 0. - On success, return a newly allocated to *abspath_p to and return 0. - The string must be freed by PyMem_RawFree(). */ -int -_Py_abspath(const wchar_t *path, wchar_t **abspath_p) -{ -#ifdef MS_WINDOWS - wchar_t woutbuf[MAX_PATH], *woutbufp = woutbuf; - DWORD result; - - result = GetFullPathNameW(path, - Py_ARRAY_LENGTH(woutbuf), woutbuf, - NULL); - if (!result) { - return -1; - } - - if (result > Py_ARRAY_LENGTH(woutbuf)) { - if ((size_t)result <= (size_t)PY_SSIZE_T_MAX / sizeof(wchar_t)) { - woutbufp = PyMem_RawMalloc((size_t)result * sizeof(wchar_t)); - } - else { - woutbufp = NULL; - } - if (!woutbufp) { - *abspath_p = NULL; - return 0; - } - - result = GetFullPathNameW(path, result, woutbufp, NULL); - if (!result) { - PyMem_RawFree(woutbufp); - return -1; - } - } - - if (woutbufp != woutbuf) { - *abspath_p = woutbufp; - return 0; - } - - *abspath_p = _PyMem_RawWcsdup(woutbufp); - return 0; -#else - if (_Py_isabs(path)) { - *abspath_p = _PyMem_RawWcsdup(path); - return 0; - } - - wchar_t cwd[MAXPATHLEN + 1]; - cwd[Py_ARRAY_LENGTH(cwd) - 1] = 0; - if (!_Py_wgetcwd(cwd, Py_ARRAY_LENGTH(cwd) - 1)) { - /* unable to get the current directory */ - return -1; - } - - size_t cwd_len = wcslen(cwd); - size_t path_len = wcslen(path); - size_t len = cwd_len + 1 + path_len + 1; - if (len <= (size_t)PY_SSIZE_T_MAX / sizeof(wchar_t)) { - *abspath_p = PyMem_RawMalloc(len * sizeof(wchar_t)); - } - else { - *abspath_p = NULL; - } - if (*abspath_p == NULL) { - return 0; - } - - wchar_t *abspath = *abspath_p; - memcpy(abspath, cwd, cwd_len * sizeof(wchar_t)); - abspath += cwd_len; - - *abspath = (wchar_t)SEP; - abspath++; - - memcpy(abspath, path, path_len * sizeof(wchar_t)); - abspath += path_len; - - *abspath = 0; - return 0; -#endif -} - - -/* Get the current directory. buflen is the buffer size in wide characters + +#ifndef MS_WINDOWS +int +_Py_isabs(const wchar_t *path) +{ + return (path[0] == SEP); +} +#endif + + +/* Get an absolute path. + On error (ex: fail to get the current directory), return -1. + On memory allocation failure, set *abspath_p to NULL and return 0. + On success, return a newly allocated to *abspath_p to and return 0. + The string must be freed by PyMem_RawFree(). */ +int +_Py_abspath(const wchar_t *path, wchar_t **abspath_p) +{ +#ifdef MS_WINDOWS + wchar_t woutbuf[MAX_PATH], *woutbufp = woutbuf; + DWORD result; + + result = GetFullPathNameW(path, + Py_ARRAY_LENGTH(woutbuf), woutbuf, + NULL); + if (!result) { + return -1; + } + + if (result > Py_ARRAY_LENGTH(woutbuf)) { + if ((size_t)result <= (size_t)PY_SSIZE_T_MAX / sizeof(wchar_t)) { + woutbufp = PyMem_RawMalloc((size_t)result * sizeof(wchar_t)); + } + else { + woutbufp = NULL; + } + if (!woutbufp) { + *abspath_p = NULL; + return 0; + } + + result = GetFullPathNameW(path, result, woutbufp, NULL); + if (!result) { + PyMem_RawFree(woutbufp); + return -1; + } + } + + if (woutbufp != woutbuf) { + *abspath_p = woutbufp; + return 0; + } + + *abspath_p = _PyMem_RawWcsdup(woutbufp); + return 0; +#else + if (_Py_isabs(path)) { + *abspath_p = _PyMem_RawWcsdup(path); + return 0; + } + + wchar_t cwd[MAXPATHLEN + 1]; + cwd[Py_ARRAY_LENGTH(cwd) - 1] = 0; + if (!_Py_wgetcwd(cwd, Py_ARRAY_LENGTH(cwd) - 1)) { + /* unable to get the current directory */ + return -1; + } + + size_t cwd_len = wcslen(cwd); + size_t path_len = wcslen(path); + size_t len = cwd_len + 1 + path_len + 1; + if (len <= (size_t)PY_SSIZE_T_MAX / sizeof(wchar_t)) { + *abspath_p = PyMem_RawMalloc(len * sizeof(wchar_t)); + } + else { + *abspath_p = NULL; + } + if (*abspath_p == NULL) { + return 0; + } + + wchar_t *abspath = *abspath_p; + memcpy(abspath, cwd, cwd_len * sizeof(wchar_t)); + abspath += cwd_len; + + *abspath = (wchar_t)SEP; + abspath++; + + memcpy(abspath, path, path_len * sizeof(wchar_t)); + abspath += path_len; + + *abspath = 0; + return 0; +#endif +} + + +/* Get the current directory. buflen is the buffer size in wide characters including the null character. Decode the path from the locale encoding. - Return NULL on getcwd() error, on decoding error, or if 'buf' is - too short. */ + Return NULL on getcwd() error, on decoding error, or if 'buf' is + too short. */ wchar_t* -_Py_wgetcwd(wchar_t *buf, size_t buflen) +_Py_wgetcwd(wchar_t *buf, size_t buflen) { #ifdef MS_WINDOWS - int ibuflen = (int)Py_MIN(buflen, INT_MAX); - return _wgetcwd(buf, ibuflen); + int ibuflen = (int)Py_MIN(buflen, INT_MAX); + return _wgetcwd(buf, ibuflen); #else char fname[MAXPATHLEN]; wchar_t *wname; @@ -2054,12 +2054,12 @@ _Py_wgetcwd(wchar_t *buf, size_t buflen) wname = Py_DecodeLocale(fname, &len); if (wname == NULL) return NULL; - /* wname must have space to store the trailing NUL character */ - if (buflen <= len) { + /* wname must have space to store the trailing NUL character */ + if (buflen <= len) { PyMem_RawFree(wname); return NULL; } - wcsncpy(buf, wname, buflen); + wcsncpy(buf, wname, buflen); PyMem_RawFree(wname); return buf; #endif @@ -2098,11 +2098,11 @@ _Py_dup(int fd) return -1; } - if (_Py_set_inheritable(fd, 0, NULL) < 0) { - _Py_BEGIN_SUPPRESS_IPH - close(fd); - _Py_END_SUPPRESS_IPH - return -1; + if (_Py_set_inheritable(fd, 0, NULL) < 0) { + _Py_BEGIN_SUPPRESS_IPH + close(fd); + _Py_END_SUPPRESS_IPH + return -1; } #elif defined(HAVE_FCNTL_H) && defined(F_DUPFD_CLOEXEC) Py_BEGIN_ALLOW_THREADS @@ -2198,18 +2198,18 @@ error: int -_Py_GetLocaleconvNumeric(struct lconv *lc, - PyObject **decimal_point, PyObject **thousands_sep) +_Py_GetLocaleconvNumeric(struct lconv *lc, + PyObject **decimal_point, PyObject **thousands_sep) { - assert(decimal_point != NULL); - assert(thousands_sep != NULL); + assert(decimal_point != NULL); + assert(thousands_sep != NULL); -#ifndef MS_WINDOWS +#ifndef MS_WINDOWS int change_locale = 0; - if ((strlen(lc->decimal_point) > 1 || ((unsigned char)lc->decimal_point[0]) > 127)) { + if ((strlen(lc->decimal_point) > 1 || ((unsigned char)lc->decimal_point[0]) > 127)) { change_locale = 1; } - if ((strlen(lc->thousands_sep) > 1 || ((unsigned char)lc->thousands_sep[0]) > 127)) { + if ((strlen(lc->thousands_sep) > 1 || ((unsigned char)lc->thousands_sep[0]) > 127)) { change_locale = 1; } @@ -2218,8 +2218,8 @@ _Py_GetLocaleconvNumeric(struct lconv *lc, if (change_locale) { oldloc = setlocale(LC_CTYPE, NULL); if (!oldloc) { - PyErr_SetString(PyExc_RuntimeWarning, - "failed to get LC_CTYPE locale"); + PyErr_SetString(PyExc_RuntimeWarning, + "failed to get LC_CTYPE locale"); return -1; } @@ -2243,34 +2243,34 @@ _Py_GetLocaleconvNumeric(struct lconv *lc, } } -#define GET_LOCALE_STRING(ATTR) PyUnicode_DecodeLocale(lc->ATTR, NULL) -#else /* MS_WINDOWS */ -/* Use _W_* fields of Windows strcut lconv */ -#define GET_LOCALE_STRING(ATTR) PyUnicode_FromWideChar(lc->_W_ ## ATTR, -1) -#endif /* MS_WINDOWS */ - - int res = -1; - - *decimal_point = GET_LOCALE_STRING(decimal_point); - if (*decimal_point == NULL) { - goto done; +#define GET_LOCALE_STRING(ATTR) PyUnicode_DecodeLocale(lc->ATTR, NULL) +#else /* MS_WINDOWS */ +/* Use _W_* fields of Windows strcut lconv */ +#define GET_LOCALE_STRING(ATTR) PyUnicode_FromWideChar(lc->_W_ ## ATTR, -1) +#endif /* MS_WINDOWS */ + + int res = -1; + + *decimal_point = GET_LOCALE_STRING(decimal_point); + if (*decimal_point == NULL) { + goto done; } - *thousands_sep = GET_LOCALE_STRING(thousands_sep); - if (*thousands_sep == NULL) { - goto done; + *thousands_sep = GET_LOCALE_STRING(thousands_sep); + if (*thousands_sep == NULL) { + goto done; } res = 0; -done: -#ifndef MS_WINDOWS +done: +#ifndef MS_WINDOWS if (loc != NULL) { setlocale(LC_CTYPE, oldloc); } PyMem_Free(oldloc); -#endif +#endif return res; - -#undef GET_LOCALE_STRING + +#undef GET_LOCALE_STRING } diff --git a/contrib/tools/python3/src/Python/formatter_unicode.c b/contrib/tools/python3/src/Python/formatter_unicode.c index 4dbd78aa5c..e7ec4dd5cb 100644 --- a/contrib/tools/python3/src/Python/formatter_unicode.c +++ b/contrib/tools/python3/src/Python/formatter_unicode.c @@ -3,7 +3,7 @@ of int.__float__, etc., that take and return unicode objects */ #include "Python.h" -#include "pycore_fileutils.h" +#include "pycore_fileutils.h" #include <locale.h> /* Raises an exception about an unknown presentation type for this @@ -62,7 +62,7 @@ get_integer(PyObject *str, Py_ssize_t *ppos, Py_ssize_t end, Py_ssize_t accumulator, digitval, pos = *ppos; int numdigits; int kind = PyUnicode_KIND(str); - const void *data = PyUnicode_DATA(str); + const void *data = PyUnicode_DATA(str); accumulator = numdigits = 0; for (; pos < end; pos++, numdigits++) { @@ -170,7 +170,7 @@ parse_internal_render_format_spec(PyObject *format_spec, { Py_ssize_t pos = start; int kind = PyUnicode_KIND(format_spec); - const void *data = PyUnicode_DATA(format_spec); + const void *data = PyUnicode_DATA(format_spec); /* end-pos is used throughout this code to specify the length of the input string */ #define READ_spec(index) PyUnicode_READ(kind, data, index) @@ -252,10 +252,10 @@ parse_internal_render_format_spec(PyObject *format_spec, ++pos; } if (end-pos && READ_spec(pos) == ',') { - if (format->thousands_separators == LT_UNDERSCORE_LOCALE) { - invalid_comma_and_underscore(); - return 0; - } + if (format->thousands_separators == LT_UNDERSCORE_LOCALE) { + invalid_comma_and_underscore(); + return 0; + } } /* Parse field precision */ @@ -402,7 +402,7 @@ typedef struct { char *grouping_buffer; } LocaleInfo; -#define LocaleInfo_STATIC_INIT {0, 0, 0, 0} +#define LocaleInfo_STATIC_INIT {0, 0, 0, 0} /* describes the layout for an integer, see the comment in calc_number_widths() for details */ @@ -445,7 +445,7 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, { Py_ssize_t remainder; int kind = PyUnicode_KIND(s); - const void *data = PyUnicode_DATA(s); + const void *data = PyUnicode_DATA(s); while (pos<end && Py_ISDIGIT(PyUnicode_READ(kind, data, pos))) ++pos; @@ -468,7 +468,7 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, Return -1 on error. */ static Py_ssize_t calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, - Py_UCS4 sign_char, Py_ssize_t n_start, + Py_UCS4 sign_char, Py_ssize_t n_start, Py_ssize_t n_end, Py_ssize_t n_remainder, int has_decimal, const LocaleInfo *locale, const InternalFormatSpec *format, Py_UCS4 *maxchar) @@ -576,7 +576,7 @@ calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, spec->n_lpadding = n_padding; break; default: - /* Shouldn't get here */ + /* Shouldn't get here */ Py_UNREACHABLE(); } } @@ -592,12 +592,12 @@ calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, spec->n_remainder + spec->n_rpadding; } -/* Fill in the digit parts of a number's string representation, +/* Fill in the digit parts of a number's string representation, as determined in calc_number_widths(). Return -1 on error, or 0 on success. */ static int fill_number(_PyUnicodeWriter *writer, const NumberFieldWidths *spec, - PyObject *digits, Py_ssize_t d_start, + PyObject *digits, Py_ssize_t d_start, PyObject *prefix, Py_ssize_t p_start, Py_UCS4 fill_char, LocaleInfo *locale, int toupper) @@ -701,17 +701,17 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info) { switch (type) { case LT_CURRENT_LOCALE: { - struct lconv *lc = localeconv(); - if (_Py_GetLocaleconvNumeric(lc, - &locale_info->decimal_point, - &locale_info->thousands_sep) < 0) { + struct lconv *lc = localeconv(); + if (_Py_GetLocaleconvNumeric(lc, + &locale_info->decimal_point, + &locale_info->thousands_sep) < 0) { return -1; } /* localeconv() grouping can become a dangling pointer or point to a different string if another thread calls localeconv() during the string formatting. Copy the string to avoid this risk. */ - locale_info->grouping_buffer = _PyMem_Strdup(lc->grouping); + locale_info->grouping_buffer = _PyMem_Strdup(lc->grouping); if (locale_info->grouping_buffer == NULL) { PyErr_NoMemory(); return -1; @@ -773,14 +773,14 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format, /* sign is not allowed on strings */ if (format->sign != '\0') { - if (format->sign == ' ') { - PyErr_SetString(PyExc_ValueError, - "Space not allowed in string format specifier"); - } - else { - PyErr_SetString(PyExc_ValueError, - "Sign not allowed in string format specifier"); - } + if (format->sign == ' ') { + PyErr_SetString(PyExc_ValueError, + "Space not allowed in string format specifier"); + } + else { + PyErr_SetString(PyExc_ValueError, + "Sign not allowed in string format specifier"); + } goto done; } @@ -869,7 +869,7 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = LocaleInfo_STATIC_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; /* no precision allowed on integers */ if (format->precision != -1) { @@ -991,7 +991,7 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, goto done; /* Calculate how much memory we'll need. */ - n_total = calc_number_widths(&spec, n_prefix, sign_char, inumeric_chars, + n_total = calc_number_widths(&spec, n_prefix, sign_char, inumeric_chars, inumeric_chars + n_digits, n_remainder, 0, &locale, format, &maxchar); if (n_total == -1) { @@ -1004,7 +1004,7 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, /* Populate the memory. */ result = fill_number(writer, &spec, - tmp, inumeric_chars, + tmp, inumeric_chars, tmp, prefix, format->fill_char, &locale, format->type == 'X'); @@ -1044,7 +1044,7 @@ format_float_internal(PyObject *value, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = LocaleInfo_STATIC_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; if (format->precision > INT_MAX) { PyErr_SetString(PyExc_ValueError, "precision too big"); @@ -1139,7 +1139,7 @@ format_float_internal(PyObject *value, goto done; /* Calculate how much memory we'll need. */ - n_total = calc_number_widths(&spec, 0, sign_char, index, + n_total = calc_number_widths(&spec, 0, sign_char, index, index + n_digits, n_remainder, has_decimal, &locale, format, &maxchar); if (n_total == -1) { @@ -1152,7 +1152,7 @@ format_float_internal(PyObject *value, /* Populate the memory. */ result = fill_number(writer, &spec, - unicode_tmp, index, + unicode_tmp, index, NULL, 0, format->fill_char, &locale, 0); @@ -1210,7 +1210,7 @@ format_complex_internal(PyObject *value, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = LocaleInfo_STATIC_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; if (format->precision > INT_MAX) { PyErr_SetString(PyExc_ValueError, "precision too big"); @@ -1324,7 +1324,7 @@ format_complex_internal(PyObject *value, tmp_format.width = -1; /* Calculate how much memory we'll need. */ - n_re_total = calc_number_widths(&re_spec, 0, re_sign_char, + n_re_total = calc_number_widths(&re_spec, 0, re_sign_char, i_re, i_re + n_re_digits, n_re_remainder, re_has_decimal, &locale, &tmp_format, &maxchar); @@ -1337,7 +1337,7 @@ format_complex_internal(PyObject *value, * requested by the original format. */ if (!skip_re) tmp_format.sign = '+'; - n_im_total = calc_number_widths(&im_spec, 0, im_sign_char, + n_im_total = calc_number_widths(&im_spec, 0, im_sign_char, i_im, i_im + n_im_digits, n_im_remainder, im_has_decimal, &locale, &tmp_format, &maxchar); @@ -1374,7 +1374,7 @@ format_complex_internal(PyObject *value, if (!skip_re) { result = fill_number(writer, &re_spec, - re_unicode_tmp, i_re, + re_unicode_tmp, i_re, NULL, 0, 0, &locale, 0); @@ -1382,7 +1382,7 @@ format_complex_internal(PyObject *value, goto done; } result = fill_number(writer, &im_spec, - im_unicode_tmp, i_im, + im_unicode_tmp, i_im, NULL, 0, 0, &locale, 0); @@ -1455,7 +1455,7 @@ _PyUnicode_FormatAdvancedWriter(_PyUnicodeWriter *writer, return format_string_internal(obj, &format, writer); default: /* unknown */ - unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); + unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); return -1; } } @@ -1466,7 +1466,7 @@ _PyLong_FormatAdvancedWriter(_PyUnicodeWriter *writer, PyObject *format_spec, Py_ssize_t start, Py_ssize_t end) { - PyObject *tmp = NULL; + PyObject *tmp = NULL; InternalFormatSpec format; int result = -1; @@ -1513,7 +1513,7 @@ _PyLong_FormatAdvancedWriter(_PyUnicodeWriter *writer, default: /* unknown */ - unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); + unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); goto done; } @@ -1556,7 +1556,7 @@ _PyFloat_FormatAdvancedWriter(_PyUnicodeWriter *writer, default: /* unknown */ - unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); + unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); return -1; } } @@ -1594,7 +1594,7 @@ _PyComplex_FormatAdvancedWriter(_PyUnicodeWriter *writer, default: /* unknown */ - unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); + unknown_presentation_type(format.type, Py_TYPE(obj)->tp_name); return -1; } } diff --git a/contrib/tools/python3/src/Python/frozen.c b/contrib/tools/python3/src/Python/frozen.c index 91572fdfac..228a11019c 100644 --- a/contrib/tools/python3/src/Python/frozen.c +++ b/contrib/tools/python3/src/Python/frozen.c @@ -4,7 +4,7 @@ #include "Python.h" #include "importlib.h" #include "importlib_external.h" -#include "importlib_zipimport.h" +#include "importlib_zipimport.h" /* In order to test the support for frozen modules, by default we define a single frozen module, __hello__. Loading it will print @@ -15,27 +15,27 @@ the appropriate bytes from M___main__.c. */ static unsigned char M___hello__[] = { - 227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,64,0,0,0,115,16,0,0,0,100,0, - 90,0,101,1,100,1,131,1,1,0,100,2,83,0,41,3, - 84,122,12,72,101,108,108,111,32,119,111,114,108,100,33,78, - 41,2,218,11,105,110,105,116,105,97,108,105,122,101,100,218, - 5,112,114,105,110,116,169,0,114,3,0,0,0,114,3,0, - 0,0,250,20,84,111,111,108,115,47,102,114,101,101,122,101, - 47,102,108,97,103,46,112,121,218,8,60,109,111,100,117,108, - 101,62,1,0,0,0,115,2,0,0,0,4,1, + 227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,64,0,0,0,115,16,0,0,0,100,0, + 90,0,101,1,100,1,131,1,1,0,100,2,83,0,41,3, + 84,122,12,72,101,108,108,111,32,119,111,114,108,100,33,78, + 41,2,218,11,105,110,105,116,105,97,108,105,122,101,100,218, + 5,112,114,105,110,116,169,0,114,3,0,0,0,114,3,0, + 0,0,250,20,84,111,111,108,115,47,102,114,101,101,122,101, + 47,102,108,97,103,46,112,121,218,8,60,109,111,100,117,108, + 101,62,1,0,0,0,115,2,0,0,0,4,1, }; #define SIZE (int)sizeof(M___hello__) static const struct _frozen _PyImport_FrozenModules[] = { /* importlib */ - {"_frozen_importlib", _Py_M__importlib_bootstrap, - (int)sizeof(_Py_M__importlib_bootstrap)}, - {"_frozen_importlib_external", _Py_M__importlib_bootstrap_external, - (int)sizeof(_Py_M__importlib_bootstrap_external)}, - {"zipimport", _Py_M__zipimport, - (int)sizeof(_Py_M__zipimport)}, + {"_frozen_importlib", _Py_M__importlib_bootstrap, + (int)sizeof(_Py_M__importlib_bootstrap)}, + {"_frozen_importlib_external", _Py_M__importlib_bootstrap_external, + (int)sizeof(_Py_M__importlib_bootstrap_external)}, + {"zipimport", _Py_M__zipimport, + (int)sizeof(_Py_M__zipimport)}, /* Test module */ {"__hello__", M___hello__, SIZE}, /* Test package (negative size indicates package-ness) */ diff --git a/contrib/tools/python3/src/Python/frozenmain.c b/contrib/tools/python3/src/Python/frozenmain.c index 738f72a9cb..dd04d609d2 100644 --- a/contrib/tools/python3/src/Python/frozenmain.c +++ b/contrib/tools/python3/src/Python/frozenmain.c @@ -2,7 +2,7 @@ /* Python interpreter main program for frozen scripts */ #include "Python.h" -#include "pycore_runtime.h" // _PyRuntime_Initialize() +#include "pycore_runtime.h" // _PyRuntime_Initialize() #include <locale.h> #ifdef MS_WINDOWS @@ -16,9 +16,9 @@ extern int PyInitFrozenExtensions(void); int Py_FrozenMain(int argc, char **argv) { - PyStatus status = _PyRuntime_Initialize(); - if (PyStatus_Exception(status)) { - Py_ExitStatusException(status); + PyStatus status = _PyRuntime_Initialize(); + if (PyStatus_Exception(status)) { + Py_ExitStatusException(status); } const char *p; @@ -39,9 +39,9 @@ Py_FrozenMain(int argc, char **argv) } } - PyConfig config; - PyConfig_InitPythonConfig(&config); - config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */ + PyConfig config; + PyConfig_InitPythonConfig(&config); + config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */ if ((p = Py_GETENV("PYTHONINSPECT")) && *p != '\0') inspect = 1; @@ -80,13 +80,13 @@ Py_FrozenMain(int argc, char **argv) #endif /* MS_WINDOWS */ if (argc >= 1) Py_SetProgramName(argv_copy[0]); - - status = Py_InitializeFromConfig(&config); - PyConfig_Clear(&config); - if (PyStatus_Exception(status)) { - Py_ExitStatusException(status); - } - + + status = Py_InitializeFromConfig(&config); + PyConfig_Clear(&config); + if (PyStatus_Exception(status)) { + Py_ExitStatusException(status); + } + #ifdef MS_WINDOWS PyWinFreeze_ExeInit(); #endif @@ -99,7 +99,7 @@ Py_FrozenMain(int argc, char **argv) n = PyImport_ImportFrozenModule("__main__"); if (n == 0) - Py_FatalError("the __main__ module is not frozen"); + Py_FatalError("the __main__ module is not frozen"); if (n < 0) { PyErr_Print(); sts = 1; diff --git a/contrib/tools/python3/src/Python/future.c b/contrib/tools/python3/src/Python/future.c index 9b4ef0c4d1..1663a38a6f 100644 --- a/contrib/tools/python3/src/Python/future.c +++ b/contrib/tools/python3/src/Python/future.c @@ -5,7 +5,7 @@ #include "graminit.h" #include "code.h" #include "symtable.h" -#include "ast.h" +#include "ast.h" #define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined" #define ERR_LATE_FUTURE \ @@ -48,12 +48,12 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename) } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, "not a chance"); - PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset + 1); + PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset + 1); return 0; } else { PyErr_Format(PyExc_SyntaxError, UNDEFINED_FUTURE_FEATURE, feature); - PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset + 1); + PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset + 1); return 0; } } @@ -80,7 +80,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename) */ i = 0; - if (_PyAST_GetDocString(mod->v.Module.body) != NULL) + if (_PyAST_GetDocString(mod->v.Module.body) != NULL) i++; for (; i < asdl_seq_LEN(mod->v.Module.body); i++) { diff --git a/contrib/tools/python3/src/Python/getargs.c b/contrib/tools/python3/src/Python/getargs.c index 2362fbbc56..d4a531a5ef 100644 --- a/contrib/tools/python3/src/Python/getargs.c +++ b/contrib/tools/python3/src/Python/getargs.c @@ -2,7 +2,7 @@ /* New getargs implementation */ #include "Python.h" -#include "pycore_tupleobject.h" +#include "pycore_tupleobject.h" #include <ctype.h> #include <float.h> @@ -106,7 +106,7 @@ PyArg_Parse(PyObject *args, const char *format, ...) return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_Parse_SizeT(PyObject *args, const char *format, ...) { int retval; @@ -131,7 +131,7 @@ PyArg_ParseTuple(PyObject *args, const char *format, ...) return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseTuple_SizeT(PyObject *args, const char *format, ...) { int retval; @@ -156,7 +156,7 @@ _PyArg_ParseStack(PyObject *const *args, Py_ssize_t nargs, const char *format, . return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseStack_SizeT(PyObject *const *args, Py_ssize_t nargs, const char *format, ...) { int retval; @@ -182,7 +182,7 @@ PyArg_VaParse(PyObject *args, const char *format, va_list va) return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_VaParse_SizeT(PyObject *args, const char *format, va_list va) { va_list lva; @@ -312,7 +312,7 @@ vgetargs1_impl(PyObject *compat_args, PyObject *const *stack, Py_ssize_t nargs, break; default: if (level == 0) { - if (Py_ISALPHA(c)) + if (Py_ISALPHA(c)) if (c != 'e') /* skip encoded */ max++; } @@ -372,14 +372,14 @@ vgetargs1_impl(PyObject *compat_args, PyObject *const *stack, Py_ssize_t nargs, if (nargs < min || max < nargs) { if (message == NULL) PyErr_Format(PyExc_TypeError, - "%.150s%s takes %s %d argument%s (%zd given)", + "%.150s%s takes %s %d argument%s (%zd given)", fname==NULL ? "function" : fname, fname==NULL ? "" : "()", min==max ? "exactly" : nargs < min ? "at least" : "at most", nargs < min ? min : max, (nargs < min ? min : max) == 1 ? "" : "s", - nargs); + nargs); else PyErr_SetString(PyExc_TypeError, message); return cleanreturn(0, &freelist); @@ -397,7 +397,7 @@ vgetargs1_impl(PyObject *compat_args, PyObject *const *stack, Py_ssize_t nargs, } } - if (*format != '\0' && !Py_ISALPHA(*format) && + if (*format != '\0' && !Py_ISALPHA(*format) && *format != '(' && *format != '|' && *format != ':' && *format != ';') { PyErr_Format(PyExc_SystemError, @@ -423,7 +423,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) return 0; } - stack = _PyTuple_ITEMS(args); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); } else { @@ -521,7 +521,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags, } else if (c == ':' || c == ';' || c == '\0') break; - else if (level == 0 && Py_ISALPHA(c)) + else if (level == 0 && Py_ISALPHA(c)) n++; } @@ -531,7 +531,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags, toplevel ? "expected %d arguments, not %.50s" : "must be %d-item sequence, not %.50s", n, - arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); return msgbuf; } @@ -540,10 +540,10 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags, levels[0] = 0; if (toplevel) { PyOS_snprintf(msgbuf, bufsize, - "expected %d argument%s, not %" PY_FORMAT_SIZE_T "d", - n, - n == 1 ? "" : "s", - len); + "expected %d argument%s, not %" PY_FORMAT_SIZE_T "d", + n, + n == 1 ? "" : "s", + len); } else { PyOS_snprintf(msgbuf, bufsize, @@ -610,20 +610,20 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, -/* Format an error message generated by convertsimple(). - displayname must be UTF-8 encoded. -*/ +/* Format an error message generated by convertsimple(). + displayname must be UTF-8 encoded. +*/ + +void +_PyArg_BadArgument(const char *fname, const char *displayname, + const char *expected, PyObject *arg) +{ + PyErr_Format(PyExc_TypeError, + "%.200s() %.200s must be %.50s, not %.50s", + fname, displayname, expected, + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); +} -void -_PyArg_BadArgument(const char *fname, const char *displayname, - const char *expected, PyObject *arg) -{ - PyErr_Format(PyExc_TypeError, - "%.200s() %.200s must be %.50s, not %.50s", - fname, displayname, expected, - arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); -} - static const char * converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize) { @@ -636,7 +636,7 @@ converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize) else { PyOS_snprintf(msgbuf, bufsize, "must be %.50s, not %.50s", expected, - arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); } return msgbuf; } @@ -644,9 +644,9 @@ converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize) #define CONV_UNICODE "(unicode conversion error)" /* Explicitly check for float arguments when integers are expected. - Return 1 for error, 0 if ok. - XXX Should be removed after the end of the deprecation period in - _PyLong_FromNbIndexOrNbInt. */ + Return 1 for error, 0 if ok. + XXX Should be removed after the end of the deprecation period in + _PyLong_FromNbIndexOrNbInt. */ static int float_argument_error(PyObject *arg) { @@ -675,13 +675,13 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* For # codes */ #define FETCH_SIZE int *q=NULL;Py_ssize_t *q2=NULL;\ if (flags & FLAG_SIZE_T) q2=va_arg(*p_va, Py_ssize_t*); \ - else { \ - if (PyErr_WarnEx(PyExc_DeprecationWarning, \ - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { \ - return NULL; \ - } \ - q=va_arg(*p_va, int*); \ - } + else { \ + if (PyErr_WarnEx(PyExc_DeprecationWarning, \ + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { \ + return NULL; \ + } \ + q=va_arg(*p_va, int*); \ + } #define STORE_SIZE(s) \ if (flags & FLAG_SIZE_T) \ *q2=s; \ @@ -881,7 +881,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'f': {/* float */ float *p = va_arg(*p_va, float *); double dval = PyFloat_AsDouble(arg); - if (dval == -1.0 && PyErr_Occurred()) + if (dval == -1.0 && PyErr_Occurred()) RETURN_ERR_OCCURRED; else *p = (float) dval; @@ -891,7 +891,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'd': {/* double */ double *p = va_arg(*p_va, double *); double dval = PyFloat_AsDouble(arg); - if (dval == -1.0 && PyErr_Occurred()) + if (dval == -1.0 && PyErr_Occurred()) RETURN_ERR_OCCURRED; else *p = dval; @@ -923,7 +923,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'C': {/* unicode char */ int *p = va_arg(*p_va, int *); int kind; - const void *data; + const void *data; if (!PyUnicode_Check(arg)) return converterr("a unicode character", arg, msgbuf, bufsize); @@ -1070,9 +1070,9 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'u': /* raw unicode buffer (Py_UNICODE *) */ case 'Z': /* raw unicode buffer or None */ { - // TODO: Raise DeprecationWarning -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS + // TODO: Raise DeprecationWarning +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); if (*format == '#') { @@ -1112,7 +1112,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS arg, msgbuf, bufsize); } break; -_Py_COMP_DIAG_POP +_Py_COMP_DIAG_POP } case 'e': {/* encoded string */ @@ -1203,19 +1203,19 @@ _Py_COMP_DIAG_POP trailing 0-byte */ - int *q = NULL; Py_ssize_t *q2 = NULL; - if (flags & FLAG_SIZE_T) { - q2 = va_arg(*p_va, Py_ssize_t*); - } - else { - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) - { - Py_DECREF(s); - return NULL; - } - q = va_arg(*p_va, int*); - } + int *q = NULL; Py_ssize_t *q2 = NULL; + if (flags & FLAG_SIZE_T) { + q2 = va_arg(*p_va, Py_ssize_t*); + } + else { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) + { + Py_DECREF(s); + return NULL; + } + q = va_arg(*p_va, int*); + } format++; if (q == NULL && q2 == NULL) { @@ -1248,19 +1248,19 @@ _Py_COMP_DIAG_POP } } memcpy(*buffer, ptr, size+1); - - if (flags & FLAG_SIZE_T) { - *q2 = size; - } - else { - if (INT_MAX < size) { - Py_DECREF(s); - PyErr_SetString(PyExc_OverflowError, - "size does not fit in an int"); - return converterr("", arg, msgbuf, bufsize); - } - *q = (int)size; - } + + if (flags & FLAG_SIZE_T) { + *q2 = size; + } + else { + if (INT_MAX < size) { + Py_DECREF(s); + PyErr_SetString(PyExc_OverflowError, + "size does not fit in an int"); + return converterr("", arg, msgbuf, bufsize); + } + *q = (int)size; + } } else { /* Using a 0-terminated buffer: @@ -1335,7 +1335,7 @@ _Py_COMP_DIAG_POP type = va_arg(*p_va, PyTypeObject*); p = va_arg(*p_va, PyObject **); format++; - if (PyType_IsSubtype(Py_TYPE(arg), type)) + if (PyType_IsSubtype(Py_TYPE(arg), type)) *p = arg; else return converterr(type->tp_name, arg, msgbuf, bufsize); @@ -1470,7 +1470,7 @@ PyArg_ParseTupleAndKeywords(PyObject *args, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywords_SizeT(PyObject *args, PyObject *keywords, const char *format, @@ -1521,7 +1521,7 @@ PyArg_VaParseTupleAndKeywords(PyObject *args, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args, PyObject *keywords, const char *format, @@ -1547,7 +1547,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords, struct _PyArg_Parser *parser, ...) { @@ -1560,7 +1560,7 @@ _PyArg_ParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords, struct _PyArg_Parser *parser, ...) { @@ -1573,7 +1573,7 @@ _PyArg_ParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames, struct _PyArg_Parser *parser, ...) { @@ -1586,7 +1586,7 @@ _PyArg_ParseStackAndKeywords(PyObject *const *args, Py_ssize_t nargs, PyObject * return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords_SizeT(PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames, struct _PyArg_Parser *parser, ...) { @@ -1600,7 +1600,7 @@ _PyArg_ParseStackAndKeywords_SizeT(PyObject *const *args, Py_ssize_t nargs, PyOb } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords, struct _PyArg_Parser *parser, va_list va) { @@ -1614,7 +1614,7 @@ _PyArg_VaParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords, return retval; } -PyAPI_FUNC(int) +PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords, struct _PyArg_Parser *parser, va_list va) { @@ -1768,14 +1768,14 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, } else { PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s" - " (%zd given)", + "%.200s%s takes %s %d positional argument%s" + " (%zd given)", (fname == NULL) ? "function" : fname, (fname == NULL) ? "" : "()", (min != INT_MAX) ? "at most" : "exactly", - max, - max == 1 ? "" : "s", - nargs); + max, + max == 1 ? "" : "s", + nargs); } return cleanreturn(0, &freelist); } @@ -1791,13 +1791,13 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, current_arg = PyTuple_GET_ITEM(args, i); } else if (nkwargs && i >= pos) { - current_arg = _PyDict_GetItemStringWithError(kwargs, kwlist[i]); - if (current_arg) { + current_arg = _PyDict_GetItemStringWithError(kwargs, kwlist[i]); + if (current_arg) { --nkwargs; - } - else if (PyErr_Occurred()) { - return cleanreturn(0, &freelist); - } + } + else if (PyErr_Occurred()) { + return cleanreturn(0, &freelist); + } } else { current_arg = NULL; @@ -1853,14 +1853,14 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, if (skip) { PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s" - " (%zd given)", + "%.200s%s takes %s %d positional argument%s" + " (%zd given)", (fname == NULL) ? "function" : fname, (fname == NULL) ? "" : "()", (Py_MIN(pos, min) < i) ? "at least" : "exactly", - Py_MIN(pos, min), - Py_MIN(pos, min) == 1 ? "" : "s", - nargs); + Py_MIN(pos, min), + Py_MIN(pos, min) == 1 ? "" : "s", + nargs); return cleanreturn(0, &freelist); } @@ -1876,7 +1876,7 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, Py_ssize_t j; /* make sure there are no arguments given by name and position */ for (i = pos; i < nargs; i++) { - current_arg = _PyDict_GetItemStringWithError(kwargs, kwlist[i]); + current_arg = _PyDict_GetItemStringWithError(kwargs, kwlist[i]); if (current_arg) { /* arg present in tuple and in dict */ PyErr_Format(PyExc_TypeError, @@ -1887,9 +1887,9 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format, kwlist[i], i+1); return cleanreturn(0, &freelist); } - else if (PyErr_Occurred()) { - return cleanreturn(0, &freelist); - } + else if (PyErr_Occurred()) { + return cleanreturn(0, &freelist); + } } /* make sure there are no extraneous keyword arguments */ j = 0; @@ -1954,70 +1954,70 @@ parser_init(struct _PyArg_Parser *parser) len = i; format = parser->format; - if (format) { - /* grab the function name or custom error msg first (mutually exclusive) */ - parser->fname = strchr(parser->format, ':'); - if (parser->fname) { - parser->fname++; - parser->custom_msg = NULL; - } - else { - parser->custom_msg = strchr(parser->format,';'); - if (parser->custom_msg) - parser->custom_msg++; - } - - min = max = INT_MAX; - for (i = 0; i < len; i++) { - if (*format == '|') { - if (min != INT_MAX) { - PyErr_SetString(PyExc_SystemError, - "Invalid format string (| specified twice)"); - return 0; - } - if (max != INT_MAX) { - PyErr_SetString(PyExc_SystemError, - "Invalid format string ($ before |)"); - return 0; - } - min = i; - format++; - } - if (*format == '$') { - if (max != INT_MAX) { - PyErr_SetString(PyExc_SystemError, - "Invalid format string ($ specified twice)"); - return 0; - } - if (i < parser->pos) { - PyErr_SetString(PyExc_SystemError, - "Empty parameter name after $"); - return 0; - } - max = i; - format++; - } - if (IS_END_OF_FORMAT(*format)) { - PyErr_Format(PyExc_SystemError, - "More keyword list entries (%d) than " - "format specifiers (%d)", len, i); + if (format) { + /* grab the function name or custom error msg first (mutually exclusive) */ + parser->fname = strchr(parser->format, ':'); + if (parser->fname) { + parser->fname++; + parser->custom_msg = NULL; + } + else { + parser->custom_msg = strchr(parser->format,';'); + if (parser->custom_msg) + parser->custom_msg++; + } + + min = max = INT_MAX; + for (i = 0; i < len; i++) { + if (*format == '|') { + if (min != INT_MAX) { + PyErr_SetString(PyExc_SystemError, + "Invalid format string (| specified twice)"); + return 0; + } + if (max != INT_MAX) { + PyErr_SetString(PyExc_SystemError, + "Invalid format string ($ before |)"); + return 0; + } + min = i; + format++; + } + if (*format == '$') { + if (max != INT_MAX) { + PyErr_SetString(PyExc_SystemError, + "Invalid format string ($ specified twice)"); + return 0; + } + if (i < parser->pos) { + PyErr_SetString(PyExc_SystemError, + "Empty parameter name after $"); + return 0; + } + max = i; + format++; + } + if (IS_END_OF_FORMAT(*format)) { + PyErr_Format(PyExc_SystemError, + "More keyword list entries (%d) than " + "format specifiers (%d)", len, i); return 0; } - - msg = skipitem(&format, NULL, 0); - if (msg) { - PyErr_Format(PyExc_SystemError, "%s: '%s'", msg, - format); + + msg = skipitem(&format, NULL, 0); + if (msg) { + PyErr_Format(PyExc_SystemError, "%s: '%s'", msg, + format); return 0; } } - parser->min = Py_MIN(min, len); - parser->max = Py_MIN(max, len); - - if (!IS_END_OF_FORMAT(*format) && (*format != '|') && (*format != '$')) { + parser->min = Py_MIN(min, len); + parser->max = Py_MIN(max, len); + + if (!IS_END_OF_FORMAT(*format) && (*format != '|') && (*format != '$')) { PyErr_Format(PyExc_SystemError, - "more argument specifiers than keyword list entries " - "(remaining format:'%s')", format); + "more argument specifiers than keyword list entries " + "(remaining format:'%s')", format); return 0; } } @@ -2052,24 +2052,24 @@ parser_clear(struct _PyArg_Parser *parser) } static PyObject* -find_keyword(PyObject *kwnames, PyObject *const *kwstack, PyObject *key) +find_keyword(PyObject *kwnames, PyObject *const *kwstack, PyObject *key) { Py_ssize_t i, nkwargs; nkwargs = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < nkwargs; i++) { + for (i = 0; i < nkwargs; i++) { PyObject *kwname = PyTuple_GET_ITEM(kwnames, i); - /* kwname == key will normally find a match in since keyword keys - should be interned strings; if not retry below in a new loop. */ + /* kwname == key will normally find a match in since keyword keys + should be interned strings; if not retry below in a new loop. */ if (kwname == key) { return kwstack[i]; } - } - - for (i = 0; i < nkwargs; i++) { - PyObject *kwname = PyTuple_GET_ITEM(kwnames, i); - assert(PyUnicode_Check(kwname)); + } + + for (i = 0; i < nkwargs; i++) { + PyObject *kwname = PyTuple_GET_ITEM(kwnames, i); + assert(PyUnicode_Check(kwname)); if (_PyUnicode_EQ(kwname, key)) { return kwstack[i]; } @@ -2163,13 +2163,13 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs, } else { PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s (%zd given)", + "%.200s%s takes %s %d positional argument%s (%zd given)", (parser->fname == NULL) ? "function" : parser->fname, (parser->fname == NULL) ? "" : "()", - (parser->min < parser->max) ? "at most" : "exactly", - parser->max, - parser->max == 1 ? "" : "s", - nargs); + (parser->min < parser->max) ? "at most" : "exactly", + parser->max, + parser->max == 1 ? "" : "s", + nargs); } return cleanreturn(0, &freelist); } @@ -2190,18 +2190,18 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs, } else if (nkwargs && i >= pos) { keyword = PyTuple_GET_ITEM(kwtuple, i - pos); - if (kwargs != NULL) { - current_arg = PyDict_GetItemWithError(kwargs, keyword); - if (!current_arg && PyErr_Occurred()) { - return cleanreturn(0, &freelist); - } - } - else { - current_arg = find_keyword(kwnames, kwstack, keyword); - } - if (current_arg) { + if (kwargs != NULL) { + current_arg = PyDict_GetItemWithError(kwargs, keyword); + if (!current_arg && PyErr_Occurred()) { + return cleanreturn(0, &freelist); + } + } + else { + current_arg = find_keyword(kwnames, kwstack, keyword); + } + if (current_arg) { --nkwargs; - } + } } else { current_arg = NULL; @@ -2222,14 +2222,14 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs, if (i < pos) { Py_ssize_t min = Py_MIN(pos, parser->min); PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s" - " (%zd given)", + "%.200s%s takes %s %d positional argument%s" + " (%zd given)", (parser->fname == NULL) ? "function" : parser->fname, (parser->fname == NULL) ? "" : "()", min < parser->max ? "at least" : "exactly", - min, - min == 1 ? "" : "s", - nargs); + min, + min == 1 ? "" : "s", + nargs); } else { keyword = PyTuple_GET_ITEM(kwtuple, i - pos); @@ -2262,15 +2262,15 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs, /* make sure there are no arguments given by name and position */ for (i = pos; i < nargs; i++) { keyword = PyTuple_GET_ITEM(kwtuple, i - pos); - if (kwargs != NULL) { - current_arg = PyDict_GetItemWithError(kwargs, keyword); - if (!current_arg && PyErr_Occurred()) { - return cleanreturn(0, &freelist); - } - } - else { - current_arg = find_keyword(kwnames, kwstack, keyword); - } + if (kwargs != NULL) { + current_arg = PyDict_GetItemWithError(kwargs, keyword); + if (!current_arg && PyErr_Occurred()) { + return cleanreturn(0, &freelist); + } + } + else { + current_arg = find_keyword(kwnames, kwstack, keyword); + } if (current_arg) { /* arg present in tuple and in dict */ PyErr_Format(PyExc_TypeError, @@ -2301,7 +2301,7 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs, if (match <= 0) { if (!match) { PyErr_Format(PyExc_TypeError, - "'%S' is an invalid keyword " + "'%S' is an invalid keyword " "argument for %.200s%s", keyword, (parser->fname == NULL) ? "this function" : parser->fname, @@ -2330,217 +2330,217 @@ vgetargskeywordsfast(PyObject *args, PyObject *keywords, return 0; } - stack = _PyTuple_ITEMS(args); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); return vgetargskeywordsfast_impl(stack, nargs, keywords, NULL, parser, p_va, flags); } -#undef _PyArg_UnpackKeywords - -PyObject * const * -_PyArg_UnpackKeywords(PyObject *const *args, Py_ssize_t nargs, - PyObject *kwargs, PyObject *kwnames, - struct _PyArg_Parser *parser, - int minpos, int maxpos, int minkw, - PyObject **buf) -{ - PyObject *kwtuple; - PyObject *keyword; - int i, posonly, minposonly, maxargs; - int reqlimit = minkw ? maxpos + minkw : minpos; - Py_ssize_t nkwargs; - PyObject *current_arg; - PyObject * const *kwstack = NULL; - - assert(kwargs == NULL || PyDict_Check(kwargs)); - assert(kwargs == NULL || kwnames == NULL); - - if (parser == NULL) { - PyErr_BadInternalCall(); - return NULL; - } - - if (kwnames != NULL && !PyTuple_Check(kwnames)) { - PyErr_BadInternalCall(); - return NULL; - } - - if (args == NULL && nargs == 0) { - args = buf; - } - - if (!parser_init(parser)) { - return NULL; - } - - kwtuple = parser->kwtuple; - posonly = parser->pos; - minposonly = Py_MIN(posonly, minpos); - maxargs = posonly + (int)PyTuple_GET_SIZE(kwtuple); - - if (kwargs != NULL) { - nkwargs = PyDict_GET_SIZE(kwargs); - } - else if (kwnames != NULL) { - nkwargs = PyTuple_GET_SIZE(kwnames); - kwstack = args + nargs; - } - else { - nkwargs = 0; - } - if (nkwargs == 0 && minkw == 0 && minpos <= nargs && nargs <= maxpos) { - /* Fast path. */ - return args; - } - if (nargs + nkwargs > maxargs) { - /* Adding "keyword" (when nargs == 0) prevents producing wrong error - messages in some special cases (see bpo-31229). */ - PyErr_Format(PyExc_TypeError, - "%.200s%s takes at most %d %sargument%s (%zd given)", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()", - maxargs, - (nargs == 0) ? "keyword " : "", - (maxargs == 1) ? "" : "s", - nargs + nkwargs); - return NULL; - } - if (nargs > maxpos) { - if (maxpos == 0) { - PyErr_Format(PyExc_TypeError, - "%.200s%s takes no positional arguments", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()"); - } - else { - PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s (%zd given)", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()", - (minpos < maxpos) ? "at most" : "exactly", - maxpos, - (maxpos == 1) ? "" : "s", - nargs); - } - return NULL; - } - if (nargs < minposonly) { - PyErr_Format(PyExc_TypeError, - "%.200s%s takes %s %d positional argument%s" - " (%zd given)", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()", - minposonly < maxpos ? "at least" : "exactly", - minposonly, - minposonly == 1 ? "" : "s", - nargs); - return NULL; - } - - /* copy tuple args */ - for (i = 0; i < nargs; i++) { - buf[i] = args[i]; - } - - /* copy keyword args using kwtuple to drive process */ - for (i = Py_MAX((int)nargs, posonly); i < maxargs; i++) { - if (nkwargs) { - keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); - if (kwargs != NULL) { - current_arg = PyDict_GetItemWithError(kwargs, keyword); - if (!current_arg && PyErr_Occurred()) { - return NULL; - } - } - else { - current_arg = find_keyword(kwnames, kwstack, keyword); - } - } - else if (i >= reqlimit) { - break; - } - else { - current_arg = NULL; - } - - buf[i] = current_arg; - - if (current_arg) { - --nkwargs; - } - else if (i < minpos || (maxpos <= i && i < reqlimit)) { - /* Less arguments than required */ - keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); - PyErr_Format(PyExc_TypeError, "%.200s%s missing required " - "argument '%U' (pos %d)", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()", - keyword, i+1); - return NULL; - } - } - - if (nkwargs > 0) { - Py_ssize_t j; - /* make sure there are no arguments given by name and position */ - for (i = posonly; i < nargs; i++) { - keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); - if (kwargs != NULL) { - current_arg = PyDict_GetItemWithError(kwargs, keyword); - if (!current_arg && PyErr_Occurred()) { - return NULL; - } - } - else { - current_arg = find_keyword(kwnames, kwstack, keyword); - } - if (current_arg) { - /* arg present in tuple and in dict */ - PyErr_Format(PyExc_TypeError, - "argument for %.200s%s given by name ('%U') " - "and position (%d)", - (parser->fname == NULL) ? "function" : parser->fname, - (parser->fname == NULL) ? "" : "()", - keyword, i+1); - return NULL; - } - } - /* make sure there are no extraneous keyword arguments */ - j = 0; - while (1) { - int match; - if (kwargs != NULL) { - if (!PyDict_Next(kwargs, &j, &keyword, NULL)) - break; - } - else { - if (j >= PyTuple_GET_SIZE(kwnames)) - break; - keyword = PyTuple_GET_ITEM(kwnames, j); - j++; - } - - match = PySequence_Contains(kwtuple, keyword); - if (match <= 0) { - if (!match) { - PyErr_Format(PyExc_TypeError, - "'%S' is an invalid keyword " - "argument for %.200s%s", - keyword, - (parser->fname == NULL) ? "this function" : parser->fname, - (parser->fname == NULL) ? "" : "()"); - } - return NULL; - } - } - } - - return buf; -} - - +#undef _PyArg_UnpackKeywords + +PyObject * const * +_PyArg_UnpackKeywords(PyObject *const *args, Py_ssize_t nargs, + PyObject *kwargs, PyObject *kwnames, + struct _PyArg_Parser *parser, + int minpos, int maxpos, int minkw, + PyObject **buf) +{ + PyObject *kwtuple; + PyObject *keyword; + int i, posonly, minposonly, maxargs; + int reqlimit = minkw ? maxpos + minkw : minpos; + Py_ssize_t nkwargs; + PyObject *current_arg; + PyObject * const *kwstack = NULL; + + assert(kwargs == NULL || PyDict_Check(kwargs)); + assert(kwargs == NULL || kwnames == NULL); + + if (parser == NULL) { + PyErr_BadInternalCall(); + return NULL; + } + + if (kwnames != NULL && !PyTuple_Check(kwnames)) { + PyErr_BadInternalCall(); + return NULL; + } + + if (args == NULL && nargs == 0) { + args = buf; + } + + if (!parser_init(parser)) { + return NULL; + } + + kwtuple = parser->kwtuple; + posonly = parser->pos; + minposonly = Py_MIN(posonly, minpos); + maxargs = posonly + (int)PyTuple_GET_SIZE(kwtuple); + + if (kwargs != NULL) { + nkwargs = PyDict_GET_SIZE(kwargs); + } + else if (kwnames != NULL) { + nkwargs = PyTuple_GET_SIZE(kwnames); + kwstack = args + nargs; + } + else { + nkwargs = 0; + } + if (nkwargs == 0 && minkw == 0 && minpos <= nargs && nargs <= maxpos) { + /* Fast path. */ + return args; + } + if (nargs + nkwargs > maxargs) { + /* Adding "keyword" (when nargs == 0) prevents producing wrong error + messages in some special cases (see bpo-31229). */ + PyErr_Format(PyExc_TypeError, + "%.200s%s takes at most %d %sargument%s (%zd given)", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()", + maxargs, + (nargs == 0) ? "keyword " : "", + (maxargs == 1) ? "" : "s", + nargs + nkwargs); + return NULL; + } + if (nargs > maxpos) { + if (maxpos == 0) { + PyErr_Format(PyExc_TypeError, + "%.200s%s takes no positional arguments", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()"); + } + else { + PyErr_Format(PyExc_TypeError, + "%.200s%s takes %s %d positional argument%s (%zd given)", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()", + (minpos < maxpos) ? "at most" : "exactly", + maxpos, + (maxpos == 1) ? "" : "s", + nargs); + } + return NULL; + } + if (nargs < minposonly) { + PyErr_Format(PyExc_TypeError, + "%.200s%s takes %s %d positional argument%s" + " (%zd given)", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()", + minposonly < maxpos ? "at least" : "exactly", + minposonly, + minposonly == 1 ? "" : "s", + nargs); + return NULL; + } + + /* copy tuple args */ + for (i = 0; i < nargs; i++) { + buf[i] = args[i]; + } + + /* copy keyword args using kwtuple to drive process */ + for (i = Py_MAX((int)nargs, posonly); i < maxargs; i++) { + if (nkwargs) { + keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); + if (kwargs != NULL) { + current_arg = PyDict_GetItemWithError(kwargs, keyword); + if (!current_arg && PyErr_Occurred()) { + return NULL; + } + } + else { + current_arg = find_keyword(kwnames, kwstack, keyword); + } + } + else if (i >= reqlimit) { + break; + } + else { + current_arg = NULL; + } + + buf[i] = current_arg; + + if (current_arg) { + --nkwargs; + } + else if (i < minpos || (maxpos <= i && i < reqlimit)) { + /* Less arguments than required */ + keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); + PyErr_Format(PyExc_TypeError, "%.200s%s missing required " + "argument '%U' (pos %d)", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()", + keyword, i+1); + return NULL; + } + } + + if (nkwargs > 0) { + Py_ssize_t j; + /* make sure there are no arguments given by name and position */ + for (i = posonly; i < nargs; i++) { + keyword = PyTuple_GET_ITEM(kwtuple, i - posonly); + if (kwargs != NULL) { + current_arg = PyDict_GetItemWithError(kwargs, keyword); + if (!current_arg && PyErr_Occurred()) { + return NULL; + } + } + else { + current_arg = find_keyword(kwnames, kwstack, keyword); + } + if (current_arg) { + /* arg present in tuple and in dict */ + PyErr_Format(PyExc_TypeError, + "argument for %.200s%s given by name ('%U') " + "and position (%d)", + (parser->fname == NULL) ? "function" : parser->fname, + (parser->fname == NULL) ? "" : "()", + keyword, i+1); + return NULL; + } + } + /* make sure there are no extraneous keyword arguments */ + j = 0; + while (1) { + int match; + if (kwargs != NULL) { + if (!PyDict_Next(kwargs, &j, &keyword, NULL)) + break; + } + else { + if (j >= PyTuple_GET_SIZE(kwnames)) + break; + keyword = PyTuple_GET_ITEM(kwnames, j); + j++; + } + + match = PySequence_Contains(kwtuple, keyword); + if (match <= 0) { + if (!match) { + PyErr_Format(PyExc_TypeError, + "'%S' is an invalid keyword " + "argument for %.200s%s", + keyword, + (parser->fname == NULL) ? "this function" : parser->fname, + (parser->fname == NULL) ? "" : "()"); + } + return NULL; + } + } + } + + return buf; +} + + static const char * skipitem(const char **p_format, va_list *p_va, int flags) { @@ -2609,13 +2609,13 @@ skipitem(const char **p_format, va_list *p_va, int flags) if (p_va != NULL) { if (flags & FLAG_SIZE_T) (void) va_arg(*p_va, Py_ssize_t *); - else { - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { - return NULL; - } + else { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { + return NULL; + } (void) va_arg(*p_va, int *); - } + } } format++; } else if ((c == 's' || c == 'z' || c == 'y' || c == 'w') @@ -2682,11 +2682,11 @@ err: } -#undef _PyArg_CheckPositional - -int -_PyArg_CheckPositional(const char *name, Py_ssize_t nargs, - Py_ssize_t min, Py_ssize_t max) +#undef _PyArg_CheckPositional + +int +_PyArg_CheckPositional(const char *name, Py_ssize_t nargs, + Py_ssize_t min, Py_ssize_t max) { assert(min >= 0); assert(min <= max); @@ -2695,14 +2695,14 @@ _PyArg_CheckPositional(const char *name, Py_ssize_t nargs, if (name != NULL) PyErr_Format( PyExc_TypeError, - "%.200s expected %s%zd argument%s, got %zd", - name, (min == max ? "" : "at least "), min, min == 1 ? "" : "s", nargs); + "%.200s expected %s%zd argument%s, got %zd", + name, (min == max ? "" : "at least "), min, min == 1 ? "" : "s", nargs); else PyErr_Format( PyExc_TypeError, - "unpacked tuple should have %s%zd element%s," + "unpacked tuple should have %s%zd element%s," " but has %zd", - (min == max ? "" : "at least "), min, min == 1 ? "" : "s", nargs); + (min == max ? "" : "at least "), min, min == 1 ? "" : "s", nargs); return 0; } @@ -2714,31 +2714,31 @@ _PyArg_CheckPositional(const char *name, Py_ssize_t nargs, if (name != NULL) PyErr_Format( PyExc_TypeError, - "%.200s expected %s%zd argument%s, got %zd", - name, (min == max ? "" : "at most "), max, max == 1 ? "" : "s", nargs); + "%.200s expected %s%zd argument%s, got %zd", + name, (min == max ? "" : "at most "), max, max == 1 ? "" : "s", nargs); else PyErr_Format( PyExc_TypeError, - "unpacked tuple should have %s%zd element%s," + "unpacked tuple should have %s%zd element%s," " but has %zd", - (min == max ? "" : "at most "), max, max == 1 ? "" : "s", nargs); + (min == max ? "" : "at most "), max, max == 1 ? "" : "s", nargs); + return 0; + } + + return 1; +} + +static int +unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name, + Py_ssize_t min, Py_ssize_t max, va_list vargs) +{ + Py_ssize_t i; + PyObject **o; + + if (!_PyArg_CheckPositional(name, nargs, min, max)) { return 0; } - return 1; -} - -static int -unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name, - Py_ssize_t min, Py_ssize_t max, va_list vargs) -{ - Py_ssize_t i; - PyObject **o; - - if (!_PyArg_CheckPositional(name, nargs, min, max)) { - return 0; - } - for (i = 0; i < nargs; i++) { o = va_arg(vargs, PyObject **); *o = args[i]; @@ -2759,7 +2759,7 @@ PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t m "PyArg_UnpackTuple() argument list is not a tuple"); return 0; } - stack = _PyTuple_ITEMS(args); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); #ifdef HAVE_STDARG_PROTOTYPES @@ -2791,7 +2791,7 @@ _PyArg_UnpackStack(PyObject *const *args, Py_ssize_t nargs, const char *name, #undef _PyArg_NoKeywords -#undef _PyArg_NoKwnames +#undef _PyArg_NoKwnames #undef _PyArg_NoPositional /* For type constructors that don't take keyword args @@ -2835,23 +2835,23 @@ _PyArg_NoPositional(const char *funcname, PyObject *args) return 0; } -int -_PyArg_NoKwnames(const char *funcname, PyObject *kwnames) -{ - if (kwnames == NULL) { - return 1; - } - - assert(PyTuple_CheckExact(kwnames)); - - if (PyTuple_GET_SIZE(kwnames) == 0) { - return 1; - } - - PyErr_Format(PyExc_TypeError, "%s() takes no keyword arguments", funcname); - return 0; -} - +int +_PyArg_NoKwnames(const char *funcname, PyObject *kwnames) +{ + if (kwnames == NULL) { + return 1; + } + + assert(PyTuple_CheckExact(kwnames)); + + if (PyTuple_GET_SIZE(kwnames) == 0) { + return 1; + } + + PyErr_Format(PyExc_TypeError, "%s() takes no keyword arguments", funcname); + return 0; +} + void _PyArg_Fini(void) { diff --git a/contrib/tools/python3/src/Python/getcopyright.c b/contrib/tools/python3/src/Python/getcopyright.c index 8317fcde70..88d1d05362 100644 --- a/contrib/tools/python3/src/Python/getcopyright.c +++ b/contrib/tools/python3/src/Python/getcopyright.c @@ -4,7 +4,7 @@ static const char cprt[] = "\ -Copyright (c) 2001-2022 Python Software Foundation.\n\ +Copyright (c) 2001-2022 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ diff --git a/contrib/tools/python3/src/Python/getopt.c b/contrib/tools/python3/src/Python/getopt.c index 650ae089c3..2e3891aae2 100644 --- a/contrib/tools/python3/src/Python/getopt.c +++ b/contrib/tools/python3/src/Python/getopt.c @@ -27,28 +27,28 @@ #include <stdio.h> #include <string.h> #include <wchar.h> -#include "pycore_getopt.h" +#include "pycore_getopt.h" #ifdef __cplusplus extern "C" { #endif -int _PyOS_opterr = 1; /* generate error messages */ -Py_ssize_t _PyOS_optind = 1; /* index into argv array */ -const wchar_t *_PyOS_optarg = NULL; /* optional argument */ - -static const wchar_t *opt_ptr = L""; - -/* Python command line short and long options */ - -#define SHORT_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?" - -static const _PyOS_LongOption longopts[] = { - {L"check-hash-based-pycs", 1, 0}, - {NULL, 0, 0}, -}; - - +int _PyOS_opterr = 1; /* generate error messages */ +Py_ssize_t _PyOS_optind = 1; /* index into argv array */ +const wchar_t *_PyOS_optarg = NULL; /* optional argument */ + +static const wchar_t *opt_ptr = L""; + +/* Python command line short and long options */ + +#define SHORT_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?" + +static const _PyOS_LongOption longopts[] = { + {L"check-hash-based-pycs", 1, 0}, + {NULL, 0, 0}, +}; + + void _PyOS_ResetGetOpt(void) { _PyOS_opterr = 1; @@ -57,7 +57,7 @@ void _PyOS_ResetGetOpt(void) opt_ptr = L""; } -int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) +int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) { wchar_t *ptr; wchar_t option; @@ -101,9 +101,9 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) if (option == L'-') { // Parse long option. if (*opt_ptr == L'\0') { - if (_PyOS_opterr) { - fprintf(stderr, "expected long option\n"); - } + if (_PyOS_opterr) { + fprintf(stderr, "expected long option\n"); + } return -1; } *longindex = 0; @@ -113,9 +113,9 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) break; } if (!opt->name) { - if (_PyOS_opterr) { - fprintf(stderr, "unknown option %ls\n", argv[_PyOS_optind - 1]); - } + if (_PyOS_opterr) { + fprintf(stderr, "unknown option %ls\n", argv[_PyOS_optind - 1]); + } return '_'; } opt_ptr = L""; @@ -123,10 +123,10 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) return opt->val; } if (_PyOS_optind >= argc) { - if (_PyOS_opterr) { - fprintf(stderr, "Argument expected for the %ls options\n", - argv[_PyOS_optind - 1]); - } + if (_PyOS_opterr) { + fprintf(stderr, "Argument expected for the %ls options\n", + argv[_PyOS_optind - 1]); + } return '_'; } _PyOS_optarg = argv[_PyOS_optind++]; @@ -134,16 +134,16 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) } if (option == 'J') { - if (_PyOS_opterr) { + if (_PyOS_opterr) { fprintf(stderr, "-J is reserved for Jython\n"); - } + } return '_'; } - if ((ptr = wcschr(SHORT_OPTS, option)) == NULL) { - if (_PyOS_opterr) { + if ((ptr = wcschr(SHORT_OPTS, option)) == NULL) { + if (_PyOS_opterr) { fprintf(stderr, "Unknown option: -%c\n", (char)option); - } + } return '_'; } @@ -155,10 +155,10 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex) else { if (_PyOS_optind >= argc) { - if (_PyOS_opterr) { + if (_PyOS_opterr) { fprintf(stderr, "Argument expected for the -%c option\n", (char)option); - } + } return '_'; } diff --git a/contrib/tools/python3/src/Python/graminit.c b/contrib/tools/python3/src/Python/graminit.c index db6f9395e7..b7aa52895f 100644 --- a/contrib/tools/python3/src/Python/graminit.c +++ b/contrib/tools/python3/src/Python/graminit.c @@ -1,17 +1,17 @@ /* Generated by Parser/pgen */ -#include "exports.h" +#include "exports.h" #include "grammar.h" -Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; -static const arc arcs_0_0[3] = { +Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; +static const arc arcs_0_0[3] = { {2, 1}, - {3, 2}, - {4, 1}, + {3, 2}, + {4, 1}, }; -static const arc arcs_0_1[1] = { +static const arc arcs_0_1[1] = { {0, 1}, }; -static const arc arcs_0_2[1] = { +static const arc arcs_0_2[1] = { {2, 1}, }; static state states_0[3] = { @@ -19,26 +19,26 @@ static state states_0[3] = { {1, arcs_0_1}, {1, arcs_0_2}, }; -static const arc arcs_1_0[3] = { - {44, 1}, +static const arc arcs_1_0[3] = { + {44, 1}, {2, 0}, - {45, 0}, + {45, 0}, }; -static const arc arcs_1_1[1] = { +static const arc arcs_1_1[1] = { {0, 1}, }; static state states_1[2] = { {3, arcs_1_0}, {1, arcs_1_1}, }; -static const arc arcs_2_0[1] = { - {47, 1}, +static const arc arcs_2_0[1] = { + {47, 1}, }; -static const arc arcs_2_1[2] = { - {44, 2}, +static const arc arcs_2_1[2] = { + {44, 2}, {2, 1}, }; -static const arc arcs_2_2[1] = { +static const arc arcs_2_2[1] = { {0, 2}, }; static state states_2[3] = { @@ -46,44 +46,44 @@ static state states_2[3] = { {2, arcs_2_1}, {1, arcs_2_2}, }; -static const arc arcs_3_0[1] = { - {10, 1}, +static const arc arcs_3_0[1] = { + {10, 1}, }; -static const arc arcs_3_1[1] = { - {49, 2}, +static const arc arcs_3_1[1] = { + {49, 2}, }; -static const arc arcs_3_2[1] = { - {2, 3}, +static const arc arcs_3_2[1] = { + {2, 3}, }; -static const arc arcs_3_3[1] = { - {0, 3}, +static const arc arcs_3_3[1] = { + {0, 3}, }; -static state states_3[4] = { +static state states_3[4] = { {1, arcs_3_0}, {1, arcs_3_1}, - {1, arcs_3_2}, - {1, arcs_3_3}, + {1, arcs_3_2}, + {1, arcs_3_3}, }; -static const arc arcs_4_0[1] = { - {48, 1}, +static const arc arcs_4_0[1] = { + {48, 1}, }; -static const arc arcs_4_1[2] = { - {48, 1}, +static const arc arcs_4_1[2] = { + {48, 1}, {0, 1}, }; static state states_4[2] = { {1, arcs_4_0}, {2, arcs_4_1}, }; -static const arc arcs_5_0[1] = { - {50, 1}, +static const arc arcs_5_0[1] = { + {50, 1}, }; -static const arc arcs_5_1[3] = { - {52, 2}, - {53, 2}, - {54, 2}, +static const arc arcs_5_1[3] = { + {52, 2}, + {53, 2}, + {54, 2}, }; -static const arc arcs_5_2[1] = { +static const arc arcs_5_2[1] = { {0, 2}, }; static state states_5[3] = { @@ -91,13 +91,13 @@ static state states_5[3] = { {3, arcs_5_1}, {1, arcs_5_2}, }; -static const arc arcs_6_0[1] = { - {38, 1}, +static const arc arcs_6_0[1] = { + {38, 1}, }; -static const arc arcs_6_1[1] = { - {54, 2}, +static const arc arcs_6_1[1] = { + {54, 2}, }; -static const arc arcs_6_2[1] = { +static const arc arcs_6_2[1] = { {0, 2}, }; static state states_6[3] = { @@ -105,58 +105,58 @@ static state states_6[3] = { {1, arcs_6_1}, {1, arcs_6_2}, }; -static const arc arcs_7_0[1] = { - {19, 1}, +static const arc arcs_7_0[1] = { + {19, 1}, }; -static const arc arcs_7_1[1] = { - {40, 2}, +static const arc arcs_7_1[1] = { + {40, 2}, }; -static const arc arcs_7_2[1] = { - {55, 3}, +static const arc arcs_7_2[1] = { + {55, 3}, }; -static const arc arcs_7_3[2] = { - {56, 4}, - {57, 5}, +static const arc arcs_7_3[2] = { + {56, 4}, + {57, 5}, }; -static const arc arcs_7_4[1] = { - {58, 6}, +static const arc arcs_7_4[1] = { + {58, 6}, }; -static const arc arcs_7_5[2] = { - {59, 7}, - {60, 8}, +static const arc arcs_7_5[2] = { + {59, 7}, + {60, 8}, }; -static const arc arcs_7_6[1] = { - {57, 5}, +static const arc arcs_7_6[1] = { + {57, 5}, }; -static const arc arcs_7_7[1] = { - {60, 8}, +static const arc arcs_7_7[1] = { + {60, 8}, }; -static const arc arcs_7_8[1] = { - {0, 8}, -}; -static state states_7[9] = { +static const arc arcs_7_8[1] = { + {0, 8}, +}; +static state states_7[9] = { {1, arcs_7_0}, {1, arcs_7_1}, {1, arcs_7_2}, {2, arcs_7_3}, {1, arcs_7_4}, - {2, arcs_7_5}, + {2, arcs_7_5}, {1, arcs_7_6}, {1, arcs_7_7}, - {1, arcs_7_8}, + {1, arcs_7_8}, }; -static const arc arcs_8_0[1] = { - {5, 1}, +static const arc arcs_8_0[1] = { + {5, 1}, }; -static const arc arcs_8_1[2] = { - {61, 2}, - {62, 3}, +static const arc arcs_8_1[2] = { + {61, 2}, + {62, 3}, }; -static const arc arcs_8_2[1] = { - {0, 2}, +static const arc arcs_8_2[1] = { + {0, 2}, }; -static const arc arcs_8_3[1] = { - {61, 2}, +static const arc arcs_8_3[1] = { + {61, 2}, }; static state states_8[4] = { {1, arcs_8_0}, @@ -164,275 +164,275 @@ static state states_8[4] = { {1, arcs_8_2}, {1, arcs_8_3}, }; -static const arc arcs_9_0[3] = { - {6, 1}, - {63, 2}, - {64, 3}, +static const arc arcs_9_0[3] = { + {6, 1}, + {63, 2}, + {64, 3}, }; -static const arc arcs_9_1[4] = { - {65, 4}, - {59, 5}, - {64, 6}, +static const arc arcs_9_1[4] = { + {65, 4}, + {59, 5}, + {64, 6}, {0, 1}, }; -static const arc arcs_9_2[1] = { - {64, 7}, +static const arc arcs_9_2[1] = { + {64, 7}, }; -static const arc arcs_9_3[4] = { - {65, 8}, - {66, 9}, - {59, 5}, - {0, 3}, +static const arc arcs_9_3[4] = { + {65, 8}, + {66, 9}, + {59, 5}, + {0, 3}, }; -static const arc arcs_9_4[4] = { - {63, 2}, - {59, 10}, - {64, 11}, - {0, 4}, +static const arc arcs_9_4[4] = { + {63, 2}, + {59, 10}, + {64, 11}, + {0, 4}, }; -static const arc arcs_9_5[1] = { +static const arc arcs_9_5[1] = { {0, 5}, }; -static const arc arcs_9_6[3] = { - {65, 4}, - {59, 5}, +static const arc arcs_9_6[3] = { + {65, 4}, + {59, 5}, {0, 6}, }; -static const arc arcs_9_7[3] = { - {65, 12}, - {59, 5}, +static const arc arcs_9_7[3] = { + {65, 12}, + {59, 5}, {0, 7}, }; -static const arc arcs_9_8[6] = { - {6, 13}, - {63, 2}, - {67, 14}, - {59, 15}, - {64, 3}, +static const arc arcs_9_8[6] = { + {6, 13}, + {63, 2}, + {67, 14}, + {59, 15}, + {64, 3}, {0, 8}, }; -static const arc arcs_9_9[1] = { - {58, 16}, +static const arc arcs_9_9[1] = { + {58, 16}, }; -static const arc arcs_9_10[3] = { - {63, 2}, - {64, 11}, +static const arc arcs_9_10[3] = { + {63, 2}, + {64, 11}, {0, 10}, }; -static const arc arcs_9_11[4] = { - {65, 4}, - {66, 17}, - {59, 5}, +static const arc arcs_9_11[4] = { + {65, 4}, + {66, 17}, + {59, 5}, {0, 11}, }; -static const arc arcs_9_12[2] = { - {59, 5}, +static const arc arcs_9_12[2] = { + {59, 5}, {0, 12}, }; -static const arc arcs_9_13[4] = { - {65, 18}, - {59, 5}, - {64, 19}, +static const arc arcs_9_13[4] = { + {65, 18}, + {59, 5}, + {64, 19}, {0, 13}, }; -static const arc arcs_9_14[2] = { - {65, 20}, +static const arc arcs_9_14[2] = { + {65, 20}, {0, 14}, }; -static const arc arcs_9_15[5] = { - {6, 13}, - {63, 2}, - {67, 14}, - {64, 3}, +static const arc arcs_9_15[5] = { + {6, 13}, + {63, 2}, + {67, 14}, + {64, 3}, {0, 15}, }; -static const arc arcs_9_16[3] = { - {65, 8}, - {59, 5}, - {0, 16}, -}; -static const arc arcs_9_17[1] = { - {58, 6}, -}; -static const arc arcs_9_18[4] = { - {63, 2}, - {59, 21}, - {64, 22}, - {0, 18}, -}; -static const arc arcs_9_19[3] = { - {65, 18}, - {59, 5}, - {0, 19}, -}; -static const arc arcs_9_20[5] = { - {6, 23}, - {63, 2}, - {59, 24}, - {64, 25}, - {0, 20}, -}; -static const arc arcs_9_21[3] = { - {63, 2}, - {64, 22}, - {0, 21}, -}; -static const arc arcs_9_22[4] = { - {65, 18}, - {66, 26}, - {59, 5}, - {0, 22}, -}; -static const arc arcs_9_23[4] = { - {65, 27}, - {59, 5}, - {64, 28}, - {0, 23}, -}; -static const arc arcs_9_24[1] = { - {64, 25}, -}; -static const arc arcs_9_25[4] = { - {65, 29}, - {66, 30}, - {59, 5}, - {0, 25}, -}; -static const arc arcs_9_26[1] = { - {58, 19}, -}; -static const arc arcs_9_27[4] = { - {63, 2}, - {59, 31}, - {64, 32}, - {0, 27}, -}; -static const arc arcs_9_28[3] = { - {65, 27}, - {59, 5}, - {0, 28}, -}; -static const arc arcs_9_29[5] = { - {6, 33}, - {63, 2}, - {59, 34}, - {64, 25}, - {0, 29}, -}; -static const arc arcs_9_30[1] = { - {58, 35}, -}; -static const arc arcs_9_31[3] = { - {63, 2}, - {64, 32}, - {0, 31}, -}; -static const arc arcs_9_32[4] = { - {65, 27}, - {66, 36}, - {59, 5}, - {0, 32}, -}; -static const arc arcs_9_33[4] = { - {65, 37}, - {59, 5}, - {64, 38}, - {0, 33}, -}; -static const arc arcs_9_34[4] = { - {6, 33}, - {63, 2}, - {64, 25}, - {0, 34}, -}; -static const arc arcs_9_35[3] = { - {65, 29}, - {59, 5}, - {0, 35}, -}; -static const arc arcs_9_36[1] = { - {58, 28}, -}; -static const arc arcs_9_37[4] = { - {63, 2}, - {59, 39}, - {64, 40}, - {0, 37}, -}; -static const arc arcs_9_38[3] = { - {65, 37}, - {59, 5}, - {0, 38}, -}; -static const arc arcs_9_39[3] = { - {63, 2}, - {64, 40}, - {0, 39}, -}; -static const arc arcs_9_40[4] = { - {65, 37}, - {66, 41}, - {59, 5}, - {0, 40}, -}; -static const arc arcs_9_41[1] = { - {58, 38}, -}; -static state states_9[42] = { +static const arc arcs_9_16[3] = { + {65, 8}, + {59, 5}, + {0, 16}, +}; +static const arc arcs_9_17[1] = { + {58, 6}, +}; +static const arc arcs_9_18[4] = { + {63, 2}, + {59, 21}, + {64, 22}, + {0, 18}, +}; +static const arc arcs_9_19[3] = { + {65, 18}, + {59, 5}, + {0, 19}, +}; +static const arc arcs_9_20[5] = { + {6, 23}, + {63, 2}, + {59, 24}, + {64, 25}, + {0, 20}, +}; +static const arc arcs_9_21[3] = { + {63, 2}, + {64, 22}, + {0, 21}, +}; +static const arc arcs_9_22[4] = { + {65, 18}, + {66, 26}, + {59, 5}, + {0, 22}, +}; +static const arc arcs_9_23[4] = { + {65, 27}, + {59, 5}, + {64, 28}, + {0, 23}, +}; +static const arc arcs_9_24[1] = { + {64, 25}, +}; +static const arc arcs_9_25[4] = { + {65, 29}, + {66, 30}, + {59, 5}, + {0, 25}, +}; +static const arc arcs_9_26[1] = { + {58, 19}, +}; +static const arc arcs_9_27[4] = { + {63, 2}, + {59, 31}, + {64, 32}, + {0, 27}, +}; +static const arc arcs_9_28[3] = { + {65, 27}, + {59, 5}, + {0, 28}, +}; +static const arc arcs_9_29[5] = { + {6, 33}, + {63, 2}, + {59, 34}, + {64, 25}, + {0, 29}, +}; +static const arc arcs_9_30[1] = { + {58, 35}, +}; +static const arc arcs_9_31[3] = { + {63, 2}, + {64, 32}, + {0, 31}, +}; +static const arc arcs_9_32[4] = { + {65, 27}, + {66, 36}, + {59, 5}, + {0, 32}, +}; +static const arc arcs_9_33[4] = { + {65, 37}, + {59, 5}, + {64, 38}, + {0, 33}, +}; +static const arc arcs_9_34[4] = { + {6, 33}, + {63, 2}, + {64, 25}, + {0, 34}, +}; +static const arc arcs_9_35[3] = { + {65, 29}, + {59, 5}, + {0, 35}, +}; +static const arc arcs_9_36[1] = { + {58, 28}, +}; +static const arc arcs_9_37[4] = { + {63, 2}, + {59, 39}, + {64, 40}, + {0, 37}, +}; +static const arc arcs_9_38[3] = { + {65, 37}, + {59, 5}, + {0, 38}, +}; +static const arc arcs_9_39[3] = { + {63, 2}, + {64, 40}, + {0, 39}, +}; +static const arc arcs_9_40[4] = { + {65, 37}, + {66, 41}, + {59, 5}, + {0, 40}, +}; +static const arc arcs_9_41[1] = { + {58, 38}, +}; +static state states_9[42] = { {3, arcs_9_0}, - {4, arcs_9_1}, - {1, arcs_9_2}, - {4, arcs_9_3}, - {4, arcs_9_4}, - {1, arcs_9_5}, - {3, arcs_9_6}, + {4, arcs_9_1}, + {1, arcs_9_2}, + {4, arcs_9_3}, + {4, arcs_9_4}, + {1, arcs_9_5}, + {3, arcs_9_6}, {3, arcs_9_7}, - {6, arcs_9_8}, - {1, arcs_9_9}, + {6, arcs_9_8}, + {1, arcs_9_9}, {3, arcs_9_10}, - {4, arcs_9_11}, - {2, arcs_9_12}, - {4, arcs_9_13}, + {4, arcs_9_11}, + {2, arcs_9_12}, + {4, arcs_9_13}, {2, arcs_9_14}, - {5, arcs_9_15}, - {3, arcs_9_16}, - {1, arcs_9_17}, - {4, arcs_9_18}, - {3, arcs_9_19}, - {5, arcs_9_20}, - {3, arcs_9_21}, - {4, arcs_9_22}, - {4, arcs_9_23}, - {1, arcs_9_24}, - {4, arcs_9_25}, - {1, arcs_9_26}, - {4, arcs_9_27}, - {3, arcs_9_28}, - {5, arcs_9_29}, - {1, arcs_9_30}, - {3, arcs_9_31}, - {4, arcs_9_32}, - {4, arcs_9_33}, - {4, arcs_9_34}, - {3, arcs_9_35}, - {1, arcs_9_36}, - {4, arcs_9_37}, - {3, arcs_9_38}, - {3, arcs_9_39}, - {4, arcs_9_40}, - {1, arcs_9_41}, -}; -static const arc arcs_10_0[1] = { - {40, 1}, -}; -static const arc arcs_10_1[2] = { - {57, 2}, + {5, arcs_9_15}, + {3, arcs_9_16}, + {1, arcs_9_17}, + {4, arcs_9_18}, + {3, arcs_9_19}, + {5, arcs_9_20}, + {3, arcs_9_21}, + {4, arcs_9_22}, + {4, arcs_9_23}, + {1, arcs_9_24}, + {4, arcs_9_25}, + {1, arcs_9_26}, + {4, arcs_9_27}, + {3, arcs_9_28}, + {5, arcs_9_29}, + {1, arcs_9_30}, + {3, arcs_9_31}, + {4, arcs_9_32}, + {4, arcs_9_33}, + {4, arcs_9_34}, + {3, arcs_9_35}, + {1, arcs_9_36}, + {4, arcs_9_37}, + {3, arcs_9_38}, + {3, arcs_9_39}, + {4, arcs_9_40}, + {1, arcs_9_41}, +}; +static const arc arcs_10_0[1] = { + {40, 1}, +}; +static const arc arcs_10_1[2] = { + {57, 2}, {0, 1}, }; -static const arc arcs_10_2[1] = { - {58, 3}, +static const arc arcs_10_2[1] = { + {58, 3}, }; -static const arc arcs_10_3[1] = { +static const arc arcs_10_3[1] = { {0, 3}, }; static state states_10[4] = { @@ -441,225 +441,225 @@ static state states_10[4] = { {1, arcs_10_2}, {1, arcs_10_3}, }; -static const arc arcs_11_0[3] = { - {6, 1}, - {63, 2}, - {69, 3}, +static const arc arcs_11_0[3] = { + {6, 1}, + {63, 2}, + {69, 3}, }; -static const arc arcs_11_1[3] = { - {65, 4}, - {69, 5}, +static const arc arcs_11_1[3] = { + {65, 4}, + {69, 5}, {0, 1}, }; -static const arc arcs_11_2[1] = { - {69, 6}, +static const arc arcs_11_2[1] = { + {69, 6}, }; -static const arc arcs_11_3[3] = { - {65, 7}, - {66, 8}, - {0, 3}, +static const arc arcs_11_3[3] = { + {65, 7}, + {66, 8}, + {0, 3}, }; -static const arc arcs_11_4[3] = { - {63, 2}, - {69, 9}, - {0, 4}, +static const arc arcs_11_4[3] = { + {63, 2}, + {69, 9}, + {0, 4}, }; -static const arc arcs_11_5[2] = { - {65, 4}, +static const arc arcs_11_5[2] = { + {65, 4}, {0, 5}, }; -static const arc arcs_11_6[2] = { - {65, 10}, +static const arc arcs_11_6[2] = { + {65, 10}, {0, 6}, }; -static const arc arcs_11_7[5] = { - {6, 11}, - {63, 2}, - {67, 12}, - {69, 3}, +static const arc arcs_11_7[5] = { + {6, 11}, + {63, 2}, + {67, 12}, + {69, 3}, {0, 7}, }; -static const arc arcs_11_8[1] = { - {58, 13}, +static const arc arcs_11_8[1] = { + {58, 13}, }; -static const arc arcs_11_9[3] = { - {65, 4}, - {66, 14}, +static const arc arcs_11_9[3] = { + {65, 4}, + {66, 14}, {0, 9}, }; -static const arc arcs_11_10[1] = { +static const arc arcs_11_10[1] = { {0, 10}, }; -static const arc arcs_11_11[3] = { - {65, 15}, - {69, 16}, +static const arc arcs_11_11[3] = { + {65, 15}, + {69, 16}, {0, 11}, }; -static const arc arcs_11_12[2] = { - {65, 17}, +static const arc arcs_11_12[2] = { + {65, 17}, {0, 12}, }; -static const arc arcs_11_13[2] = { - {65, 7}, +static const arc arcs_11_13[2] = { + {65, 7}, {0, 13}, }; -static const arc arcs_11_14[1] = { - {58, 5}, +static const arc arcs_11_14[1] = { + {58, 5}, }; -static const arc arcs_11_15[3] = { - {63, 2}, - {69, 18}, +static const arc arcs_11_15[3] = { + {63, 2}, + {69, 18}, {0, 15}, }; -static const arc arcs_11_16[2] = { - {65, 15}, - {0, 16}, +static const arc arcs_11_16[2] = { + {65, 15}, + {0, 16}, }; -static const arc arcs_11_17[4] = { - {6, 19}, - {63, 2}, - {69, 20}, +static const arc arcs_11_17[4] = { + {6, 19}, + {63, 2}, + {69, 20}, {0, 17}, }; -static const arc arcs_11_18[3] = { - {65, 15}, - {66, 21}, - {0, 18}, -}; -static const arc arcs_11_19[3] = { - {65, 22}, - {69, 23}, - {0, 19}, -}; -static const arc arcs_11_20[3] = { - {65, 24}, - {66, 25}, - {0, 20}, -}; -static const arc arcs_11_21[1] = { - {58, 16}, -}; -static const arc arcs_11_22[3] = { - {63, 2}, - {69, 26}, - {0, 22}, -}; -static const arc arcs_11_23[2] = { - {65, 22}, - {0, 23}, -}; -static const arc arcs_11_24[4] = { - {6, 27}, - {63, 2}, - {69, 20}, - {0, 24}, -}; -static const arc arcs_11_25[1] = { - {58, 28}, -}; -static const arc arcs_11_26[3] = { - {65, 22}, - {66, 29}, - {0, 26}, -}; -static const arc arcs_11_27[3] = { - {65, 30}, - {69, 31}, - {0, 27}, -}; -static const arc arcs_11_28[2] = { - {65, 24}, - {0, 28}, -}; -static const arc arcs_11_29[1] = { - {58, 23}, -}; -static const arc arcs_11_30[3] = { - {63, 2}, - {69, 32}, - {0, 30}, -}; -static const arc arcs_11_31[2] = { - {65, 30}, - {0, 31}, -}; -static const arc arcs_11_32[3] = { - {65, 30}, - {66, 33}, - {0, 32}, -}; -static const arc arcs_11_33[1] = { - {58, 31}, -}; -static state states_11[34] = { +static const arc arcs_11_18[3] = { + {65, 15}, + {66, 21}, + {0, 18}, +}; +static const arc arcs_11_19[3] = { + {65, 22}, + {69, 23}, + {0, 19}, +}; +static const arc arcs_11_20[3] = { + {65, 24}, + {66, 25}, + {0, 20}, +}; +static const arc arcs_11_21[1] = { + {58, 16}, +}; +static const arc arcs_11_22[3] = { + {63, 2}, + {69, 26}, + {0, 22}, +}; +static const arc arcs_11_23[2] = { + {65, 22}, + {0, 23}, +}; +static const arc arcs_11_24[4] = { + {6, 27}, + {63, 2}, + {69, 20}, + {0, 24}, +}; +static const arc arcs_11_25[1] = { + {58, 28}, +}; +static const arc arcs_11_26[3] = { + {65, 22}, + {66, 29}, + {0, 26}, +}; +static const arc arcs_11_27[3] = { + {65, 30}, + {69, 31}, + {0, 27}, +}; +static const arc arcs_11_28[2] = { + {65, 24}, + {0, 28}, +}; +static const arc arcs_11_29[1] = { + {58, 23}, +}; +static const arc arcs_11_30[3] = { + {63, 2}, + {69, 32}, + {0, 30}, +}; +static const arc arcs_11_31[2] = { + {65, 30}, + {0, 31}, +}; +static const arc arcs_11_32[3] = { + {65, 30}, + {66, 33}, + {0, 32}, +}; +static const arc arcs_11_33[1] = { + {58, 31}, +}; +static state states_11[34] = { {3, arcs_11_0}, {3, arcs_11_1}, - {1, arcs_11_2}, - {3, arcs_11_3}, - {3, arcs_11_4}, - {2, arcs_11_5}, + {1, arcs_11_2}, + {3, arcs_11_3}, + {3, arcs_11_4}, + {2, arcs_11_5}, {2, arcs_11_6}, - {5, arcs_11_7}, - {1, arcs_11_8}, - {3, arcs_11_9}, - {1, arcs_11_10}, + {5, arcs_11_7}, + {1, arcs_11_8}, + {3, arcs_11_9}, + {1, arcs_11_10}, {3, arcs_11_11}, - {2, arcs_11_12}, - {2, arcs_11_13}, - {1, arcs_11_14}, + {2, arcs_11_12}, + {2, arcs_11_13}, + {1, arcs_11_14}, {3, arcs_11_15}, - {2, arcs_11_16}, - {4, arcs_11_17}, - {3, arcs_11_18}, - {3, arcs_11_19}, - {3, arcs_11_20}, - {1, arcs_11_21}, - {3, arcs_11_22}, - {2, arcs_11_23}, - {4, arcs_11_24}, - {1, arcs_11_25}, - {3, arcs_11_26}, - {3, arcs_11_27}, - {2, arcs_11_28}, - {1, arcs_11_29}, - {3, arcs_11_30}, - {2, arcs_11_31}, - {3, arcs_11_32}, - {1, arcs_11_33}, -}; -static const arc arcs_12_0[1] = { - {40, 1}, -}; -static const arc arcs_12_1[1] = { + {2, arcs_11_16}, + {4, arcs_11_17}, + {3, arcs_11_18}, + {3, arcs_11_19}, + {3, arcs_11_20}, + {1, arcs_11_21}, + {3, arcs_11_22}, + {2, arcs_11_23}, + {4, arcs_11_24}, + {1, arcs_11_25}, + {3, arcs_11_26}, + {3, arcs_11_27}, + {2, arcs_11_28}, + {1, arcs_11_29}, + {3, arcs_11_30}, + {2, arcs_11_31}, + {3, arcs_11_32}, + {1, arcs_11_33}, +}; +static const arc arcs_12_0[1] = { + {40, 1}, +}; +static const arc arcs_12_1[1] = { {0, 1}, }; static state states_12[2] = { {1, arcs_12_0}, {1, arcs_12_1}, }; -static const arc arcs_13_0[2] = { +static const arc arcs_13_0[2] = { {3, 1}, {4, 1}, }; -static const arc arcs_13_1[1] = { +static const arc arcs_13_1[1] = { {0, 1}, }; static state states_13[2] = { {2, arcs_13_0}, {1, arcs_13_1}, }; -static const arc arcs_14_0[1] = { - {70, 1}, +static const arc arcs_14_0[1] = { + {70, 1}, }; -static const arc arcs_14_1[2] = { - {71, 2}, +static const arc arcs_14_1[2] = { + {71, 2}, {2, 3}, }; -static const arc arcs_14_2[2] = { +static const arc arcs_14_2[2] = { {2, 3}, - {70, 1}, + {70, 1}, }; -static const arc arcs_14_3[1] = { +static const arc arcs_14_3[1] = { {0, 3}, }; static state states_14[4] = { @@ -668,91 +668,91 @@ static state states_14[4] = { {2, arcs_14_2}, {1, arcs_14_3}, }; -static const arc arcs_15_0[8] = { - {72, 1}, - {73, 1}, - {74, 1}, - {75, 1}, - {76, 1}, - {77, 1}, - {78, 1}, - {79, 1}, -}; -static const arc arcs_15_1[1] = { +static const arc arcs_15_0[8] = { + {72, 1}, + {73, 1}, + {74, 1}, + {75, 1}, + {76, 1}, + {77, 1}, + {78, 1}, + {79, 1}, +}; +static const arc arcs_15_1[1] = { {0, 1}, }; static state states_15[2] = { {8, arcs_15_0}, {1, arcs_15_1}, }; -static const arc arcs_16_0[1] = { - {80, 1}, +static const arc arcs_16_0[1] = { + {80, 1}, }; -static const arc arcs_16_1[4] = { - {66, 2}, - {81, 3}, - {82, 4}, +static const arc arcs_16_1[4] = { + {66, 2}, + {81, 3}, + {82, 4}, {0, 1}, }; -static const arc arcs_16_2[2] = { - {80, 5}, - {83, 5}, +static const arc arcs_16_2[2] = { + {80, 5}, + {83, 5}, }; -static const arc arcs_16_3[1] = { - {0, 3}, +static const arc arcs_16_3[1] = { + {0, 3}, }; -static const arc arcs_16_4[2] = { - {47, 3}, - {83, 3}, +static const arc arcs_16_4[2] = { + {47, 3}, + {83, 3}, }; -static const arc arcs_16_5[3] = { - {66, 2}, - {59, 3}, +static const arc arcs_16_5[3] = { + {66, 2}, + {59, 3}, {0, 5}, }; static state states_16[6] = { {1, arcs_16_0}, {4, arcs_16_1}, - {2, arcs_16_2}, - {1, arcs_16_3}, + {2, arcs_16_2}, + {1, arcs_16_3}, {2, arcs_16_4}, - {3, arcs_16_5}, + {3, arcs_16_5}, }; -static const arc arcs_17_0[1] = { - {57, 1}, +static const arc arcs_17_0[1] = { + {57, 1}, }; -static const arc arcs_17_1[1] = { - {58, 2}, +static const arc arcs_17_1[1] = { + {58, 2}, }; -static const arc arcs_17_2[2] = { - {66, 3}, +static const arc arcs_17_2[2] = { + {66, 3}, {0, 2}, }; -static const arc arcs_17_3[2] = { - {80, 4}, - {83, 4}, +static const arc arcs_17_3[2] = { + {80, 4}, + {83, 4}, }; -static const arc arcs_17_4[1] = { +static const arc arcs_17_4[1] = { {0, 4}, }; static state states_17[5] = { {1, arcs_17_0}, {1, arcs_17_1}, {2, arcs_17_2}, - {2, arcs_17_3}, + {2, arcs_17_3}, {1, arcs_17_4}, }; -static const arc arcs_18_0[2] = { - {84, 1}, - {58, 1}, +static const arc arcs_18_0[2] = { + {84, 1}, + {58, 1}, }; -static const arc arcs_18_1[2] = { - {65, 2}, +static const arc arcs_18_1[2] = { + {65, 2}, {0, 1}, }; -static const arc arcs_18_2[3] = { - {84, 1}, - {58, 1}, +static const arc arcs_18_2[3] = { + {84, 1}, + {58, 1}, {0, 2}, }; static state states_18[3] = { @@ -760,35 +760,35 @@ static state states_18[3] = { {2, arcs_18_1}, {3, arcs_18_2}, }; -static const arc arcs_19_0[13] = { - {85, 1}, - {86, 1}, - {87, 1}, - {88, 1}, - {89, 1}, - {90, 1}, - {91, 1}, - {92, 1}, - {93, 1}, - {94, 1}, - {95, 1}, - {96, 1}, - {97, 1}, -}; -static const arc arcs_19_1[1] = { +static const arc arcs_19_0[13] = { + {85, 1}, + {86, 1}, + {87, 1}, + {88, 1}, + {89, 1}, + {90, 1}, + {91, 1}, + {92, 1}, + {93, 1}, + {94, 1}, + {95, 1}, + {96, 1}, + {97, 1}, +}; +static const arc arcs_19_1[1] = { {0, 1}, }; static state states_19[2] = { {13, arcs_19_0}, {1, arcs_19_1}, }; -static const arc arcs_20_0[1] = { - {20, 1}, +static const arc arcs_20_0[1] = { + {20, 1}, }; -static const arc arcs_20_1[1] = { - {98, 2}, +static const arc arcs_20_1[1] = { + {98, 2}, }; -static const arc arcs_20_2[1] = { +static const arc arcs_20_2[1] = { {0, 2}, }; static state states_20[3] = { @@ -796,58 +796,58 @@ static state states_20[3] = { {1, arcs_20_1}, {1, arcs_20_2}, }; -static const arc arcs_21_0[1] = { - {29, 1}, +static const arc arcs_21_0[1] = { + {29, 1}, }; -static const arc arcs_21_1[1] = { +static const arc arcs_21_1[1] = { {0, 1}, }; static state states_21[2] = { {1, arcs_21_0}, {1, arcs_21_1}, }; -static const arc arcs_22_0[5] = { - {99, 1}, - {100, 1}, - {101, 1}, - {102, 1}, - {103, 1}, +static const arc arcs_22_0[5] = { + {99, 1}, + {100, 1}, + {101, 1}, + {102, 1}, + {103, 1}, }; -static const arc arcs_22_1[1] = { +static const arc arcs_22_1[1] = { {0, 1}, }; static state states_22[2] = { {5, arcs_22_0}, {1, arcs_22_1}, }; -static const arc arcs_23_0[1] = { - {16, 1}, +static const arc arcs_23_0[1] = { + {16, 1}, }; -static const arc arcs_23_1[1] = { +static const arc arcs_23_1[1] = { {0, 1}, }; static state states_23[2] = { {1, arcs_23_0}, {1, arcs_23_1}, }; -static const arc arcs_24_0[1] = { - {18, 1}, +static const arc arcs_24_0[1] = { + {18, 1}, }; -static const arc arcs_24_1[1] = { +static const arc arcs_24_1[1] = { {0, 1}, }; static state states_24[2] = { {1, arcs_24_0}, {1, arcs_24_1}, }; -static const arc arcs_25_0[1] = { - {31, 1}, +static const arc arcs_25_0[1] = { + {31, 1}, }; -static const arc arcs_25_1[2] = { - {80, 2}, +static const arc arcs_25_1[2] = { + {80, 2}, {0, 1}, }; -static const arc arcs_25_2[1] = { +static const arc arcs_25_2[1] = { {0, 2}, }; static state states_25[3] = { @@ -855,31 +855,31 @@ static state states_25[3] = { {2, arcs_25_1}, {1, arcs_25_2}, }; -static const arc arcs_26_0[1] = { - {83, 1}, +static const arc arcs_26_0[1] = { + {83, 1}, }; -static const arc arcs_26_1[1] = { +static const arc arcs_26_1[1] = { {0, 1}, }; static state states_26[2] = { {1, arcs_26_0}, {1, arcs_26_1}, }; -static const arc arcs_27_0[1] = { - {30, 1}, +static const arc arcs_27_0[1] = { + {30, 1}, }; -static const arc arcs_27_1[2] = { - {58, 2}, +static const arc arcs_27_1[2] = { + {58, 2}, {0, 1}, }; -static const arc arcs_27_2[2] = { - {22, 3}, +static const arc arcs_27_2[2] = { + {22, 3}, {0, 2}, }; -static const arc arcs_27_3[1] = { - {58, 4}, +static const arc arcs_27_3[1] = { + {58, 4}, }; -static const arc arcs_27_4[1] = { +static const arc arcs_27_4[1] = { {0, 4}, }; static state states_27[5] = { @@ -889,24 +889,24 @@ static state states_27[5] = { {1, arcs_27_3}, {1, arcs_27_4}, }; -static const arc arcs_28_0[2] = { - {104, 1}, - {105, 1}, +static const arc arcs_28_0[2] = { + {104, 1}, + {105, 1}, }; -static const arc arcs_28_1[1] = { +static const arc arcs_28_1[1] = { {0, 1}, }; static state states_28[2] = { {2, arcs_28_0}, {1, arcs_28_1}, }; -static const arc arcs_29_0[1] = { - {25, 1}, +static const arc arcs_29_0[1] = { + {25, 1}, }; -static const arc arcs_29_1[1] = { - {106, 2}, +static const arc arcs_29_1[1] = { + {106, 2}, }; -static const arc arcs_29_2[1] = { +static const arc arcs_29_2[1] = { {0, 2}, }; static state states_29[3] = { @@ -914,36 +914,36 @@ static state states_29[3] = { {1, arcs_29_1}, {1, arcs_29_2}, }; -static const arc arcs_30_0[1] = { - {22, 1}, +static const arc arcs_30_0[1] = { + {22, 1}, }; -static const arc arcs_30_1[3] = { - {107, 2}, - {9, 2}, - {108, 3}, +static const arc arcs_30_1[3] = { + {107, 2}, + {9, 2}, + {108, 3}, }; -static const arc arcs_30_2[4] = { - {107, 2}, - {9, 2}, - {25, 4}, - {108, 3}, +static const arc arcs_30_2[4] = { + {107, 2}, + {9, 2}, + {25, 4}, + {108, 3}, }; -static const arc arcs_30_3[1] = { - {25, 4}, +static const arc arcs_30_3[1] = { + {25, 4}, }; -static const arc arcs_30_4[3] = { - {5, 5}, - {6, 6}, - {109, 6}, +static const arc arcs_30_4[3] = { + {5, 5}, + {6, 6}, + {109, 6}, }; -static const arc arcs_30_5[1] = { - {109, 7}, +static const arc arcs_30_5[1] = { + {109, 7}, }; -static const arc arcs_30_6[1] = { - {0, 6}, +static const arc arcs_30_6[1] = { + {0, 6}, }; -static const arc arcs_30_7[1] = { - {61, 6}, +static const arc arcs_30_7[1] = { + {61, 6}, }; static state states_30[8] = { {1, arcs_30_0}, @@ -955,17 +955,17 @@ static state states_30[8] = { {1, arcs_30_6}, {1, arcs_30_7}, }; -static const arc arcs_31_0[1] = { - {40, 1}, +static const arc arcs_31_0[1] = { + {40, 1}, }; -static const arc arcs_31_1[2] = { - {111, 2}, +static const arc arcs_31_1[2] = { + {111, 2}, {0, 1}, }; -static const arc arcs_31_2[1] = { - {40, 3}, +static const arc arcs_31_2[1] = { + {40, 3}, }; -static const arc arcs_31_3[1] = { +static const arc arcs_31_3[1] = { {0, 3}, }; static state states_31[4] = { @@ -974,17 +974,17 @@ static state states_31[4] = { {1, arcs_31_2}, {1, arcs_31_3}, }; -static const arc arcs_32_0[1] = { - {108, 1}, +static const arc arcs_32_0[1] = { + {108, 1}, }; -static const arc arcs_32_1[2] = { - {111, 2}, +static const arc arcs_32_1[2] = { + {111, 2}, {0, 1}, }; -static const arc arcs_32_2[1] = { - {40, 3}, +static const arc arcs_32_2[1] = { + {40, 3}, }; -static const arc arcs_32_3[1] = { +static const arc arcs_32_3[1] = { {0, 3}, }; static state states_32[4] = { @@ -993,15 +993,15 @@ static state states_32[4] = { {1, arcs_32_2}, {1, arcs_32_3}, }; -static const arc arcs_33_0[1] = { - {110, 1}, +static const arc arcs_33_0[1] = { + {110, 1}, }; -static const arc arcs_33_1[2] = { - {65, 2}, +static const arc arcs_33_1[2] = { + {65, 2}, {0, 1}, }; -static const arc arcs_33_2[2] = { - {110, 1}, +static const arc arcs_33_2[2] = { + {110, 1}, {0, 2}, }; static state states_33[3] = { @@ -1009,36 +1009,36 @@ static state states_33[3] = { {2, arcs_33_1}, {2, arcs_33_2}, }; -static const arc arcs_34_0[1] = { - {112, 1}, +static const arc arcs_34_0[1] = { + {112, 1}, }; -static const arc arcs_34_1[2] = { - {65, 0}, +static const arc arcs_34_1[2] = { + {65, 0}, {0, 1}, }; static state states_34[2] = { {1, arcs_34_0}, {2, arcs_34_1}, }; -static const arc arcs_35_0[1] = { - {40, 1}, +static const arc arcs_35_0[1] = { + {40, 1}, }; -static const arc arcs_35_1[2] = { - {107, 0}, +static const arc arcs_35_1[2] = { + {107, 0}, {0, 1}, }; static state states_35[2] = { {1, arcs_35_0}, {2, arcs_35_1}, }; -static const arc arcs_36_0[1] = { - {23, 1}, +static const arc arcs_36_0[1] = { + {23, 1}, }; -static const arc arcs_36_1[1] = { - {40, 2}, +static const arc arcs_36_1[1] = { + {40, 2}, }; -static const arc arcs_36_2[2] = { - {65, 1}, +static const arc arcs_36_2[2] = { + {65, 1}, {0, 2}, }; static state states_36[3] = { @@ -1046,14 +1046,14 @@ static state states_36[3] = { {1, arcs_36_1}, {2, arcs_36_2}, }; -static const arc arcs_37_0[1] = { - {27, 1}, +static const arc arcs_37_0[1] = { + {27, 1}, }; -static const arc arcs_37_1[1] = { - {40, 2}, +static const arc arcs_37_1[1] = { + {40, 2}, }; -static const arc arcs_37_2[2] = { - {65, 1}, +static const arc arcs_37_2[2] = { + {65, 1}, {0, 2}, }; static state states_37[3] = { @@ -1061,20 +1061,20 @@ static state states_37[3] = { {1, arcs_37_1}, {2, arcs_37_2}, }; -static const arc arcs_38_0[1] = { - {15, 1}, +static const arc arcs_38_0[1] = { + {15, 1}, }; -static const arc arcs_38_1[1] = { - {58, 2}, +static const arc arcs_38_1[1] = { + {58, 2}, }; -static const arc arcs_38_2[2] = { - {65, 3}, +static const arc arcs_38_2[2] = { + {65, 3}, {0, 2}, }; -static const arc arcs_38_3[1] = { - {58, 4}, +static const arc arcs_38_3[1] = { + {58, 4}, }; -static const arc arcs_38_4[1] = { +static const arc arcs_38_4[1] = { {0, 4}, }; static state states_38[5] = { @@ -1084,33 +1084,33 @@ static state states_38[5] = { {1, arcs_38_3}, {1, arcs_38_4}, }; -static const arc arcs_39_0[9] = { - {113, 1}, - {53, 1}, - {51, 1}, - {114, 1}, - {54, 1}, - {115, 1}, - {116, 1}, - {117, 1}, - {118, 1}, -}; -static const arc arcs_39_1[1] = { +static const arc arcs_39_0[9] = { + {113, 1}, + {53, 1}, + {51, 1}, + {114, 1}, + {54, 1}, + {115, 1}, + {116, 1}, + {117, 1}, + {118, 1}, +}; +static const arc arcs_39_1[1] = { {0, 1}, }; static state states_39[2] = { {9, arcs_39_0}, {1, arcs_39_1}, }; -static const arc arcs_40_0[1] = { - {38, 1}, +static const arc arcs_40_0[1] = { + {38, 1}, }; -static const arc arcs_40_1[3] = { - {114, 2}, - {54, 2}, - {118, 2}, +static const arc arcs_40_1[3] = { + {114, 2}, + {54, 2}, + {118, 2}, }; -static const arc arcs_40_2[1] = { +static const arc arcs_40_2[1] = { {0, 2}, }; static state states_40[3] = { @@ -1118,30 +1118,30 @@ static state states_40[3] = { {3, arcs_40_1}, {1, arcs_40_2}, }; -static const arc arcs_41_0[1] = { - {24, 1}, +static const arc arcs_41_0[1] = { + {24, 1}, }; -static const arc arcs_41_1[1] = { - {49, 2}, +static const arc arcs_41_1[1] = { + {49, 2}, }; -static const arc arcs_41_2[1] = { - {57, 3}, +static const arc arcs_41_2[1] = { + {57, 3}, }; -static const arc arcs_41_3[1] = { - {119, 4}, +static const arc arcs_41_3[1] = { + {119, 4}, }; -static const arc arcs_41_4[3] = { - {120, 1}, - {121, 5}, +static const arc arcs_41_4[3] = { + {120, 1}, + {121, 5}, {0, 4}, }; -static const arc arcs_41_5[1] = { - {57, 6}, +static const arc arcs_41_5[1] = { + {57, 6}, }; -static const arc arcs_41_6[1] = { - {119, 7}, +static const arc arcs_41_6[1] = { + {119, 7}, }; -static const arc arcs_41_7[1] = { +static const arc arcs_41_7[1] = { {0, 7}, }; static state states_41[8] = { @@ -1154,29 +1154,29 @@ static state states_41[8] = { {1, arcs_41_6}, {1, arcs_41_7}, }; -static const arc arcs_42_0[1] = { - {33, 1}, +static const arc arcs_42_0[1] = { + {33, 1}, }; -static const arc arcs_42_1[1] = { - {49, 2}, +static const arc arcs_42_1[1] = { + {49, 2}, }; -static const arc arcs_42_2[1] = { - {57, 3}, +static const arc arcs_42_2[1] = { + {57, 3}, }; -static const arc arcs_42_3[1] = { - {119, 4}, +static const arc arcs_42_3[1] = { + {119, 4}, }; -static const arc arcs_42_4[2] = { - {121, 5}, +static const arc arcs_42_4[2] = { + {121, 5}, {0, 4}, }; -static const arc arcs_42_5[1] = { - {57, 6}, +static const arc arcs_42_5[1] = { + {57, 6}, }; -static const arc arcs_42_6[1] = { - {119, 7}, +static const arc arcs_42_6[1] = { + {119, 7}, }; -static const arc arcs_42_7[1] = { +static const arc arcs_42_7[1] = { {0, 7}, }; static state states_42[8] = { @@ -1189,96 +1189,96 @@ static state states_42[8] = { {1, arcs_42_6}, {1, arcs_42_7}, }; -static const arc arcs_43_0[1] = { - {21, 1}, +static const arc arcs_43_0[1] = { + {21, 1}, }; -static const arc arcs_43_1[1] = { - {98, 2}, +static const arc arcs_43_1[1] = { + {98, 2}, }; -static const arc arcs_43_2[1] = { - {122, 3}, +static const arc arcs_43_2[1] = { + {122, 3}, }; -static const arc arcs_43_3[1] = { - {47, 4}, +static const arc arcs_43_3[1] = { + {47, 4}, }; -static const arc arcs_43_4[1] = { - {57, 5}, +static const arc arcs_43_4[1] = { + {57, 5}, }; -static const arc arcs_43_5[2] = { - {59, 6}, - {119, 7}, +static const arc arcs_43_5[2] = { + {59, 6}, + {119, 7}, }; -static const arc arcs_43_6[1] = { - {119, 7}, +static const arc arcs_43_6[1] = { + {119, 7}, }; -static const arc arcs_43_7[2] = { - {121, 8}, - {0, 7}, +static const arc arcs_43_7[2] = { + {121, 8}, + {0, 7}, }; -static const arc arcs_43_8[1] = { - {57, 9}, +static const arc arcs_43_8[1] = { + {57, 9}, }; -static const arc arcs_43_9[1] = { - {119, 10}, +static const arc arcs_43_9[1] = { + {119, 10}, }; -static const arc arcs_43_10[1] = { - {0, 10}, -}; -static state states_43[11] = { +static const arc arcs_43_10[1] = { + {0, 10}, +}; +static state states_43[11] = { {1, arcs_43_0}, {1, arcs_43_1}, {1, arcs_43_2}, {1, arcs_43_3}, {1, arcs_43_4}, - {2, arcs_43_5}, - {1, arcs_43_6}, - {2, arcs_43_7}, + {2, arcs_43_5}, + {1, arcs_43_6}, + {2, arcs_43_7}, {1, arcs_43_8}, {1, arcs_43_9}, - {1, arcs_43_10}, + {1, arcs_43_10}, }; -static const arc arcs_44_0[1] = { - {32, 1}, +static const arc arcs_44_0[1] = { + {32, 1}, }; -static const arc arcs_44_1[1] = { - {57, 2}, +static const arc arcs_44_1[1] = { + {57, 2}, }; -static const arc arcs_44_2[1] = { - {119, 3}, +static const arc arcs_44_2[1] = { + {119, 3}, }; -static const arc arcs_44_3[2] = { - {123, 4}, - {124, 5}, +static const arc arcs_44_3[2] = { + {123, 4}, + {124, 5}, }; -static const arc arcs_44_4[1] = { - {57, 6}, +static const arc arcs_44_4[1] = { + {57, 6}, }; -static const arc arcs_44_5[1] = { - {57, 7}, +static const arc arcs_44_5[1] = { + {57, 7}, }; -static const arc arcs_44_6[1] = { - {119, 8}, +static const arc arcs_44_6[1] = { + {119, 8}, }; -static const arc arcs_44_7[1] = { - {119, 9}, +static const arc arcs_44_7[1] = { + {119, 9}, }; -static const arc arcs_44_8[1] = { +static const arc arcs_44_8[1] = { {0, 8}, }; -static const arc arcs_44_9[4] = { - {121, 10}, - {123, 4}, - {124, 5}, +static const arc arcs_44_9[4] = { + {121, 10}, + {123, 4}, + {124, 5}, {0, 9}, }; -static const arc arcs_44_10[1] = { - {57, 11}, +static const arc arcs_44_10[1] = { + {57, 11}, }; -static const arc arcs_44_11[1] = { - {119, 12}, +static const arc arcs_44_11[1] = { + {119, 12}, }; -static const arc arcs_44_12[2] = { - {123, 4}, +static const arc arcs_44_12[2] = { + {123, 4}, {0, 12}, }; static state states_44[13] = { @@ -1290,51 +1290,51 @@ static state states_44[13] = { {1, arcs_44_5}, {1, arcs_44_6}, {1, arcs_44_7}, - {1, arcs_44_8}, - {4, arcs_44_9}, + {1, arcs_44_8}, + {4, arcs_44_9}, {1, arcs_44_10}, {1, arcs_44_11}, {2, arcs_44_12}, }; -static const arc arcs_45_0[1] = { - {34, 1}, +static const arc arcs_45_0[1] = { + {34, 1}, }; -static const arc arcs_45_1[1] = { - {125, 2}, +static const arc arcs_45_1[1] = { + {125, 2}, }; -static const arc arcs_45_2[2] = { - {65, 1}, - {57, 3}, +static const arc arcs_45_2[2] = { + {65, 1}, + {57, 3}, }; -static const arc arcs_45_3[2] = { - {59, 4}, - {119, 5}, +static const arc arcs_45_3[2] = { + {59, 4}, + {119, 5}, }; -static const arc arcs_45_4[1] = { - {119, 5}, +static const arc arcs_45_4[1] = { + {119, 5}, +}; +static const arc arcs_45_5[1] = { + {0, 5}, }; -static const arc arcs_45_5[1] = { - {0, 5}, -}; -static state states_45[6] = { +static state states_45[6] = { {1, arcs_45_0}, {1, arcs_45_1}, {2, arcs_45_2}, - {2, arcs_45_3}, + {2, arcs_45_3}, {1, arcs_45_4}, - {1, arcs_45_5}, + {1, arcs_45_5}, }; -static const arc arcs_46_0[1] = { - {58, 1}, +static const arc arcs_46_0[1] = { + {58, 1}, }; -static const arc arcs_46_1[2] = { - {111, 2}, +static const arc arcs_46_1[2] = { + {111, 2}, {0, 1}, }; -static const arc arcs_46_2[1] = { - {126, 3}, +static const arc arcs_46_2[1] = { + {126, 3}, }; -static const arc arcs_46_3[1] = { +static const arc arcs_46_3[1] = { {0, 3}, }; static state states_46[4] = { @@ -1343,21 +1343,21 @@ static state states_46[4] = { {1, arcs_46_2}, {1, arcs_46_3}, }; -static const arc arcs_47_0[1] = { - {127, 1}, +static const arc arcs_47_0[1] = { + {127, 1}, }; -static const arc arcs_47_1[2] = { - {58, 2}, +static const arc arcs_47_1[2] = { + {58, 2}, {0, 1}, }; -static const arc arcs_47_2[2] = { - {111, 3}, +static const arc arcs_47_2[2] = { + {111, 3}, {0, 2}, }; -static const arc arcs_47_3[1] = { - {40, 4}, +static const arc arcs_47_3[1] = { + {40, 4}, }; -static const arc arcs_47_4[1] = { +static const arc arcs_47_4[1] = { {0, 4}, }; static state states_47[5] = { @@ -1367,22 +1367,22 @@ static state states_47[5] = { {1, arcs_47_3}, {1, arcs_47_4}, }; -static const arc arcs_48_0[2] = { - {2, 1}, - {4, 2}, +static const arc arcs_48_0[2] = { + {2, 1}, + {4, 2}, }; -static const arc arcs_48_1[1] = { - {128, 3}, +static const arc arcs_48_1[1] = { + {128, 3}, }; -static const arc arcs_48_2[1] = { - {0, 2}, +static const arc arcs_48_2[1] = { + {0, 2}, }; -static const arc arcs_48_3[1] = { - {45, 4}, +static const arc arcs_48_3[1] = { + {45, 4}, }; -static const arc arcs_48_4[2] = { - {129, 2}, - {45, 4}, +static const arc arcs_48_4[2] = { + {129, 2}, + {45, 4}, }; static state states_48[5] = { {2, arcs_48_0}, @@ -1391,78 +1391,78 @@ static state states_48[5] = { {1, arcs_48_3}, {2, arcs_48_4}, }; -static const arc arcs_49_0[1] = { - {58, 1}, +static const arc arcs_49_0[1] = { + {58, 1}, }; -static const arc arcs_49_1[2] = { - {130, 2}, +static const arc arcs_49_1[2] = { + {130, 2}, {0, 1}, }; -static const arc arcs_49_2[1] = { - {58, 3}, +static const arc arcs_49_2[1] = { + {58, 3}, }; -static const arc arcs_49_3[1] = { - {0, 3}, +static const arc arcs_49_3[1] = { + {0, 3}, }; -static state states_49[4] = { - {1, arcs_49_0}, +static state states_49[4] = { + {1, arcs_49_0}, {2, arcs_49_1}, {1, arcs_49_2}, {1, arcs_49_3}, }; -static const arc arcs_50_0[2] = { - {131, 1}, - {132, 2}, +static const arc arcs_50_0[2] = { + {131, 1}, + {132, 2}, }; -static const arc arcs_50_1[1] = { +static const arc arcs_50_1[1] = { {0, 1}, }; -static const arc arcs_50_2[2] = { - {24, 3}, - {0, 2}, +static const arc arcs_50_2[2] = { + {24, 3}, + {0, 2}, +}; +static const arc arcs_50_3[1] = { + {132, 4}, }; -static const arc arcs_50_3[1] = { - {132, 4}, +static const arc arcs_50_4[1] = { + {121, 5}, }; -static const arc arcs_50_4[1] = { - {121, 5}, +static const arc arcs_50_5[1] = { + {58, 1}, }; -static const arc arcs_50_5[1] = { - {58, 1}, +static state states_50[6] = { + {2, arcs_50_0}, + {1, arcs_50_1}, + {2, arcs_50_2}, + {1, arcs_50_3}, + {1, arcs_50_4}, + {1, arcs_50_5}, }; -static state states_50[6] = { - {2, arcs_50_0}, - {1, arcs_50_1}, - {2, arcs_50_2}, - {1, arcs_50_3}, - {1, arcs_50_4}, - {1, arcs_50_5}, +static const arc arcs_51_0[2] = { + {134, 1}, + {132, 1}, }; -static const arc arcs_51_0[2] = { - {134, 1}, - {132, 1}, +static const arc arcs_51_1[1] = { + {0, 1}, }; -static const arc arcs_51_1[1] = { - {0, 1}, +static state states_51[2] = { + {2, arcs_51_0}, + {1, arcs_51_1}, }; -static state states_51[2] = { - {2, arcs_51_0}, - {1, arcs_51_1}, +static const arc arcs_52_0[1] = { + {26, 1}, }; -static const arc arcs_52_0[1] = { - {26, 1}, +static const arc arcs_52_1[2] = { + {57, 2}, + {68, 3}, }; -static const arc arcs_52_1[2] = { - {57, 2}, - {68, 3}, +static const arc arcs_52_2[1] = { + {58, 4}, }; -static const arc arcs_52_2[1] = { - {58, 4}, +static const arc arcs_52_3[1] = { + {57, 2}, }; -static const arc arcs_52_3[1] = { - {57, 2}, -}; -static const arc arcs_52_4[1] = { +static const arc arcs_52_4[1] = { {0, 4}, }; static state states_52[5] = { @@ -1472,1217 +1472,1217 @@ static state states_52[5] = { {1, arcs_52_3}, {1, arcs_52_4}, }; -static const arc arcs_53_0[1] = { - {26, 1}, -}; -static const arc arcs_53_1[2] = { - {57, 2}, - {68, 3}, -}; -static const arc arcs_53_2[1] = { - {133, 4}, -}; -static const arc arcs_53_3[1] = { - {57, 2}, -}; -static const arc arcs_53_4[1] = { - {0, 4}, -}; -static state states_53[5] = { +static const arc arcs_53_0[1] = { + {26, 1}, +}; +static const arc arcs_53_1[2] = { + {57, 2}, + {68, 3}, +}; +static const arc arcs_53_2[1] = { + {133, 4}, +}; +static const arc arcs_53_3[1] = { + {57, 2}, +}; +static const arc arcs_53_4[1] = { + {0, 4}, +}; +static state states_53[5] = { {1, arcs_53_0}, {2, arcs_53_1}, - {1, arcs_53_2}, - {1, arcs_53_3}, - {1, arcs_53_4}, + {1, arcs_53_2}, + {1, arcs_53_3}, + {1, arcs_53_4}, }; -static const arc arcs_54_0[1] = { - {135, 1}, +static const arc arcs_54_0[1] = { + {135, 1}, }; -static const arc arcs_54_1[2] = { - {136, 0}, +static const arc arcs_54_1[2] = { + {136, 0}, {0, 1}, }; static state states_54[2] = { {1, arcs_54_0}, {2, arcs_54_1}, }; -static const arc arcs_55_0[1] = { - {137, 1}, +static const arc arcs_55_0[1] = { + {137, 1}, }; -static const arc arcs_55_1[2] = { - {138, 0}, - {0, 1}, +static const arc arcs_55_1[2] = { + {138, 0}, + {0, 1}, }; -static state states_55[2] = { - {1, arcs_55_0}, - {2, arcs_55_1}, +static state states_55[2] = { + {1, arcs_55_0}, + {2, arcs_55_1}, }; -static const arc arcs_56_0[2] = { - {28, 1}, - {139, 2}, +static const arc arcs_56_0[2] = { + {28, 1}, + {139, 2}, }; -static const arc arcs_56_1[1] = { - {137, 2}, +static const arc arcs_56_1[1] = { + {137, 2}, }; -static const arc arcs_56_2[1] = { - {0, 2}, +static const arc arcs_56_2[1] = { + {0, 2}, +}; +static state states_56[3] = { + {2, arcs_56_0}, + {1, arcs_56_1}, + {1, arcs_56_2}, }; -static state states_56[3] = { - {2, arcs_56_0}, - {1, arcs_56_1}, - {1, arcs_56_2}, +static const arc arcs_57_0[1] = { + {126, 1}, }; -static const arc arcs_57_0[1] = { - {126, 1}, +static const arc arcs_57_1[2] = { + {140, 0}, + {0, 1}, }; -static const arc arcs_57_1[2] = { - {140, 0}, +static state states_57[2] = { + {1, arcs_57_0}, + {2, arcs_57_1}, +}; +static const arc arcs_58_0[10] = { + {141, 1}, + {142, 1}, + {143, 1}, + {141, 1}, + {144, 1}, + {145, 1}, + {146, 1}, + {122, 1}, + {147, 2}, + {28, 3}, +}; +static const arc arcs_58_1[1] = { {0, 1}, }; -static state states_57[2] = { - {1, arcs_57_0}, - {2, arcs_57_1}, -}; -static const arc arcs_58_0[10] = { - {141, 1}, - {142, 1}, - {143, 1}, - {141, 1}, - {144, 1}, - {145, 1}, - {146, 1}, - {122, 1}, - {147, 2}, - {28, 3}, -}; -static const arc arcs_58_1[1] = { - {0, 1}, -}; -static const arc arcs_58_2[2] = { - {28, 1}, - {0, 2}, -}; -static const arc arcs_58_3[1] = { - {122, 1}, -}; -static state states_58[4] = { - {10, arcs_58_0}, +static const arc arcs_58_2[2] = { + {28, 1}, + {0, 2}, +}; +static const arc arcs_58_3[1] = { + {122, 1}, +}; +static state states_58[4] = { + {10, arcs_58_0}, {1, arcs_58_1}, - {2, arcs_58_2}, - {1, arcs_58_3}, + {2, arcs_58_2}, + {1, arcs_58_3}, }; -static const arc arcs_59_0[1] = { - {6, 1}, +static const arc arcs_59_0[1] = { + {6, 1}, }; -static const arc arcs_59_1[1] = { - {126, 2}, +static const arc arcs_59_1[1] = { + {126, 2}, }; -static const arc arcs_59_2[1] = { - {0, 2}, -}; -static state states_59[3] = { +static const arc arcs_59_2[1] = { + {0, 2}, +}; +static state states_59[3] = { {1, arcs_59_0}, - {1, arcs_59_1}, - {1, arcs_59_2}, + {1, arcs_59_1}, + {1, arcs_59_2}, }; -static const arc arcs_60_0[1] = { - {148, 1}, +static const arc arcs_60_0[1] = { + {148, 1}, }; -static const arc arcs_60_1[2] = { - {149, 0}, +static const arc arcs_60_1[2] = { + {149, 0}, {0, 1}, }; static state states_60[2] = { {1, arcs_60_0}, {2, arcs_60_1}, }; -static const arc arcs_61_0[1] = { - {150, 1}, +static const arc arcs_61_0[1] = { + {150, 1}, }; -static const arc arcs_61_1[2] = { - {151, 0}, +static const arc arcs_61_1[2] = { + {151, 0}, {0, 1}, }; static state states_61[2] = { {1, arcs_61_0}, {2, arcs_61_1}, }; -static const arc arcs_62_0[1] = { - {152, 1}, +static const arc arcs_62_0[1] = { + {152, 1}, }; -static const arc arcs_62_1[2] = { - {153, 0}, +static const arc arcs_62_1[2] = { + {153, 0}, {0, 1}, }; static state states_62[2] = { {1, arcs_62_0}, - {2, arcs_62_1}, + {2, arcs_62_1}, }; -static const arc arcs_63_0[1] = { - {154, 1}, +static const arc arcs_63_0[1] = { + {154, 1}, }; -static const arc arcs_63_1[3] = { - {155, 0}, - {156, 0}, +static const arc arcs_63_1[3] = { + {155, 0}, + {156, 0}, {0, 1}, }; static state states_63[2] = { {1, arcs_63_0}, {3, arcs_63_1}, }; -static const arc arcs_64_0[1] = { - {157, 1}, +static const arc arcs_64_0[1] = { + {157, 1}, }; -static const arc arcs_64_1[3] = { - {7, 0}, - {8, 0}, +static const arc arcs_64_1[3] = { + {7, 0}, + {8, 0}, {0, 1}, }; static state states_64[2] = { {1, arcs_64_0}, - {3, arcs_64_1}, -}; -static const arc arcs_65_0[1] = { - {158, 1}, -}; -static const arc arcs_65_1[6] = { - {159, 0}, - {6, 0}, - {67, 0}, - {160, 0}, - {10, 0}, - {0, 1}, -}; -static state states_65[2] = { - {1, arcs_65_0}, - {6, arcs_65_1}, -}; -static const arc arcs_66_0[4] = { - {7, 1}, - {8, 1}, - {37, 1}, - {161, 2}, -}; -static const arc arcs_66_1[1] = { - {158, 2}, -}; -static const arc arcs_66_2[1] = { + {3, arcs_64_1}, +}; +static const arc arcs_65_0[1] = { + {158, 1}, +}; +static const arc arcs_65_1[6] = { + {159, 0}, + {6, 0}, + {67, 0}, + {160, 0}, + {10, 0}, + {0, 1}, +}; +static state states_65[2] = { + {1, arcs_65_0}, + {6, arcs_65_1}, +}; +static const arc arcs_66_0[4] = { + {7, 1}, + {8, 1}, + {37, 1}, + {161, 2}, +}; +static const arc arcs_66_1[1] = { + {158, 2}, +}; +static const arc arcs_66_2[1] = { {0, 2}, }; -static state states_66[3] = { - {4, arcs_66_0}, - {1, arcs_66_1}, - {1, arcs_66_2}, +static state states_66[3] = { + {4, arcs_66_0}, + {1, arcs_66_1}, + {1, arcs_66_2}, }; -static const arc arcs_67_0[1] = { - {162, 1}, +static const arc arcs_67_0[1] = { + {162, 1}, }; -static const arc arcs_67_1[2] = { - {63, 2}, +static const arc arcs_67_1[2] = { + {63, 2}, {0, 1}, }; -static const arc arcs_67_2[1] = { - {158, 3}, +static const arc arcs_67_2[1] = { + {158, 3}, }; -static const arc arcs_67_3[1] = { +static const arc arcs_67_3[1] = { {0, 3}, }; -static state states_67[4] = { - {1, arcs_67_0}, - {2, arcs_67_1}, - {1, arcs_67_2}, - {1, arcs_67_3}, +static state states_67[4] = { + {1, arcs_67_0}, + {2, arcs_67_1}, + {1, arcs_67_2}, + {1, arcs_67_3}, +}; +static const arc arcs_68_0[2] = { + {39, 1}, + {163, 2}, }; -static const arc arcs_68_0[2] = { - {39, 1}, - {163, 2}, +static const arc arcs_68_1[1] = { + {163, 2}, }; -static const arc arcs_68_1[1] = { - {163, 2}, +static const arc arcs_68_2[2] = { + {164, 2}, + {0, 2}, }; -static const arc arcs_68_2[2] = { - {164, 2}, +static state states_68[3] = { + {2, arcs_68_0}, + {1, arcs_68_1}, + {2, arcs_68_2}, +}; +static const arc arcs_69_0[10] = { + {5, 1}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {14, 3}, + {36, 4}, + {40, 2}, + {41, 2}, + {42, 5}, +}; +static const arc arcs_69_1[3] = { + {61, 2}, + {165, 6}, + {83, 6}, +}; +static const arc arcs_69_2[1] = { {0, 2}, }; -static state states_68[3] = { - {2, arcs_68_0}, - {1, arcs_68_1}, - {2, arcs_68_2}, -}; -static const arc arcs_69_0[10] = { - {5, 1}, - {9, 2}, - {11, 2}, - {12, 2}, - {13, 2}, - {14, 3}, - {36, 4}, - {40, 2}, - {41, 2}, - {42, 5}, -}; -static const arc arcs_69_1[3] = { - {61, 2}, - {165, 6}, - {83, 6}, -}; -static const arc arcs_69_2[1] = { - {0, 2}, -}; -static const arc arcs_69_3[2] = { - {166, 2}, - {165, 7}, -}; -static const arc arcs_69_4[2] = { - {167, 2}, - {168, 8}, -}; -static const arc arcs_69_5[2] = { - {42, 5}, +static const arc arcs_69_3[2] = { + {166, 2}, + {165, 7}, +}; +static const arc arcs_69_4[2] = { + {167, 2}, + {168, 8}, +}; +static const arc arcs_69_5[2] = { + {42, 5}, {0, 5}, }; -static const arc arcs_69_6[1] = { - {61, 2}, -}; -static const arc arcs_69_7[1] = { - {166, 2}, -}; -static const arc arcs_69_8[1] = { - {167, 2}, -}; -static state states_69[9] = { - {10, arcs_69_0}, - {3, arcs_69_1}, - {1, arcs_69_2}, - {2, arcs_69_3}, - {2, arcs_69_4}, - {2, arcs_69_5}, - {1, arcs_69_6}, - {1, arcs_69_7}, - {1, arcs_69_8}, -}; -static const arc arcs_70_0[2] = { - {49, 1}, - {84, 1}, -}; -static const arc arcs_70_1[3] = { - {65, 2}, - {169, 3}, +static const arc arcs_69_6[1] = { + {61, 2}, +}; +static const arc arcs_69_7[1] = { + {166, 2}, +}; +static const arc arcs_69_8[1] = { + {167, 2}, +}; +static state states_69[9] = { + {10, arcs_69_0}, + {3, arcs_69_1}, + {1, arcs_69_2}, + {2, arcs_69_3}, + {2, arcs_69_4}, + {2, arcs_69_5}, + {1, arcs_69_6}, + {1, arcs_69_7}, + {1, arcs_69_8}, +}; +static const arc arcs_70_0[2] = { + {49, 1}, + {84, 1}, +}; +static const arc arcs_70_1[3] = { + {65, 2}, + {169, 3}, {0, 1}, }; -static const arc arcs_70_2[3] = { - {49, 4}, - {84, 4}, +static const arc arcs_70_2[3] = { + {49, 4}, + {84, 4}, {0, 2}, }; -static const arc arcs_70_3[1] = { +static const arc arcs_70_3[1] = { {0, 3}, }; -static const arc arcs_70_4[2] = { - {65, 2}, +static const arc arcs_70_4[2] = { + {65, 2}, {0, 4}, }; -static state states_70[5] = { - {2, arcs_70_0}, - {3, arcs_70_1}, - {3, arcs_70_2}, - {1, arcs_70_3}, - {2, arcs_70_4}, +static state states_70[5] = { + {2, arcs_70_0}, + {3, arcs_70_1}, + {3, arcs_70_2}, + {1, arcs_70_3}, + {2, arcs_70_4}, }; -static const arc arcs_71_0[3] = { - {5, 1}, - {107, 2}, - {14, 3}, +static const arc arcs_71_0[3] = { + {5, 1}, + {107, 2}, + {14, 3}, }; -static const arc arcs_71_1[2] = { - {61, 4}, - {170, 5}, +static const arc arcs_71_1[2] = { + {61, 4}, + {170, 5}, }; -static const arc arcs_71_2[1] = { - {40, 4}, +static const arc arcs_71_2[1] = { + {40, 4}, }; -static const arc arcs_71_3[1] = { - {171, 6}, +static const arc arcs_71_3[1] = { + {171, 6}, }; -static const arc arcs_71_4[1] = { - {0, 4}, +static const arc arcs_71_4[1] = { + {0, 4}, }; -static const arc arcs_71_5[1] = { - {61, 4}, +static const arc arcs_71_5[1] = { + {61, 4}, }; -static const arc arcs_71_6[1] = { - {166, 4}, +static const arc arcs_71_6[1] = { + {166, 4}, }; -static state states_71[7] = { - {3, arcs_71_0}, - {2, arcs_71_1}, - {1, arcs_71_2}, - {1, arcs_71_3}, - {1, arcs_71_4}, - {1, arcs_71_5}, - {1, arcs_71_6}, +static state states_71[7] = { + {3, arcs_71_0}, + {2, arcs_71_1}, + {1, arcs_71_2}, + {1, arcs_71_3}, + {1, arcs_71_4}, + {1, arcs_71_5}, + {1, arcs_71_6}, }; -static const arc arcs_72_0[1] = { - {172, 1}, +static const arc arcs_72_0[1] = { + {172, 1}, }; -static const arc arcs_72_1[2] = { - {65, 2}, +static const arc arcs_72_1[2] = { + {65, 2}, {0, 1}, }; -static const arc arcs_72_2[2] = { - {172, 1}, +static const arc arcs_72_2[2] = { + {172, 1}, {0, 2}, }; -static state states_72[3] = { - {1, arcs_72_0}, - {2, arcs_72_1}, - {2, arcs_72_2}, +static state states_72[3] = { + {1, arcs_72_0}, + {2, arcs_72_1}, + {2, arcs_72_2}, }; -static const arc arcs_73_0[2] = { - {57, 1}, - {58, 2}, +static const arc arcs_73_0[2] = { + {57, 1}, + {58, 2}, }; -static const arc arcs_73_1[3] = { - {173, 3}, - {58, 4}, +static const arc arcs_73_1[3] = { + {173, 3}, + {58, 4}, {0, 1}, }; -static const arc arcs_73_2[2] = { - {57, 1}, +static const arc arcs_73_2[2] = { + {57, 1}, {0, 2}, }; -static const arc arcs_73_3[1] = { +static const arc arcs_73_3[1] = { {0, 3}, }; -static const arc arcs_73_4[2] = { - {173, 3}, +static const arc arcs_73_4[2] = { + {173, 3}, {0, 4}, }; -static state states_73[5] = { - {2, arcs_73_0}, - {3, arcs_73_1}, - {2, arcs_73_2}, - {1, arcs_73_3}, - {2, arcs_73_4}, +static state states_73[5] = { + {2, arcs_73_0}, + {3, arcs_73_1}, + {2, arcs_73_2}, + {1, arcs_73_3}, + {2, arcs_73_4}, }; -static const arc arcs_74_0[1] = { - {57, 1}, +static const arc arcs_74_0[1] = { + {57, 1}, }; -static const arc arcs_74_1[2] = { - {58, 2}, +static const arc arcs_74_1[2] = { + {58, 2}, {0, 1}, }; -static const arc arcs_74_2[1] = { +static const arc arcs_74_2[1] = { {0, 2}, }; -static state states_74[3] = { - {1, arcs_74_0}, - {2, arcs_74_1}, - {1, arcs_74_2}, +static state states_74[3] = { + {1, arcs_74_0}, + {2, arcs_74_1}, + {1, arcs_74_2}, }; -static const arc arcs_75_0[2] = { - {126, 1}, - {84, 1}, +static const arc arcs_75_0[2] = { + {126, 1}, + {84, 1}, }; -static const arc arcs_75_1[2] = { - {65, 2}, +static const arc arcs_75_1[2] = { + {65, 2}, {0, 1}, }; -static const arc arcs_75_2[3] = { - {126, 1}, - {84, 1}, +static const arc arcs_75_2[3] = { + {126, 1}, + {84, 1}, {0, 2}, }; -static state states_75[3] = { - {2, arcs_75_0}, - {2, arcs_75_1}, - {3, arcs_75_2}, +static state states_75[3] = { + {2, arcs_75_0}, + {2, arcs_75_1}, + {3, arcs_75_2}, }; -static const arc arcs_76_0[1] = { - {58, 1}, +static const arc arcs_76_0[1] = { + {58, 1}, }; -static const arc arcs_76_1[2] = { - {65, 2}, +static const arc arcs_76_1[2] = { + {65, 2}, {0, 1}, }; -static const arc arcs_76_2[2] = { - {58, 1}, +static const arc arcs_76_2[2] = { + {58, 1}, {0, 2}, }; -static state states_76[3] = { - {1, arcs_76_0}, - {2, arcs_76_1}, - {2, arcs_76_2}, +static state states_76[3] = { + {1, arcs_76_0}, + {2, arcs_76_1}, + {2, arcs_76_2}, }; -static const arc arcs_77_0[3] = { - {63, 1}, - {84, 2}, - {58, 3}, +static const arc arcs_77_0[3] = { + {63, 1}, + {84, 2}, + {58, 3}, }; -static const arc arcs_77_1[1] = { - {126, 4}, +static const arc arcs_77_1[1] = { + {126, 4}, }; -static const arc arcs_77_2[3] = { - {65, 5}, - {169, 6}, - {0, 2}, +static const arc arcs_77_2[3] = { + {65, 5}, + {169, 6}, + {0, 2}, }; -static const arc arcs_77_3[4] = { - {65, 5}, - {57, 7}, - {169, 6}, +static const arc arcs_77_3[4] = { + {65, 5}, + {57, 7}, + {169, 6}, {0, 3}, }; -static const arc arcs_77_4[3] = { - {65, 8}, - {169, 6}, - {0, 4}, +static const arc arcs_77_4[3] = { + {65, 8}, + {169, 6}, + {0, 4}, }; -static const arc arcs_77_5[3] = { - {84, 9}, - {58, 9}, +static const arc arcs_77_5[3] = { + {84, 9}, + {58, 9}, {0, 5}, }; -static const arc arcs_77_6[1] = { +static const arc arcs_77_6[1] = { {0, 6}, }; -static const arc arcs_77_7[1] = { - {58, 4}, +static const arc arcs_77_7[1] = { + {58, 4}, }; -static const arc arcs_77_8[3] = { - {63, 10}, - {58, 11}, +static const arc arcs_77_8[3] = { + {63, 10}, + {58, 11}, {0, 8}, }; -static const arc arcs_77_9[2] = { - {65, 5}, +static const arc arcs_77_9[2] = { + {65, 5}, {0, 9}, }; -static const arc arcs_77_10[1] = { - {126, 12}, +static const arc arcs_77_10[1] = { + {126, 12}, }; -static const arc arcs_77_11[1] = { - {57, 13}, +static const arc arcs_77_11[1] = { + {57, 13}, }; -static const arc arcs_77_12[2] = { - {65, 8}, - {0, 12}, +static const arc arcs_77_12[2] = { + {65, 8}, + {0, 12}, }; -static const arc arcs_77_13[1] = { - {58, 12}, +static const arc arcs_77_13[1] = { + {58, 12}, +}; +static state states_77[14] = { + {3, arcs_77_0}, + {1, arcs_77_1}, + {3, arcs_77_2}, + {4, arcs_77_3}, + {3, arcs_77_4}, + {3, arcs_77_5}, + {1, arcs_77_6}, + {1, arcs_77_7}, + {3, arcs_77_8}, + {2, arcs_77_9}, + {1, arcs_77_10}, + {1, arcs_77_11}, + {2, arcs_77_12}, + {1, arcs_77_13}, +}; +static const arc arcs_78_0[1] = { + {17, 1}, +}; +static const arc arcs_78_1[1] = { + {40, 2}, +}; +static const arc arcs_78_2[2] = { + {5, 3}, + {57, 4}, +}; +static const arc arcs_78_3[2] = { + {61, 5}, + {170, 6}, +}; +static const arc arcs_78_4[1] = { + {119, 7}, +}; +static const arc arcs_78_5[1] = { + {57, 4}, +}; +static const arc arcs_78_6[1] = { + {61, 5}, +}; +static const arc arcs_78_7[1] = { + {0, 7}, }; -static state states_77[14] = { - {3, arcs_77_0}, - {1, arcs_77_1}, - {3, arcs_77_2}, - {4, arcs_77_3}, - {3, arcs_77_4}, - {3, arcs_77_5}, - {1, arcs_77_6}, - {1, arcs_77_7}, - {3, arcs_77_8}, - {2, arcs_77_9}, - {1, arcs_77_10}, - {1, arcs_77_11}, - {2, arcs_77_12}, - {1, arcs_77_13}, +static state states_78[8] = { + {1, arcs_78_0}, + {1, arcs_78_1}, + {2, arcs_78_2}, + {2, arcs_78_3}, + {1, arcs_78_4}, + {1, arcs_78_5}, + {1, arcs_78_6}, + {1, arcs_78_7}, +}; +static const arc arcs_79_0[1] = { + {174, 1}, +}; +static const arc arcs_79_1[2] = { + {65, 2}, + {0, 1}, }; -static const arc arcs_78_0[1] = { - {17, 1}, +static const arc arcs_79_2[2] = { + {174, 1}, + {0, 2}, }; -static const arc arcs_78_1[1] = { - {40, 2}, +static state states_79[3] = { + {1, arcs_79_0}, + {2, arcs_79_1}, + {2, arcs_79_2}, }; -static const arc arcs_78_2[2] = { - {5, 3}, - {57, 4}, +static const arc arcs_80_0[3] = { + {6, 1}, + {63, 1}, + {58, 2}, }; -static const arc arcs_78_3[2] = { - {61, 5}, - {170, 6}, +static const arc arcs_80_1[1] = { + {58, 3}, }; -static const arc arcs_78_4[1] = { - {119, 7}, +static const arc arcs_80_2[4] = { + {130, 1}, + {66, 1}, + {169, 3}, + {0, 2}, }; -static const arc arcs_78_5[1] = { - {57, 4}, +static const arc arcs_80_3[1] = { + {0, 3}, }; -static const arc arcs_78_6[1] = { - {61, 5}, +static state states_80[4] = { + {3, arcs_80_0}, + {1, arcs_80_1}, + {4, arcs_80_2}, + {1, arcs_80_3}, }; -static const arc arcs_78_7[1] = { - {0, 7}, +static const arc arcs_81_0[2] = { + {169, 1}, + {176, 1}, }; -static state states_78[8] = { - {1, arcs_78_0}, - {1, arcs_78_1}, - {2, arcs_78_2}, - {2, arcs_78_3}, - {1, arcs_78_4}, - {1, arcs_78_5}, - {1, arcs_78_6}, - {1, arcs_78_7}, -}; -static const arc arcs_79_0[1] = { - {174, 1}, -}; -static const arc arcs_79_1[2] = { - {65, 2}, +static const arc arcs_81_1[1] = { {0, 1}, }; -static const arc arcs_79_2[2] = { - {174, 1}, +static state states_81[2] = { + {2, arcs_81_0}, + {1, arcs_81_1}, +}; +static const arc arcs_82_0[1] = { + {21, 1}, +}; +static const arc arcs_82_1[1] = { + {98, 2}, +}; +static const arc arcs_82_2[1] = { + {122, 3}, +}; +static const arc arcs_82_3[1] = { + {132, 4}, +}; +static const arc arcs_82_4[2] = { + {175, 5}, + {0, 4}, +}; +static const arc arcs_82_5[1] = { + {0, 5}, +}; +static state states_82[6] = { + {1, arcs_82_0}, + {1, arcs_82_1}, + {1, arcs_82_2}, + {1, arcs_82_3}, + {2, arcs_82_4}, + {1, arcs_82_5}, +}; +static const arc arcs_83_0[2] = { + {38, 1}, + {177, 2}, +}; +static const arc arcs_83_1[1] = { + {177, 2}, +}; +static const arc arcs_83_2[1] = { {0, 2}, }; -static state states_79[3] = { - {1, arcs_79_0}, - {2, arcs_79_1}, - {2, arcs_79_2}, +static state states_83[3] = { + {2, arcs_83_0}, + {1, arcs_83_1}, + {1, arcs_83_2}, }; -static const arc arcs_80_0[3] = { - {6, 1}, - {63, 1}, - {58, 2}, +static const arc arcs_84_0[1] = { + {24, 1}, }; -static const arc arcs_80_1[1] = { - {58, 3}, +static const arc arcs_84_1[1] = { + {133, 2}, }; -static const arc arcs_80_2[4] = { - {130, 1}, - {66, 1}, - {169, 3}, - {0, 2}, +static const arc arcs_84_2[2] = { + {175, 3}, + {0, 2}, }; -static const arc arcs_80_3[1] = { +static const arc arcs_84_3[1] = { {0, 3}, }; -static state states_80[4] = { - {3, arcs_80_0}, - {1, arcs_80_1}, - {4, arcs_80_2}, - {1, arcs_80_3}, +static state states_84[4] = { + {1, arcs_84_0}, + {1, arcs_84_1}, + {2, arcs_84_2}, + {1, arcs_84_3}, }; -static const arc arcs_81_0[2] = { - {169, 1}, - {176, 1}, +static const arc arcs_85_0[1] = { + {40, 1}, }; -static const arc arcs_81_1[1] = { +static const arc arcs_85_1[1] = { {0, 1}, }; -static state states_81[2] = { - {2, arcs_81_0}, - {1, arcs_81_1}, +static state states_85[2] = { + {1, arcs_85_0}, + {1, arcs_85_1}, }; -static const arc arcs_82_0[1] = { - {21, 1}, +static const arc arcs_86_0[1] = { + {35, 1}, }; -static const arc arcs_82_1[1] = { - {98, 2}, +static const arc arcs_86_1[2] = { + {179, 2}, + {0, 1}, }; -static const arc arcs_82_2[1] = { - {122, 3}, +static const arc arcs_86_2[1] = { + {0, 2}, }; -static const arc arcs_82_3[1] = { - {132, 4}, +static state states_86[3] = { + {1, arcs_86_0}, + {2, arcs_86_1}, + {1, arcs_86_2}, }; -static const arc arcs_82_4[2] = { - {175, 5}, - {0, 4}, +static const arc arcs_87_0[2] = { + {22, 1}, + {80, 2}, }; -static const arc arcs_82_5[1] = { - {0, 5}, +static const arc arcs_87_1[1] = { + {58, 2}, }; -static state states_82[6] = { - {1, arcs_82_0}, - {1, arcs_82_1}, - {1, arcs_82_2}, - {1, arcs_82_3}, - {2, arcs_82_4}, - {1, arcs_82_5}, +static const arc arcs_87_2[1] = { + {0, 2}, +}; +static state states_87[3] = { + {2, arcs_87_0}, + {1, arcs_87_1}, + {1, arcs_87_2}, }; -static const arc arcs_83_0[2] = { - {38, 1}, - {177, 2}, +static const arc arcs_88_0[2] = { + {2, 1}, + {4, 2}, }; -static const arc arcs_83_1[1] = { - {177, 2}, +static const arc arcs_88_1[2] = { + {128, 3}, + {59, 4}, }; -static const arc arcs_83_2[1] = { +static const arc arcs_88_2[1] = { {0, 2}, }; -static state states_83[3] = { - {2, arcs_83_0}, - {1, arcs_83_1}, - {1, arcs_83_2}, +static const arc arcs_88_3[1] = { + {45, 5}, +}; +static const arc arcs_88_4[1] = { + {2, 6}, }; -static const arc arcs_84_0[1] = { - {24, 1}, +static const arc arcs_88_5[2] = { + {129, 2}, + {45, 5}, }; -static const arc arcs_84_1[1] = { - {133, 2}, +static const arc arcs_88_6[1] = { + {128, 3}, }; -static const arc arcs_84_2[2] = { - {175, 3}, +static state states_88[7] = { + {2, arcs_88_0}, + {2, arcs_88_1}, + {1, arcs_88_2}, + {1, arcs_88_3}, + {1, arcs_88_4}, + {2, arcs_88_5}, + {1, arcs_88_6}, +}; +static const arc arcs_89_0[1] = { + {181, 1}, +}; +static const arc arcs_89_1[2] = { + {44, 2}, + {2, 1}, +}; +static const arc arcs_89_2[1] = { {0, 2}, }; -static const arc arcs_84_3[1] = { - {0, 3}, +static state states_89[3] = { + {1, arcs_89_0}, + {2, arcs_89_1}, + {1, arcs_89_2}, }; -static state states_84[4] = { - {1, arcs_84_0}, - {1, arcs_84_1}, - {2, arcs_84_2}, - {1, arcs_84_3}, +static const arc arcs_90_0[1] = { + {5, 1}, }; -static const arc arcs_85_0[1] = { - {40, 1}, +static const arc arcs_90_1[2] = { + {61, 2}, + {182, 3}, }; -static const arc arcs_85_1[1] = { - {0, 1}, +static const arc arcs_90_2[1] = { + {56, 4}, }; -static state states_85[2] = { - {1, arcs_85_0}, - {1, arcs_85_1}, +static const arc arcs_90_3[1] = { + {61, 2}, }; -static const arc arcs_86_0[1] = { - {35, 1}, +static const arc arcs_90_4[1] = { + {58, 5}, }; -static const arc arcs_86_1[2] = { - {179, 2}, +static const arc arcs_90_5[1] = { + {0, 5}, +}; +static state states_90[6] = { + {1, arcs_90_0}, + {2, arcs_90_1}, + {1, arcs_90_2}, + {1, arcs_90_3}, + {1, arcs_90_4}, + {1, arcs_90_5}, +}; +static const arc arcs_91_0[3] = { + {6, 1}, + {63, 2}, + {58, 3}, +}; +static const arc arcs_91_1[3] = { + {65, 4}, + {58, 5}, {0, 1}, }; -static const arc arcs_86_2[1] = { - {0, 2}, +static const arc arcs_91_2[1] = { + {58, 6}, }; -static state states_86[3] = { - {1, arcs_86_0}, - {2, arcs_86_1}, - {1, arcs_86_2}, +static const arc arcs_91_3[2] = { + {65, 7}, + {0, 3}, }; -static const arc arcs_87_0[2] = { - {22, 1}, - {80, 2}, +static const arc arcs_91_4[2] = { + {63, 2}, + {58, 5}, }; -static const arc arcs_87_1[1] = { - {58, 2}, +static const arc arcs_91_5[2] = { + {65, 4}, + {0, 5}, }; -static const arc arcs_87_2[1] = { - {0, 2}, +static const arc arcs_91_6[1] = { + {0, 6}, }; -static state states_87[3] = { - {2, arcs_87_0}, - {1, arcs_87_1}, - {1, arcs_87_2}, -}; -static const arc arcs_88_0[2] = { - {2, 1}, - {4, 2}, -}; -static const arc arcs_88_1[2] = { - {128, 3}, - {59, 4}, -}; -static const arc arcs_88_2[1] = { - {0, 2}, -}; -static const arc arcs_88_3[1] = { - {45, 5}, -}; -static const arc arcs_88_4[1] = { - {2, 6}, -}; -static const arc arcs_88_5[2] = { - {129, 2}, - {45, 5}, -}; -static const arc arcs_88_6[1] = { - {128, 3}, -}; -static state states_88[7] = { - {2, arcs_88_0}, - {2, arcs_88_1}, - {1, arcs_88_2}, - {1, arcs_88_3}, - {1, arcs_88_4}, - {2, arcs_88_5}, - {1, arcs_88_6}, -}; -static const arc arcs_89_0[1] = { - {181, 1}, -}; -static const arc arcs_89_1[2] = { - {44, 2}, - {2, 1}, -}; -static const arc arcs_89_2[1] = { - {0, 2}, -}; -static state states_89[3] = { - {1, arcs_89_0}, - {2, arcs_89_1}, - {1, arcs_89_2}, -}; -static const arc arcs_90_0[1] = { - {5, 1}, -}; -static const arc arcs_90_1[2] = { - {61, 2}, - {182, 3}, -}; -static const arc arcs_90_2[1] = { - {56, 4}, -}; -static const arc arcs_90_3[1] = { - {61, 2}, -}; -static const arc arcs_90_4[1] = { - {58, 5}, -}; -static const arc arcs_90_5[1] = { - {0, 5}, -}; -static state states_90[6] = { - {1, arcs_90_0}, - {2, arcs_90_1}, - {1, arcs_90_2}, - {1, arcs_90_3}, - {1, arcs_90_4}, - {1, arcs_90_5}, -}; -static const arc arcs_91_0[3] = { - {6, 1}, - {63, 2}, - {58, 3}, -}; -static const arc arcs_91_1[3] = { - {65, 4}, - {58, 5}, - {0, 1}, -}; -static const arc arcs_91_2[1] = { - {58, 6}, -}; -static const arc arcs_91_3[2] = { - {65, 7}, - {0, 3}, -}; -static const arc arcs_91_4[2] = { - {63, 2}, - {58, 5}, -}; -static const arc arcs_91_5[2] = { - {65, 4}, - {0, 5}, -}; -static const arc arcs_91_6[1] = { - {0, 6}, -}; -static const arc arcs_91_7[4] = { - {6, 8}, - {63, 2}, - {58, 3}, - {0, 7}, -}; -static const arc arcs_91_8[3] = { - {65, 9}, - {58, 10}, - {0, 8}, -}; -static const arc arcs_91_9[2] = { - {63, 2}, - {58, 10}, -}; -static const arc arcs_91_10[2] = { - {65, 9}, - {0, 10}, -}; -static state states_91[11] = { - {3, arcs_91_0}, - {3, arcs_91_1}, - {1, arcs_91_2}, - {2, arcs_91_3}, - {2, arcs_91_4}, - {2, arcs_91_5}, - {1, arcs_91_6}, - {4, arcs_91_7}, - {3, arcs_91_8}, - {2, arcs_91_9}, - {2, arcs_91_10}, -}; -static const dfa dfas[92] = { - {256, "single_input", 3, states_0, - "\344\377\377\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {257, "file_input", 2, states_1, - "\344\377\377\377\377\027\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {258, "eval_input", 3, states_2, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {259, "decorator", 4, states_3, - "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {260, "decorators", 2, states_4, - "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {261, "decorated", 3, states_5, - "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {262, "async_funcdef", 3, states_6, - "\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {263, "funcdef", 9, states_7, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {264, "parameters", 4, states_8, - "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {265, "typedargslist", 42, states_9, - "\100\000\000\000\000\001\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {266, "tfpdef", 4, states_10, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {267, "varargslist", 34, states_11, - "\100\000\000\000\000\001\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {268, "vfpdef", 2, states_12, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {269, "stmt", 2, states_13, - "\340\377\377\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {270, "simple_stmt", 4, states_14, - "\340\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {271, "small_stmt", 2, states_15, - "\340\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {272, "expr_stmt", 6, states_16, - "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {273, "annassign", 5, states_17, - "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {274, "testlist_star_expr", 3, states_18, - "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {275, "augassign", 2, states_19, - "\000\000\000\000\000\000\000\000\000\000\340\377\003\000\000\000\000\000\000\000\000\000\000"}, - {276, "del_stmt", 3, states_20, - "\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {277, "pass_stmt", 2, states_21, - "\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {278, "flow_stmt", 2, states_22, - "\000\000\005\300\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {279, "break_stmt", 2, states_23, - "\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {280, "continue_stmt", 2, states_24, - "\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {281, "return_stmt", 3, states_25, - "\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {282, "yield_stmt", 2, states_26, - "\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {283, "raise_stmt", 5, states_27, - "\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {284, "import_stmt", 2, states_28, - "\000\000\100\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {285, "import_name", 3, states_29, - "\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {286, "import_from", 8, states_30, +static const arc arcs_91_7[4] = { + {6, 8}, + {63, 2}, + {58, 3}, + {0, 7}, +}; +static const arc arcs_91_8[3] = { + {65, 9}, + {58, 10}, + {0, 8}, +}; +static const arc arcs_91_9[2] = { + {63, 2}, + {58, 10}, +}; +static const arc arcs_91_10[2] = { + {65, 9}, + {0, 10}, +}; +static state states_91[11] = { + {3, arcs_91_0}, + {3, arcs_91_1}, + {1, arcs_91_2}, + {2, arcs_91_3}, + {2, arcs_91_4}, + {2, arcs_91_5}, + {1, arcs_91_6}, + {4, arcs_91_7}, + {3, arcs_91_8}, + {2, arcs_91_9}, + {2, arcs_91_10}, +}; +static const dfa dfas[92] = { + {256, "single_input", 3, states_0, + "\344\377\377\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {257, "file_input", 2, states_1, + "\344\377\377\377\377\027\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {258, "eval_input", 3, states_2, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {259, "decorator", 4, states_3, + "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {260, "decorators", 2, states_4, + "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {261, "decorated", 3, states_5, + "\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {262, "async_funcdef", 3, states_6, + "\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {263, "funcdef", 9, states_7, + "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {264, "parameters", 4, states_8, + "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {265, "typedargslist", 42, states_9, + "\100\000\000\000\000\001\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {266, "tfpdef", 4, states_10, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {267, "varargslist", 34, states_11, + "\100\000\000\000\000\001\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {268, "vfpdef", 2, states_12, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {269, "stmt", 2, states_13, + "\340\377\377\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {270, "simple_stmt", 4, states_14, + "\340\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {271, "small_stmt", 2, states_15, + "\340\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {272, "expr_stmt", 6, states_16, + "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {273, "annassign", 5, states_17, + "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {274, "testlist_star_expr", 3, states_18, + "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {275, "augassign", 2, states_19, + "\000\000\000\000\000\000\000\000\000\000\340\377\003\000\000\000\000\000\000\000\000\000\000"}, + {276, "del_stmt", 3, states_20, + "\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {277, "pass_stmt", 2, states_21, + "\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {278, "flow_stmt", 2, states_22, + "\000\000\005\300\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {279, "break_stmt", 2, states_23, + "\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {280, "continue_stmt", 2, states_24, + "\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {281, "return_stmt", 3, states_25, + "\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {282, "yield_stmt", 2, states_26, + "\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {283, "raise_stmt", 5, states_27, + "\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {284, "import_stmt", 2, states_28, + "\000\000\100\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {285, "import_name", 3, states_29, + "\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {286, "import_from", 8, states_30, "\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {287, "import_as_name", 4, states_31, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {288, "dotted_as_name", 4, states_32, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {289, "import_as_names", 3, states_33, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {290, "dotted_as_names", 2, states_34, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {291, "dotted_name", 2, states_35, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {292, "global_stmt", 3, states_36, + {287, "import_as_name", 4, states_31, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {288, "dotted_as_name", 4, states_32, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {289, "import_as_names", 3, states_33, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {290, "dotted_as_names", 2, states_34, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {291, "dotted_name", 2, states_35, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {292, "global_stmt", 3, states_36, "\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {293, "nonlocal_stmt", 3, states_37, + {293, "nonlocal_stmt", 3, states_37, "\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {294, "assert_stmt", 5, states_38, - "\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {295, "compound_stmt", 2, states_39, - "\000\004\052\001\107\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {296, "async_stmt", 3, states_40, - "\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {297, "if_stmt", 8, states_41, - "\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {298, "while_stmt", 8, states_42, - "\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {299, "for_stmt", 11, states_43, + {294, "assert_stmt", 5, states_38, + "\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {295, "compound_stmt", 2, states_39, + "\000\004\052\001\107\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {296, "async_stmt", 3, states_40, + "\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {297, "if_stmt", 8, states_41, + "\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {298, "while_stmt", 8, states_42, + "\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {299, "for_stmt", 11, states_43, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {300, "try_stmt", 13, states_44, + "\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {301, "with_stmt", 6, states_45, + "\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {302, "with_item", 4, states_46, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {303, "except_clause", 5, states_47, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"}, + {304, "suite", 5, states_48, + "\344\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {305, "namedexpr_test", 4, states_49, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {306, "test", 6, states_50, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {307, "test_nocond", 2, states_51, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {308, "lambdef", 5, states_52, + "\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {309, "lambdef_nocond", 5, states_53, + "\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {310, "or_test", 2, states_54, + "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {311, "and_test", 2, states_55, + "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {312, "not_test", 3, states_56, + "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {313, "comparison", 2, states_57, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {314, "comp_op", 4, states_58, + "\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\004\000\340\017\000\000\000\000"}, + {315, "star_expr", 3, states_59, + "\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {316, "expr", 2, states_60, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {317, "xor_expr", 2, states_61, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {318, "and_expr", 2, states_62, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {319, "shift_expr", 2, states_63, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {320, "arith_expr", 2, states_64, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {321, "term", 2, states_65, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {322, "factor", 3, states_66, + "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {323, "power", 4, states_67, + "\040\172\000\000\220\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {324, "atom_expr", 3, states_68, + "\040\172\000\000\220\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {325, "atom", 9, states_69, + "\040\172\000\000\020\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {326, "testlist_comp", 5, states_70, + "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {327, "trailer", 7, states_71, + "\040\100\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"}, + {328, "subscriptlist", 3, states_72, + "\240\173\000\024\260\007\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {329, "subscript", 5, states_73, + "\240\173\000\024\260\007\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {330, "sliceop", 3, states_74, + "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {331, "exprlist", 3, states_75, + "\340\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {332, "testlist", 3, states_76, + "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {333, "dictorsetmaker", 14, states_77, + "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {334, "classdef", 8, states_78, + "\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {335, "arglist", 3, states_79, + "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {336, "argument", 4, states_80, + "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {337, "comp_iter", 2, states_81, + "\000\000\040\001\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {338, "sync_comp_for", 6, states_82, "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {300, "try_stmt", 13, states_44, - "\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {301, "with_stmt", 6, states_45, - "\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {302, "with_item", 4, states_46, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {303, "except_clause", 5, states_47, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"}, - {304, "suite", 5, states_48, - "\344\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {305, "namedexpr_test", 4, states_49, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {306, "test", 6, states_50, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {307, "test_nocond", 2, states_51, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {308, "lambdef", 5, states_52, - "\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {309, "lambdef_nocond", 5, states_53, - "\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {310, "or_test", 2, states_54, - "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {311, "and_test", 2, states_55, - "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {312, "not_test", 3, states_56, - "\240\173\000\020\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {313, "comparison", 2, states_57, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {314, "comp_op", 4, states_58, - "\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\004\000\340\017\000\000\000\000"}, - {315, "star_expr", 3, states_59, - "\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {316, "expr", 2, states_60, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {317, "xor_expr", 2, states_61, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {318, "and_expr", 2, states_62, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {319, "shift_expr", 2, states_63, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {320, "arith_expr", 2, states_64, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {321, "term", 2, states_65, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {322, "factor", 3, states_66, - "\240\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {323, "power", 4, states_67, - "\040\172\000\000\220\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {324, "atom_expr", 3, states_68, - "\040\172\000\000\220\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {325, "atom", 9, states_69, - "\040\172\000\000\020\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {326, "testlist_comp", 5, states_70, - "\340\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {327, "trailer", 7, states_71, - "\040\100\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"}, - {328, "subscriptlist", 3, states_72, - "\240\173\000\024\260\007\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {329, "subscript", 5, states_73, - "\240\173\000\024\260\007\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {330, "sliceop", 3, states_74, - "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {331, "exprlist", 3, states_75, - "\340\173\000\000\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {332, "testlist", 3, states_76, - "\240\173\000\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {333, "dictorsetmaker", 14, states_77, - "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {334, "classdef", 8, states_78, - "\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {335, "arglist", 3, states_79, - "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {336, "argument", 4, states_80, - "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {337, "comp_iter", 2, states_81, - "\000\000\040\001\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {338, "sync_comp_for", 6, states_82, - "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {339, "comp_for", 3, states_83, - "\000\000\040\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {340, "comp_if", 4, states_84, - "\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {341, "encoding_decl", 2, states_85, - "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {342, "yield_expr", 3, states_86, - "\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {343, "yield_arg", 3, states_87, - "\340\173\100\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {344, "func_body_suite", 7, states_88, - "\344\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {345, "func_type_input", 3, states_89, - "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {346, "func_type", 6, states_90, - "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {347, "typelist", 11, states_91, - "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, -}; -static const label labels[183] = { + {339, "comp_for", 3, states_83, + "\000\000\040\000\100\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {340, "comp_if", 4, states_84, + "\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {341, "encoding_decl", 2, states_85, + "\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {342, "yield_expr", 3, states_86, + "\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {343, "yield_arg", 3, states_87, + "\340\173\100\024\260\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {344, "func_body_suite", 7, states_88, + "\344\373\325\376\270\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {345, "func_type_input", 3, states_89, + "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {346, "func_type", 6, states_90, + "\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {347, "typelist", 11, states_91, + "\340\173\000\024\260\007\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, +}; +static const label labels[183] = { {0, "EMPTY"}, {256, 0}, {4, 0}, - {295, 0}, + {295, 0}, {270, 0}, - {7, 0}, - {16, 0}, - {14, 0}, - {15, 0}, - {52, 0}, - {49, 0}, - {1, "False"}, - {1, "None"}, - {1, "True"}, - {9, 0}, - {1, "assert"}, - {1, "break"}, - {1, "class"}, - {1, "continue"}, - {1, "def"}, - {1, "del"}, - {1, "for"}, - {1, "from"}, - {1, "global"}, - {1, "if"}, - {1, "import"}, - {1, "lambda"}, - {1, "nonlocal"}, - {1, "not"}, - {1, "pass"}, - {1, "raise"}, - {1, "return"}, - {1, "try"}, - {1, "while"}, - {1, "with"}, - {1, "yield"}, - {25, 0}, - {31, 0}, - {56, 0}, - {55, 0}, - {1, 0}, - {2, 0}, - {3, 0}, + {7, 0}, + {16, 0}, + {14, 0}, + {15, 0}, + {52, 0}, + {49, 0}, + {1, "False"}, + {1, "None"}, + {1, "True"}, + {9, 0}, + {1, "assert"}, + {1, "break"}, + {1, "class"}, + {1, "continue"}, + {1, "def"}, + {1, "del"}, + {1, "for"}, + {1, "from"}, + {1, "global"}, + {1, "if"}, + {1, "import"}, + {1, "lambda"}, + {1, "nonlocal"}, + {1, "not"}, + {1, "pass"}, + {1, "raise"}, + {1, "return"}, + {1, "try"}, + {1, "while"}, + {1, "with"}, + {1, "yield"}, + {25, 0}, + {31, 0}, + {56, 0}, + {55, 0}, + {1, 0}, + {2, 0}, + {3, 0}, {257, 0}, - {0, 0}, + {0, 0}, {269, 0}, {258, 0}, - {332, 0}, + {332, 0}, {259, 0}, - {305, 0}, + {305, 0}, {260, 0}, {261, 0}, - {262, 0}, - {334, 0}, + {262, 0}, + {334, 0}, {263, 0}, {264, 0}, {51, 0}, {11, 0}, - {306, 0}, - {58, 0}, - {344, 0}, - {8, 0}, + {306, 0}, + {58, 0}, + {344, 0}, + {8, 0}, {265, 0}, - {35, 0}, + {35, 0}, {266, 0}, - {12, 0}, + {12, 0}, {22, 0}, - {17, 0}, + {17, 0}, {267, 0}, {268, 0}, {271, 0}, {13, 0}, - {294, 0}, - {276, 0}, + {294, 0}, + {276, 0}, {272, 0}, {278, 0}, - {292, 0}, + {292, 0}, {284, 0}, {293, 0}, - {277, 0}, + {277, 0}, {274, 0}, {273, 0}, {275, 0}, - {342, 0}, - {315, 0}, - {40, 0}, - {41, 0}, - {46, 0}, - {38, 0}, + {342, 0}, + {315, 0}, + {40, 0}, + {41, 0}, + {46, 0}, + {38, 0}, {36, 0}, {37, 0}, - {48, 0}, + {48, 0}, {39, 0}, {44, 0}, {45, 0}, - {50, 0}, - {43, 0}, - {42, 0}, - {331, 0}, + {50, 0}, + {43, 0}, + {42, 0}, + {331, 0}, {279, 0}, {280, 0}, - {283, 0}, + {283, 0}, {281, 0}, {282, 0}, - {286, 0}, + {286, 0}, {285, 0}, {290, 0}, {23, 0}, - {291, 0}, + {291, 0}, {289, 0}, {287, 0}, {1, "as"}, {288, 0}, - {296, 0}, - {299, 0}, + {296, 0}, + {299, 0}, {297, 0}, - {300, 0}, + {300, 0}, {298, 0}, {301, 0}, - {304, 0}, + {304, 0}, {1, "elif"}, {1, "else"}, {1, "in"}, - {1, "finally"}, + {1, "finally"}, {303, 0}, {302, 0}, - {316, 0}, + {316, 0}, {1, "except"}, {5, 0}, {6, 0}, - {53, 0}, + {53, 0}, {308, 0}, {310, 0}, - {307, 0}, - {309, 0}, - {311, 0}, + {307, 0}, + {309, 0}, + {311, 0}, {1, "or"}, - {312, 0}, + {312, 0}, {1, "and"}, {313, 0}, - {314, 0}, - {28, 0}, + {314, 0}, + {28, 0}, {20, 0}, - {29, 0}, - {27, 0}, + {29, 0}, + {27, 0}, {21, 0}, {30, 0}, {1, "is"}, - {317, 0}, + {317, 0}, {18, 0}, - {318, 0}, + {318, 0}, {32, 0}, - {319, 0}, + {319, 0}, {19, 0}, - {320, 0}, + {320, 0}, {33, 0}, {34, 0}, {321, 0}, - {322, 0}, + {322, 0}, {24, 0}, {47, 0}, {323, 0}, {324, 0}, - {325, 0}, - {327, 0}, + {325, 0}, + {327, 0}, {326, 0}, {10, 0}, {26, 0}, - {333, 0}, - {339, 0}, - {335, 0}, + {333, 0}, + {339, 0}, + {335, 0}, {328, 0}, {329, 0}, - {330, 0}, + {330, 0}, {336, 0}, {337, 0}, {340, 0}, - {338, 0}, - {341, 0}, - {343, 0}, - {345, 0}, - {346, 0}, - {347, 0}, -}; -Py_EXPORTED_SYMBOL grammar _PyParser_Grammar = { - 92, + {338, 0}, + {341, 0}, + {343, 0}, + {345, 0}, + {346, 0}, + {347, 0}, +}; +Py_EXPORTED_SYMBOL grammar _PyParser_Grammar = { + 92, dfas, - {183, labels}, + {183, labels}, 256 }; diff --git a/contrib/tools/python3/src/Python/hamt.c b/contrib/tools/python3/src/Python/hamt.c index a5ff87d8f0..8801c5ea41 100644 --- a/contrib/tools/python3/src/Python/hamt.c +++ b/contrib/tools/python3/src/Python/hamt.c @@ -1,11 +1,11 @@ #include "Python.h" -#include "pycore_hamt.h" -#include "pycore_object.h" // _PyObject_GC_TRACK() -#include <stddef.h> // offsetof() +#include "pycore_hamt.h" +#include "pycore_object.h" // _PyObject_GC_TRACK() +#include <stddef.h> // offsetof() /* -This file provides an implementation of an immutable mapping using the +This file provides an implementation of an immutable mapping using the Hash Array Mapped Trie (or HAMT) datastructure. This design allows to have: @@ -273,9 +273,9 @@ to introspect the tree: */ -#define IS_ARRAY_NODE(node) Py_IS_TYPE(node, &_PyHamt_ArrayNode_Type) -#define IS_BITMAP_NODE(node) Py_IS_TYPE(node, &_PyHamt_BitmapNode_Type) -#define IS_COLLISION_NODE(node) Py_IS_TYPE(node, &_PyHamt_CollisionNode_Type) +#define IS_ARRAY_NODE(node) Py_IS_TYPE(node, &_PyHamt_ArrayNode_Type) +#define IS_BITMAP_NODE(node) Py_IS_TYPE(node, &_PyHamt_BitmapNode_Type) +#define IS_COLLISION_NODE(node) Py_IS_TYPE(node, &_PyHamt_CollisionNode_Type) /* Return type for 'find' (lookup a key) functions. @@ -372,11 +372,11 @@ hamt_node_collision_count(PyHamtNode_Collision *node); #ifdef Py_DEBUG static void -_hamt_node_array_validate(void *obj_raw) +_hamt_node_array_validate(void *obj_raw) { - PyObject *obj = _PyObject_CAST(obj_raw); - assert(IS_ARRAY_NODE(obj)); - PyHamtNode_Array *node = (PyHamtNode_Array*)obj; + PyObject *obj = _PyObject_CAST(obj_raw); + assert(IS_ARRAY_NODE(obj)); + PyHamtNode_Array *node = (PyHamtNode_Array*)obj; Py_ssize_t i = 0, count = 0; for (; i < HAMT_ARRAY_NODE_SIZE; i++) { if (node->a_array[i] != NULL) { @@ -550,7 +550,7 @@ hamt_node_bitmap_new(Py_ssize_t size) return NULL; } - Py_SET_SIZE(node, size); + Py_SET_SIZE(node, size); for (i = 0; i < size; i++) { node->b_array[i] = NULL; @@ -829,7 +829,7 @@ hamt_node_bitmap_assoc(PyHamtNode_Bitmap *self, Instead we start using an Array node, which has simpler (faster) implementation at the expense of - having preallocated 32 pointers for its keys/values + having preallocated 32 pointers for its keys/values pairs. Small hamt objects (<30 keys) usually don't have any @@ -1175,7 +1175,7 @@ hamt_node_bitmap_dealloc(PyHamtNode_Bitmap *self) Py_ssize_t i; PyObject_GC_UnTrack(self); - Py_TRASHCAN_BEGIN(self, hamt_node_bitmap_dealloc) + Py_TRASHCAN_BEGIN(self, hamt_node_bitmap_dealloc) if (len > 0) { i = len; @@ -1185,7 +1185,7 @@ hamt_node_bitmap_dealloc(PyHamtNode_Bitmap *self) } Py_TYPE(self)->tp_free((PyObject *)self); - Py_TRASHCAN_END + Py_TRASHCAN_END } #ifdef Py_DEBUG @@ -1287,7 +1287,7 @@ hamt_node_collision_new(int32_t hash, Py_ssize_t size) node->c_array[i] = NULL; } - Py_SET_SIZE(node, size); + Py_SET_SIZE(node, size); node->c_hash = hash; _PyObject_GC_TRACK(node); @@ -1583,7 +1583,7 @@ hamt_node_collision_dealloc(PyHamtNode_Collision *self) Py_ssize_t len = Py_SIZE(self); PyObject_GC_UnTrack(self); - Py_TRASHCAN_BEGIN(self, hamt_node_collision_dealloc) + Py_TRASHCAN_BEGIN(self, hamt_node_collision_dealloc) if (len > 0) { @@ -1593,7 +1593,7 @@ hamt_node_collision_dealloc(PyHamtNode_Collision *self) } Py_TYPE(self)->tp_free((PyObject *)self); - Py_TRASHCAN_END + Py_TRASHCAN_END } #ifdef Py_DEBUG @@ -1863,7 +1863,7 @@ hamt_node_array_without(PyHamtNode_Array *self, continue; } - bitmap |= 1U << i; + bitmap |= 1U << i; if (IS_BITMAP_NODE(node)) { PyHamtNode_Bitmap *child = (PyHamtNode_Bitmap *)node; @@ -1968,14 +1968,14 @@ hamt_node_array_dealloc(PyHamtNode_Array *self) Py_ssize_t i; PyObject_GC_UnTrack(self); - Py_TRASHCAN_BEGIN(self, hamt_node_array_dealloc) + Py_TRASHCAN_BEGIN(self, hamt_node_array_dealloc) for (i = 0; i < HAMT_ARRAY_NODE_SIZE; i++) { Py_XDECREF(self->a_array[i]); } Py_TYPE(self)->tp_free((PyObject *)self); - Py_TRASHCAN_END + Py_TRASHCAN_END } #ifdef Py_DEBUG @@ -2004,7 +2004,7 @@ hamt_node_array_dump(PyHamtNode_Array *node, goto error; } - if (_hamt_dump_format(writer, "%zd::\n", i)) { + if (_hamt_dump_format(writer, "%zd::\n", i)) { goto error; } diff --git a/contrib/tools/python3/src/Python/hashtable.c b/contrib/tools/python3/src/Python/hashtable.c index 3e22b65180..09501de199 100644 --- a/contrib/tools/python3/src/Python/hashtable.c +++ b/contrib/tools/python3/src/Python/hashtable.c @@ -1,417 +1,417 @@ -/* The implementation of the hash table (_Py_hashtable_t) is based on the - cfuhash project: - http://sourceforge.net/projects/libcfu/ - - Copyright of cfuhash: - ---------------------------------- - Creation date: 2005-06-24 21:22:40 - Authors: Don - Change log: - - Copyright (c) 2005 Don Owens - All rights reserved. - - This code is released under the BSD license: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of the author nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------- -*/ - -#include "Python.h" -#include "pycore_hashtable.h" - -#define HASHTABLE_MIN_SIZE 16 -#define HASHTABLE_HIGH 0.50 -#define HASHTABLE_LOW 0.10 -#define HASHTABLE_REHASH_FACTOR 2.0 / (HASHTABLE_LOW + HASHTABLE_HIGH) - -#define BUCKETS_HEAD(SLIST) \ - ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(SLIST))) -#define TABLE_HEAD(HT, BUCKET) \ - ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(HT)->buckets[BUCKET])) -#define ENTRY_NEXT(ENTRY) \ - ((_Py_hashtable_entry_t *)_Py_SLIST_ITEM_NEXT(ENTRY)) - -/* Forward declaration */ -static int hashtable_rehash(_Py_hashtable_t *ht); - -static void -_Py_slist_init(_Py_slist_t *list) -{ - list->head = NULL; -} - - -static void -_Py_slist_prepend(_Py_slist_t *list, _Py_slist_item_t *item) -{ - item->next = list->head; - list->head = item; -} - - -static void -_Py_slist_remove(_Py_slist_t *list, _Py_slist_item_t *previous, - _Py_slist_item_t *item) -{ - if (previous != NULL) - previous->next = item->next; - else - list->head = item->next; -} - - -Py_uhash_t -_Py_hashtable_hash_ptr(const void *key) -{ - return (Py_uhash_t)_Py_HashPointerRaw(key); -} - - -int -_Py_hashtable_compare_direct(const void *key1, const void *key2) -{ - return (key1 == key2); -} - - -/* makes sure the real size of the buckets array is a power of 2 */ -static size_t -round_size(size_t s) -{ - size_t i; - if (s < HASHTABLE_MIN_SIZE) - return HASHTABLE_MIN_SIZE; - i = 1; - while (i < s) - i <<= 1; - return i; -} - - -size_t -_Py_hashtable_size(const _Py_hashtable_t *ht) -{ - size_t size = sizeof(_Py_hashtable_t); - /* buckets */ - size += ht->nbuckets * sizeof(_Py_hashtable_entry_t *); - /* entries */ - size += ht->nentries * sizeof(_Py_hashtable_entry_t); - return size; -} - - -_Py_hashtable_entry_t * -_Py_hashtable_get_entry_generic(_Py_hashtable_t *ht, const void *key) -{ - Py_uhash_t key_hash = ht->hash_func(key); - size_t index = key_hash & (ht->nbuckets - 1); - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); - while (1) { - if (entry == NULL) { - return NULL; - } - if (entry->key_hash == key_hash && ht->compare_func(key, entry->key)) { - break; - } - entry = ENTRY_NEXT(entry); - } - return entry; -} - - -// Specialized for: -// hash_func == _Py_hashtable_hash_ptr -// compare_func == _Py_hashtable_compare_direct -static _Py_hashtable_entry_t * -_Py_hashtable_get_entry_ptr(_Py_hashtable_t *ht, const void *key) -{ - Py_uhash_t key_hash = _Py_hashtable_hash_ptr(key); - size_t index = key_hash & (ht->nbuckets - 1); - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); - while (1) { - if (entry == NULL) { - return NULL; - } - // Compare directly keys (ignore entry->key_hash) - if (entry->key == key) { - break; - } - entry = ENTRY_NEXT(entry); - } - return entry; -} - - -void* -_Py_hashtable_steal(_Py_hashtable_t *ht, const void *key) -{ - Py_uhash_t key_hash = ht->hash_func(key); - size_t index = key_hash & (ht->nbuckets - 1); - - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); - _Py_hashtable_entry_t *previous = NULL; - while (1) { - if (entry == NULL) { - // not found - return NULL; - } - if (entry->key_hash == key_hash && ht->compare_func(key, entry->key)) { - break; - } - previous = entry; - entry = ENTRY_NEXT(entry); - } - - _Py_slist_remove(&ht->buckets[index], (_Py_slist_item_t *)previous, - (_Py_slist_item_t *)entry); - ht->nentries--; - - void *value = entry->value; - ht->alloc.free(entry); - - if ((float)ht->nentries / (float)ht->nbuckets < HASHTABLE_LOW) { - // Ignore failure: error cannot be reported to the caller - hashtable_rehash(ht); - } - return value; -} - - -int -_Py_hashtable_set(_Py_hashtable_t *ht, const void *key, void *value) -{ - _Py_hashtable_entry_t *entry; - -#ifndef NDEBUG - /* Don't write the assertion on a single line because it is interesting - to know the duplicated entry if the assertion failed. The entry can - be read using a debugger. */ - entry = ht->get_entry_func(ht, key); - assert(entry == NULL); -#endif - - - entry = ht->alloc.malloc(sizeof(_Py_hashtable_entry_t)); - if (entry == NULL) { - /* memory allocation failed */ - return -1; - } - - entry->key_hash = ht->hash_func(key); - entry->key = (void *)key; - entry->value = value; - - ht->nentries++; - if ((float)ht->nentries / (float)ht->nbuckets > HASHTABLE_HIGH) { - if (hashtable_rehash(ht) < 0) { - ht->nentries--; - ht->alloc.free(entry); - return -1; - } - } - - size_t index = entry->key_hash & (ht->nbuckets - 1); - _Py_slist_prepend(&ht->buckets[index], (_Py_slist_item_t*)entry); - return 0; -} - - -void* -_Py_hashtable_get(_Py_hashtable_t *ht, const void *key) -{ - _Py_hashtable_entry_t *entry = ht->get_entry_func(ht, key); - if (entry != NULL) { - return entry->value; - } - else { - return NULL; - } -} - - -int -_Py_hashtable_foreach(_Py_hashtable_t *ht, - _Py_hashtable_foreach_func func, - void *user_data) -{ - for (size_t hv = 0; hv < ht->nbuckets; hv++) { - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, hv); - while (entry != NULL) { - int res = func(ht, entry->key, entry->value, user_data); - if (res) { - return res; - } - entry = ENTRY_NEXT(entry); - } - } - return 0; -} - - -static int -hashtable_rehash(_Py_hashtable_t *ht) -{ - size_t new_size = round_size((size_t)(ht->nentries * HASHTABLE_REHASH_FACTOR)); - if (new_size == ht->nbuckets) { - return 0; - } - - size_t buckets_size = new_size * sizeof(ht->buckets[0]); - _Py_slist_t *new_buckets = ht->alloc.malloc(buckets_size); - if (new_buckets == NULL) { - /* memory allocation failed */ - return -1; - } - memset(new_buckets, 0, buckets_size); - - for (size_t bucket = 0; bucket < ht->nbuckets; bucket++) { - _Py_hashtable_entry_t *entry = BUCKETS_HEAD(ht->buckets[bucket]); - while (entry != NULL) { - assert(ht->hash_func(entry->key) == entry->key_hash); - _Py_hashtable_entry_t *next = ENTRY_NEXT(entry); - size_t entry_index = entry->key_hash & (new_size - 1); - - _Py_slist_prepend(&new_buckets[entry_index], (_Py_slist_item_t*)entry); - - entry = next; - } - } - - ht->alloc.free(ht->buckets); - ht->nbuckets = new_size; - ht->buckets = new_buckets; - return 0; -} - - -_Py_hashtable_t * -_Py_hashtable_new_full(_Py_hashtable_hash_func hash_func, - _Py_hashtable_compare_func compare_func, - _Py_hashtable_destroy_func key_destroy_func, - _Py_hashtable_destroy_func value_destroy_func, - _Py_hashtable_allocator_t *allocator) -{ - _Py_hashtable_allocator_t alloc; - if (allocator == NULL) { - alloc.malloc = PyMem_Malloc; - alloc.free = PyMem_Free; - } - else { - alloc = *allocator; - } - - _Py_hashtable_t *ht = (_Py_hashtable_t *)alloc.malloc(sizeof(_Py_hashtable_t)); - if (ht == NULL) { - return ht; - } - - ht->nbuckets = HASHTABLE_MIN_SIZE; - ht->nentries = 0; - - size_t buckets_size = ht->nbuckets * sizeof(ht->buckets[0]); - ht->buckets = alloc.malloc(buckets_size); - if (ht->buckets == NULL) { - alloc.free(ht); - return NULL; - } - memset(ht->buckets, 0, buckets_size); - - ht->get_entry_func = _Py_hashtable_get_entry_generic; - ht->hash_func = hash_func; - ht->compare_func = compare_func; - ht->key_destroy_func = key_destroy_func; - ht->value_destroy_func = value_destroy_func; - ht->alloc = alloc; - if (ht->hash_func == _Py_hashtable_hash_ptr - && ht->compare_func == _Py_hashtable_compare_direct) - { - ht->get_entry_func = _Py_hashtable_get_entry_ptr; - } - return ht; -} - - -_Py_hashtable_t * -_Py_hashtable_new(_Py_hashtable_hash_func hash_func, - _Py_hashtable_compare_func compare_func) -{ - return _Py_hashtable_new_full(hash_func, compare_func, - NULL, NULL, NULL); -} - - -static void -_Py_hashtable_destroy_entry(_Py_hashtable_t *ht, _Py_hashtable_entry_t *entry) -{ - if (ht->key_destroy_func) { - ht->key_destroy_func(entry->key); - } - if (ht->value_destroy_func) { - ht->value_destroy_func(entry->value); - } - ht->alloc.free(entry); -} - - -void -_Py_hashtable_clear(_Py_hashtable_t *ht) -{ - for (size_t i=0; i < ht->nbuckets; i++) { - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, i); - while (entry != NULL) { - _Py_hashtable_entry_t *next = ENTRY_NEXT(entry); - _Py_hashtable_destroy_entry(ht, entry); - entry = next; - } - _Py_slist_init(&ht->buckets[i]); - } - ht->nentries = 0; - // Ignore failure: clear function is not expected to fail - // because of a memory allocation failure. - (void)hashtable_rehash(ht); -} - - -void -_Py_hashtable_destroy(_Py_hashtable_t *ht) -{ - for (size_t i = 0; i < ht->nbuckets; i++) { - _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, i); - while (entry) { - _Py_hashtable_entry_t *entry_next = ENTRY_NEXT(entry); - _Py_hashtable_destroy_entry(ht, entry); - entry = entry_next; - } - } - - ht->alloc.free(ht->buckets); - ht->alloc.free(ht); -} +/* The implementation of the hash table (_Py_hashtable_t) is based on the + cfuhash project: + http://sourceforge.net/projects/libcfu/ + + Copyright of cfuhash: + ---------------------------------- + Creation date: 2005-06-24 21:22:40 + Authors: Don + Change log: + + Copyright (c) 2005 Don Owens + All rights reserved. + + This code is released under the BSD license: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ---------------------------------- +*/ + +#include "Python.h" +#include "pycore_hashtable.h" + +#define HASHTABLE_MIN_SIZE 16 +#define HASHTABLE_HIGH 0.50 +#define HASHTABLE_LOW 0.10 +#define HASHTABLE_REHASH_FACTOR 2.0 / (HASHTABLE_LOW + HASHTABLE_HIGH) + +#define BUCKETS_HEAD(SLIST) \ + ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(SLIST))) +#define TABLE_HEAD(HT, BUCKET) \ + ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(HT)->buckets[BUCKET])) +#define ENTRY_NEXT(ENTRY) \ + ((_Py_hashtable_entry_t *)_Py_SLIST_ITEM_NEXT(ENTRY)) + +/* Forward declaration */ +static int hashtable_rehash(_Py_hashtable_t *ht); + +static void +_Py_slist_init(_Py_slist_t *list) +{ + list->head = NULL; +} + + +static void +_Py_slist_prepend(_Py_slist_t *list, _Py_slist_item_t *item) +{ + item->next = list->head; + list->head = item; +} + + +static void +_Py_slist_remove(_Py_slist_t *list, _Py_slist_item_t *previous, + _Py_slist_item_t *item) +{ + if (previous != NULL) + previous->next = item->next; + else + list->head = item->next; +} + + +Py_uhash_t +_Py_hashtable_hash_ptr(const void *key) +{ + return (Py_uhash_t)_Py_HashPointerRaw(key); +} + + +int +_Py_hashtable_compare_direct(const void *key1, const void *key2) +{ + return (key1 == key2); +} + + +/* makes sure the real size of the buckets array is a power of 2 */ +static size_t +round_size(size_t s) +{ + size_t i; + if (s < HASHTABLE_MIN_SIZE) + return HASHTABLE_MIN_SIZE; + i = 1; + while (i < s) + i <<= 1; + return i; +} + + +size_t +_Py_hashtable_size(const _Py_hashtable_t *ht) +{ + size_t size = sizeof(_Py_hashtable_t); + /* buckets */ + size += ht->nbuckets * sizeof(_Py_hashtable_entry_t *); + /* entries */ + size += ht->nentries * sizeof(_Py_hashtable_entry_t); + return size; +} + + +_Py_hashtable_entry_t * +_Py_hashtable_get_entry_generic(_Py_hashtable_t *ht, const void *key) +{ + Py_uhash_t key_hash = ht->hash_func(key); + size_t index = key_hash & (ht->nbuckets - 1); + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); + while (1) { + if (entry == NULL) { + return NULL; + } + if (entry->key_hash == key_hash && ht->compare_func(key, entry->key)) { + break; + } + entry = ENTRY_NEXT(entry); + } + return entry; +} + + +// Specialized for: +// hash_func == _Py_hashtable_hash_ptr +// compare_func == _Py_hashtable_compare_direct +static _Py_hashtable_entry_t * +_Py_hashtable_get_entry_ptr(_Py_hashtable_t *ht, const void *key) +{ + Py_uhash_t key_hash = _Py_hashtable_hash_ptr(key); + size_t index = key_hash & (ht->nbuckets - 1); + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); + while (1) { + if (entry == NULL) { + return NULL; + } + // Compare directly keys (ignore entry->key_hash) + if (entry->key == key) { + break; + } + entry = ENTRY_NEXT(entry); + } + return entry; +} + + +void* +_Py_hashtable_steal(_Py_hashtable_t *ht, const void *key) +{ + Py_uhash_t key_hash = ht->hash_func(key); + size_t index = key_hash & (ht->nbuckets - 1); + + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, index); + _Py_hashtable_entry_t *previous = NULL; + while (1) { + if (entry == NULL) { + // not found + return NULL; + } + if (entry->key_hash == key_hash && ht->compare_func(key, entry->key)) { + break; + } + previous = entry; + entry = ENTRY_NEXT(entry); + } + + _Py_slist_remove(&ht->buckets[index], (_Py_slist_item_t *)previous, + (_Py_slist_item_t *)entry); + ht->nentries--; + + void *value = entry->value; + ht->alloc.free(entry); + + if ((float)ht->nentries / (float)ht->nbuckets < HASHTABLE_LOW) { + // Ignore failure: error cannot be reported to the caller + hashtable_rehash(ht); + } + return value; +} + + +int +_Py_hashtable_set(_Py_hashtable_t *ht, const void *key, void *value) +{ + _Py_hashtable_entry_t *entry; + +#ifndef NDEBUG + /* Don't write the assertion on a single line because it is interesting + to know the duplicated entry if the assertion failed. The entry can + be read using a debugger. */ + entry = ht->get_entry_func(ht, key); + assert(entry == NULL); +#endif + + + entry = ht->alloc.malloc(sizeof(_Py_hashtable_entry_t)); + if (entry == NULL) { + /* memory allocation failed */ + return -1; + } + + entry->key_hash = ht->hash_func(key); + entry->key = (void *)key; + entry->value = value; + + ht->nentries++; + if ((float)ht->nentries / (float)ht->nbuckets > HASHTABLE_HIGH) { + if (hashtable_rehash(ht) < 0) { + ht->nentries--; + ht->alloc.free(entry); + return -1; + } + } + + size_t index = entry->key_hash & (ht->nbuckets - 1); + _Py_slist_prepend(&ht->buckets[index], (_Py_slist_item_t*)entry); + return 0; +} + + +void* +_Py_hashtable_get(_Py_hashtable_t *ht, const void *key) +{ + _Py_hashtable_entry_t *entry = ht->get_entry_func(ht, key); + if (entry != NULL) { + return entry->value; + } + else { + return NULL; + } +} + + +int +_Py_hashtable_foreach(_Py_hashtable_t *ht, + _Py_hashtable_foreach_func func, + void *user_data) +{ + for (size_t hv = 0; hv < ht->nbuckets; hv++) { + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, hv); + while (entry != NULL) { + int res = func(ht, entry->key, entry->value, user_data); + if (res) { + return res; + } + entry = ENTRY_NEXT(entry); + } + } + return 0; +} + + +static int +hashtable_rehash(_Py_hashtable_t *ht) +{ + size_t new_size = round_size((size_t)(ht->nentries * HASHTABLE_REHASH_FACTOR)); + if (new_size == ht->nbuckets) { + return 0; + } + + size_t buckets_size = new_size * sizeof(ht->buckets[0]); + _Py_slist_t *new_buckets = ht->alloc.malloc(buckets_size); + if (new_buckets == NULL) { + /* memory allocation failed */ + return -1; + } + memset(new_buckets, 0, buckets_size); + + for (size_t bucket = 0; bucket < ht->nbuckets; bucket++) { + _Py_hashtable_entry_t *entry = BUCKETS_HEAD(ht->buckets[bucket]); + while (entry != NULL) { + assert(ht->hash_func(entry->key) == entry->key_hash); + _Py_hashtable_entry_t *next = ENTRY_NEXT(entry); + size_t entry_index = entry->key_hash & (new_size - 1); + + _Py_slist_prepend(&new_buckets[entry_index], (_Py_slist_item_t*)entry); + + entry = next; + } + } + + ht->alloc.free(ht->buckets); + ht->nbuckets = new_size; + ht->buckets = new_buckets; + return 0; +} + + +_Py_hashtable_t * +_Py_hashtable_new_full(_Py_hashtable_hash_func hash_func, + _Py_hashtable_compare_func compare_func, + _Py_hashtable_destroy_func key_destroy_func, + _Py_hashtable_destroy_func value_destroy_func, + _Py_hashtable_allocator_t *allocator) +{ + _Py_hashtable_allocator_t alloc; + if (allocator == NULL) { + alloc.malloc = PyMem_Malloc; + alloc.free = PyMem_Free; + } + else { + alloc = *allocator; + } + + _Py_hashtable_t *ht = (_Py_hashtable_t *)alloc.malloc(sizeof(_Py_hashtable_t)); + if (ht == NULL) { + return ht; + } + + ht->nbuckets = HASHTABLE_MIN_SIZE; + ht->nentries = 0; + + size_t buckets_size = ht->nbuckets * sizeof(ht->buckets[0]); + ht->buckets = alloc.malloc(buckets_size); + if (ht->buckets == NULL) { + alloc.free(ht); + return NULL; + } + memset(ht->buckets, 0, buckets_size); + + ht->get_entry_func = _Py_hashtable_get_entry_generic; + ht->hash_func = hash_func; + ht->compare_func = compare_func; + ht->key_destroy_func = key_destroy_func; + ht->value_destroy_func = value_destroy_func; + ht->alloc = alloc; + if (ht->hash_func == _Py_hashtable_hash_ptr + && ht->compare_func == _Py_hashtable_compare_direct) + { + ht->get_entry_func = _Py_hashtable_get_entry_ptr; + } + return ht; +} + + +_Py_hashtable_t * +_Py_hashtable_new(_Py_hashtable_hash_func hash_func, + _Py_hashtable_compare_func compare_func) +{ + return _Py_hashtable_new_full(hash_func, compare_func, + NULL, NULL, NULL); +} + + +static void +_Py_hashtable_destroy_entry(_Py_hashtable_t *ht, _Py_hashtable_entry_t *entry) +{ + if (ht->key_destroy_func) { + ht->key_destroy_func(entry->key); + } + if (ht->value_destroy_func) { + ht->value_destroy_func(entry->value); + } + ht->alloc.free(entry); +} + + +void +_Py_hashtable_clear(_Py_hashtable_t *ht) +{ + for (size_t i=0; i < ht->nbuckets; i++) { + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, i); + while (entry != NULL) { + _Py_hashtable_entry_t *next = ENTRY_NEXT(entry); + _Py_hashtable_destroy_entry(ht, entry); + entry = next; + } + _Py_slist_init(&ht->buckets[i]); + } + ht->nentries = 0; + // Ignore failure: clear function is not expected to fail + // because of a memory allocation failure. + (void)hashtable_rehash(ht); +} + + +void +_Py_hashtable_destroy(_Py_hashtable_t *ht) +{ + for (size_t i = 0; i < ht->nbuckets; i++) { + _Py_hashtable_entry_t *entry = TABLE_HEAD(ht, i); + while (entry) { + _Py_hashtable_entry_t *entry_next = ENTRY_NEXT(entry); + _Py_hashtable_destroy_entry(ht, entry); + entry = entry_next; + } + } + + ht->alloc.free(ht->buckets); + ht->alloc.free(ht); +} diff --git a/contrib/tools/python3/src/Python/import.c b/contrib/tools/python3/src/Python/import.c index a6e0841b72..e4dbf4b0d8 100644 --- a/contrib/tools/python3/src/Python/import.c +++ b/contrib/tools/python3/src/Python/import.c @@ -3,15 +3,15 @@ #include "Python.h" #include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ -#include "pycore_initconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pyhash.h" -#include "pycore_pylifecycle.h" -#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() -#include "pycore_interp.h" // _PyInterpreterState_ClearModules() -#include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_sysmodule.h" +#undef Yield /* undefine macro conflicting with <winbase.h> */ +#include "pycore_initconfig.h" +#include "pycore_pyerrors.h" +#include "pycore_pyhash.h" +#include "pycore_pylifecycle.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "pycore_interp.h" // _PyInterpreterState_ClearModules() +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_sysmodule.h" #include "errcode.h" #include "marshal.h" #include "code.h" @@ -27,9 +27,9 @@ extern "C" { #define CACHEDIR "__pycache__" -/* Forward references */ -static PyObject *import_add_module(PyThreadState *tstate, PyObject *name); - +/* Forward references */ +static PyObject *import_add_module(PyThreadState *tstate, PyObject *name); + /* See _PyImport_FixupExtensionObject() below */ static PyObject *extensions = NULL; @@ -39,9 +39,9 @@ extern struct _inittab _PyImport_Inittab[]; struct _inittab *PyImport_Inittab = _PyImport_Inittab; static struct _inittab *inittab_copy = NULL; -_Py_IDENTIFIER(__path__); -_Py_IDENTIFIER(__spec__); - +_Py_IDENTIFIER(__path__); +_Py_IDENTIFIER(__spec__); + /*[clinic input] module _imp [clinic start generated code]*/ @@ -51,8 +51,8 @@ module _imp /* Initialize things */ -PyStatus -_PyImportHooks_Init(PyThreadState *tstate) +PyStatus +_PyImportHooks_Init(PyThreadState *tstate) { PyObject *v, *path_hooks = NULL; int err = 0; @@ -80,49 +80,49 @@ _PyImportHooks_Init(PyThreadState *tstate) goto error; } Py_DECREF(path_hooks); - return _PyStatus_OK(); + return _PyStatus_OK(); error: - _PyErr_Print(tstate); - return _PyStatus_ERR("initializing sys.meta_path, sys.path_hooks, " + _PyErr_Print(tstate); + return _PyStatus_ERR("initializing sys.meta_path, sys.path_hooks, " "or path_importer_cache failed"); } -PyStatus -_PyImportZip_Init(PyThreadState *tstate) +PyStatus +_PyImportZip_Init(PyThreadState *tstate) { - PyObject *path_hooks, *zipimport; + PyObject *path_hooks, *zipimport; int err = 0; path_hooks = PySys_GetObject("path_hooks"); if (path_hooks == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "unable to get sys.path_hooks"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "unable to get sys.path_hooks"); goto error; } - int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; - if (verbose) { + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; + if (verbose) { PySys_WriteStderr("# installing zipimport hook\n"); - } + } - zipimport = PyImport_ImportModule("zipimport"); - if (zipimport == NULL) { - _PyErr_Clear(tstate); /* No zip import module -- okay */ - if (verbose) { + zipimport = PyImport_ImportModule("zipimport"); + if (zipimport == NULL) { + _PyErr_Clear(tstate); /* No zip import module -- okay */ + if (verbose) { PySys_WriteStderr("# can't import zipimport\n"); - } + } } else { _Py_IDENTIFIER(zipimporter); - PyObject *zipimporter = _PyObject_GetAttrId(zipimport, + PyObject *zipimporter = _PyObject_GetAttrId(zipimport, &PyId_zipimporter); - Py_DECREF(zipimport); + Py_DECREF(zipimport); if (zipimporter == NULL) { - _PyErr_Clear(tstate); /* No zipimporter object -- okay */ - if (verbose) { - PySys_WriteStderr("# can't import zipimport.zipimporter\n"); - } + _PyErr_Clear(tstate); /* No zipimporter object -- okay */ + if (verbose) { + PySys_WriteStderr("# can't import zipimport.zipimporter\n"); + } } else { /* sys.path_hooks.insert(0, zipimporter) */ @@ -131,17 +131,17 @@ _PyImportZip_Init(PyThreadState *tstate) if (err < 0) { goto error; } - if (verbose) { - PySys_WriteStderr("# installed zipimport hook\n"); - } + if (verbose) { + PySys_WriteStderr("# installed zipimport hook\n"); + } } } - return _PyStatus_OK(); + return _PyStatus_OK(); error: PyErr_Print(); - return _PyStatus_ERR("initializing zipimport failed"); + return _PyStatus_ERR("initializing zipimport failed"); } /* Locking primitives to prevent parallel imports of the same module @@ -196,7 +196,7 @@ _PyImport_ReleaseLock(void) return 1; } -#ifdef HAVE_FORK +#ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child to ensure that newly created child processes do not share locks with the parent. We now acquire the import lock around fork() calls but on some platforms @@ -206,8 +206,8 @@ void _PyImport_ReInitLock(void) { if (import_lock != NULL) { - if (_PyThread_at_fork_reinit(&import_lock) < 0) { - _Py_FatalErrorFunc(__func__, "failed to create a new lock"); + if (_PyThread_at_fork_reinit(&import_lock) < 0) { + _Py_FatalErrorFunc(__func__, "failed to create a new lock"); } } if (import_lock_level > 1) { @@ -225,7 +225,7 @@ _PyImport_ReInitLock(void) import_lock_level = 0; } } -#endif +#endif /*[clinic input] _imp.lock_held @@ -296,12 +296,12 @@ _PyImport_Fini2(void) PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - // Reset PyImport_Inittab - PyImport_Inittab = _PyImport_Inittab; - + // Reset PyImport_Inittab + PyImport_Inittab = _PyImport_Inittab; + /* Free memory allocated by PyImport_ExtendInittab() */ PyMem_RawFree(inittab_copy); - inittab_copy = NULL; + inittab_copy = NULL; PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } @@ -311,9 +311,9 @@ _PyImport_Fini2(void) PyObject * PyImport_GetModuleDict(void) { - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->modules == NULL) { - Py_FatalError("interpreter has no modules dictionary"); + Py_FatalError("interpreter has no modules dictionary"); } return interp->modules; } @@ -343,30 +343,30 @@ _PyImport_GetModuleId(struct _Py_Identifier *nameid) int _PyImport_SetModule(PyObject *name, PyObject *m) { - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *modules = tstate->interp->modules; + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *modules = tstate->interp->modules; return PyObject_SetItem(modules, name, m); } int _PyImport_SetModuleString(const char *name, PyObject *m) { - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *modules = tstate->interp->modules; + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *modules = tstate->interp->modules; return PyMapping_SetItemString(modules, name, m); } -static PyObject * -import_get_module(PyThreadState *tstate, PyObject *name) +static PyObject * +import_get_module(PyThreadState *tstate, PyObject *name) { - PyObject *modules = tstate->interp->modules; + PyObject *modules = tstate->interp->modules; if (modules == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "unable to get sys.modules"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "unable to get sys.modules"); return NULL; } - - PyObject *m; + + PyObject *m; Py_INCREF(modules); if (PyDict_CheckExact(modules)) { m = PyDict_GetItemWithError(modules, name); /* borrowed */ @@ -374,8 +374,8 @@ import_get_module(PyThreadState *tstate, PyObject *name) } else { m = PyObject_GetItem(modules, name); - if (m == NULL && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - _PyErr_Clear(tstate); + if (m == NULL && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + _PyErr_Clear(tstate); } } Py_DECREF(modules); @@ -383,35 +383,35 @@ import_get_module(PyThreadState *tstate, PyObject *name) } -static int -import_ensure_initialized(PyThreadState *tstate, PyObject *mod, PyObject *name) -{ - PyInterpreterState *interp = tstate->interp; - PyObject *spec; - - _Py_IDENTIFIER(_lock_unlock_module); - - /* Optimization: only call _bootstrap._lock_unlock_module() if - __spec__._initializing is true. - NOTE: because of this, initializing must be set *before* - stuffing the new module in sys.modules. - */ - spec = _PyObject_GetAttrId(mod, &PyId___spec__); - int busy = _PyModuleSpec_IsInitializing(spec); - Py_XDECREF(spec); - if (busy) { - /* Wait until module is done importing. */ - PyObject *value = _PyObject_CallMethodIdOneArg( - interp->importlib, &PyId__lock_unlock_module, name); - if (value == NULL) { - return -1; - } - Py_DECREF(value); - } - return 0; -} - - +static int +import_ensure_initialized(PyThreadState *tstate, PyObject *mod, PyObject *name) +{ + PyInterpreterState *interp = tstate->interp; + PyObject *spec; + + _Py_IDENTIFIER(_lock_unlock_module); + + /* Optimization: only call _bootstrap._lock_unlock_module() if + __spec__._initializing is true. + NOTE: because of this, initializing must be set *before* + stuffing the new module in sys.modules. + */ + spec = _PyObject_GetAttrId(mod, &PyId___spec__); + int busy = _PyModuleSpec_IsInitializing(spec); + Py_XDECREF(spec); + if (busy) { + /* Wait until module is done importing. */ + PyObject *value = _PyObject_CallMethodIdOneArg( + interp->importlib, &PyId__lock_unlock_module, name); + if (value == NULL) { + return -1; + } + Py_DECREF(value); + } + return 0; +} + + /* List of names to clear in sys */ static const char * const sys_deletes[] = { "path", "argv", "ps1", "ps2", @@ -431,14 +431,14 @@ static const char * const sys_files[] = { /* Un-initialize things, as good as we can */ void -_PyImport_Cleanup(PyThreadState *tstate) +_PyImport_Cleanup(PyThreadState *tstate) { - PyInterpreterState *interp = tstate->interp; - PyObject *modules = interp->modules; - if (modules == NULL) { - /* Already done */ - return; - } + PyInterpreterState *interp = tstate->interp; + PyObject *modules = interp->modules; + if (modules == NULL) { + /* Already done */ + return; + } /* Delete some special variables first. These are common places where user values hide and people complain when their @@ -448,37 +448,37 @@ _PyImport_Cleanup(PyThreadState *tstate) /* XXX Perhaps these precautions are obsolete. Who knows? */ - int verbose = _PyInterpreterState_GetConfig(interp)->verbose; - if (verbose) { + int verbose = _PyInterpreterState_GetConfig(interp)->verbose; + if (verbose) { PySys_WriteStderr("# clear builtins._\n"); - } + } if (PyDict_SetItemString(interp->builtins, "_", Py_None) < 0) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); } - const char * const *p; + const char * const *p; for (p = sys_deletes; *p != NULL; p++) { - if (verbose) { + if (verbose) { PySys_WriteStderr("# clear sys.%s\n", *p); - } + } if (PyDict_SetItemString(interp->sysdict, *p, Py_None) < 0) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); } } for (p = sys_files; *p != NULL; p+=2) { - if (verbose) { + if (verbose) { PySys_WriteStderr("# restore sys.%s\n", *p); - } - PyObject *value = _PyDict_GetItemStringWithError(interp->sysdict, - *(p+1)); - if (value == NULL) { - if (_PyErr_Occurred(tstate)) { - PyErr_WriteUnraisable(NULL); - } + } + PyObject *value = _PyDict_GetItemStringWithError(interp->sysdict, + *(p+1)); + if (value == NULL) { + if (_PyErr_Occurred(tstate)) { + PyErr_WriteUnraisable(NULL); + } value = Py_None; - } + } if (PyDict_SetItemString(interp->sysdict, *p, value) < 0) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); } } @@ -486,10 +486,10 @@ _PyImport_Cleanup(PyThreadState *tstate) modules when they are removed from sys.modules. The name is used for diagnosis messages (in verbose mode), while the weakref helps detect those modules which have been held alive. */ - PyObject *weaklist = PyList_New(0); - if (weaklist == NULL) { - PyErr_WriteUnraisable(NULL); - } + PyObject *weaklist = PyList_New(0); + if (weaklist == NULL) { + PyErr_WriteUnraisable(NULL); + } #define STORE_MODULE_WEAKREF(name, mod) \ if (weaklist != NULL) { \ @@ -497,31 +497,31 @@ _PyImport_Cleanup(PyThreadState *tstate) if (wr) { \ PyObject *tup = PyTuple_Pack(2, name, wr); \ if (!tup || PyList_Append(weaklist, tup) < 0) { \ - PyErr_WriteUnraisable(NULL); \ + PyErr_WriteUnraisable(NULL); \ } \ Py_XDECREF(tup); \ Py_DECREF(wr); \ } \ else { \ - PyErr_WriteUnraisable(NULL); \ + PyErr_WriteUnraisable(NULL); \ } \ } #define CLEAR_MODULE(name, mod) \ if (PyModule_Check(mod)) { \ - if (verbose && PyUnicode_Check(name)) { \ + if (verbose && PyUnicode_Check(name)) { \ PySys_FormatStderr("# cleanup[2] removing %U\n", name); \ - } \ + } \ STORE_MODULE_WEAKREF(name, mod); \ if (PyObject_SetItem(modules, name, Py_None) < 0) { \ - PyErr_WriteUnraisable(NULL); \ + PyErr_WriteUnraisable(NULL); \ } \ } /* Remove all modules from sys.modules, hoping that garbage collection can reclaim most of them. */ if (PyDict_CheckExact(modules)) { - Py_ssize_t pos = 0; - PyObject *key, *value; + Py_ssize_t pos = 0; + PyObject *key, *value; while (PyDict_Next(modules, &pos, &key, &value)) { CLEAR_MODULE(key, value); } @@ -529,14 +529,14 @@ _PyImport_Cleanup(PyThreadState *tstate) else { PyObject *iterator = PyObject_GetIter(modules); if (iterator == NULL) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); } else { - PyObject *key; + PyObject *key; while ((key = PyIter_Next(iterator))) { - PyObject *value = PyObject_GetItem(modules, key); + PyObject *value = PyObject_GetItem(modules, key); if (value == NULL) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); continue; } CLEAR_MODULE(key, value); @@ -544,7 +544,7 @@ _PyImport_Cleanup(PyThreadState *tstate) Py_DECREF(key); } if (PyErr_Occurred()) { - PyErr_WriteUnraisable(NULL); + PyErr_WriteUnraisable(NULL); } Py_DECREF(iterator); } @@ -556,26 +556,26 @@ _PyImport_Cleanup(PyThreadState *tstate) } else { _Py_IDENTIFIER(clear); - if (_PyObject_CallMethodIdNoArgs(modules, &PyId_clear) == NULL) { - PyErr_WriteUnraisable(NULL); - } + if (_PyObject_CallMethodIdNoArgs(modules, &PyId_clear) == NULL) { + PyErr_WriteUnraisable(NULL); + } } /* Restore the original builtins dict, to ensure that any user data gets cleared. */ - PyObject *dict = PyDict_Copy(interp->builtins); - if (dict == NULL) { - PyErr_WriteUnraisable(NULL); - } + PyObject *dict = PyDict_Copy(interp->builtins); + if (dict == NULL) { + PyErr_WriteUnraisable(NULL); + } PyDict_Clear(interp->builtins); - if (PyDict_Update(interp->builtins, interp->builtins_copy)) { - _PyErr_Clear(tstate); - } + if (PyDict_Update(interp->builtins, interp->builtins_copy)) { + _PyErr_Clear(tstate); + } Py_XDECREF(dict); /* Collect references */ _PyGC_CollectNoFail(); /* Dump GC stats before it's too late, since it uses the warnings machinery. */ - _PyGC_DumpShutdownStats(tstate); + _PyGC_DumpShutdownStats(tstate); /* Now, if there are any modules left alive, clear their globals to minimize potential leaks. All C extension modules actually end @@ -589,10 +589,10 @@ _PyImport_Cleanup(PyThreadState *tstate) module last. Likewise, we don't delete sys until the very end because it is implicitly referenced (e.g. by print). */ if (weaklist != NULL) { - Py_ssize_t i; - /* Since dict is ordered in CPython 3.6+, modules are saved in - importing order. First clear modules imported later. */ - for (i = PyList_GET_SIZE(weaklist) - 1; i >= 0; i--) { + Py_ssize_t i; + /* Since dict is ordered in CPython 3.6+, modules are saved in + importing order. First clear modules imported later. */ + for (i = PyList_GET_SIZE(weaklist) - 1; i >= 0; i--) { PyObject *tup = PyList_GET_ITEM(weaklist, i); PyObject *name = PyTuple_GET_ITEM(tup, 0); PyObject *mod = PyWeakref_GET_OBJECT(PyTuple_GET_ITEM(tup, 1)); @@ -603,9 +603,9 @@ _PyImport_Cleanup(PyThreadState *tstate) if (dict == interp->builtins || dict == interp->sysdict) continue; Py_INCREF(mod); - if (verbose && PyUnicode_Check(name)) { + if (verbose && PyUnicode_Check(name)) { PySys_FormatStderr("# cleanup[3] wiping %U\n", name); - } + } _PyModule_Clear(mod); Py_DECREF(mod); } @@ -613,18 +613,18 @@ _PyImport_Cleanup(PyThreadState *tstate) } /* Next, delete sys and builtins (in that order) */ - if (verbose) { + if (verbose) { PySys_FormatStderr("# cleanup[3] wiping sys\n"); - } + } _PyModule_ClearDict(interp->sysdict); - if (verbose) { + if (verbose) { PySys_FormatStderr("# cleanup[3] wiping builtins\n"); - } + } _PyModule_ClearDict(interp->builtins); - /* Clear module dict copies stored in the interpreter state */ - _PyInterpreterState_ClearModules(interp); - + /* Clear module dict copies stored in the interpreter state */ + _PyInterpreterState_ClearModules(interp); + /* Clear and delete the modules directory. Actual modules will still be there only if imported during the execution of some destructor. */ @@ -645,7 +645,7 @@ long PyImport_GetMagicNumber(void) { long res; - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyObject *external, *pyc_magic; external = PyObject_GetAttrString(interp->importlib, "_bootstrap_external"); @@ -688,66 +688,66 @@ PyImport_GetMagicTag(void) int _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name, - PyObject *filename, PyObject *modules) + PyObject *filename, PyObject *modules) { if (mod == NULL || !PyModule_Check(mod)) { PyErr_BadInternalCall(); return -1; } - - struct PyModuleDef *def = PyModule_GetDef(mod); + + struct PyModuleDef *def = PyModule_GetDef(mod); if (!def) { PyErr_BadInternalCall(); return -1; } - - PyThreadState *tstate = _PyThreadState_GET(); - if (PyObject_SetItem(modules, name, mod) < 0) { + + PyThreadState *tstate = _PyThreadState_GET(); + if (PyObject_SetItem(modules, name, mod) < 0) { return -1; - } - if (_PyState_AddModule(tstate, mod, def) < 0) { + } + if (_PyState_AddModule(tstate, mod, def) < 0) { PyMapping_DelItem(modules, name); return -1; } - - // bpo-44050: Extensions and def->m_base.m_copy can be updated - // when the extension module doesn't support sub-interpreters. - if (_Py_IsMainInterpreter(tstate) || def->m_size == -1) { - if (def->m_size == -1) { - if (def->m_base.m_copy) { - /* Somebody already imported the module, - likely under a different name. - XXX this should really not happen. */ - Py_CLEAR(def->m_base.m_copy); - } - PyObject *dict = PyModule_GetDict(mod); - if (dict == NULL) { - return -1; - } - def->m_base.m_copy = PyDict_Copy(dict); - if (def->m_base.m_copy == NULL) { - return -1; - } + + // bpo-44050: Extensions and def->m_base.m_copy can be updated + // when the extension module doesn't support sub-interpreters. + if (_Py_IsMainInterpreter(tstate) || def->m_size == -1) { + if (def->m_size == -1) { + if (def->m_base.m_copy) { + /* Somebody already imported the module, + likely under a different name. + XXX this should really not happen. */ + Py_CLEAR(def->m_base.m_copy); + } + PyObject *dict = PyModule_GetDict(mod); + if (dict == NULL) { + return -1; + } + def->m_base.m_copy = PyDict_Copy(dict); + if (def->m_base.m_copy == NULL) { + return -1; + } } - - if (extensions == NULL) { - extensions = PyDict_New(); - if (extensions == NULL) { - return -1; - } - } - - PyObject *key = PyTuple_Pack(2, filename, name); - if (key == NULL) { + + if (extensions == NULL) { + extensions = PyDict_New(); + if (extensions == NULL) { + return -1; + } + } + + PyObject *key = PyTuple_Pack(2, filename, name); + if (key == NULL) { return -1; - } - int res = PyDict_SetItem(extensions, key, (PyObject *)def); - Py_DECREF(key); - if (res < 0) { + } + int res = PyDict_SetItem(extensions, key, (PyObject *)def); + Py_DECREF(key); + if (res < 0) { return -1; - } + } } - + return 0; } @@ -764,32 +764,32 @@ _PyImport_FixupBuiltin(PyObject *mod, const char *name, PyObject *modules) return res; } -static PyObject * -import_find_extension(PyThreadState *tstate, PyObject *name, - PyObject *filename) +static PyObject * +import_find_extension(PyThreadState *tstate, PyObject *name, + PyObject *filename) { - if (extensions == NULL) { - return NULL; - } + if (extensions == NULL) { + return NULL; + } - PyObject *key = PyTuple_Pack(2, filename, name); - if (key == NULL) { + PyObject *key = PyTuple_Pack(2, filename, name); + if (key == NULL) { return NULL; - } - PyModuleDef* def = (PyModuleDef *)PyDict_GetItemWithError(extensions, key); + } + PyModuleDef* def = (PyModuleDef *)PyDict_GetItemWithError(extensions, key); Py_DECREF(key); - if (def == NULL) { + if (def == NULL) { return NULL; - } - - PyObject *mod, *mdict; - PyObject *modules = tstate->interp->modules; - + } + + PyObject *mod, *mdict; + PyObject *modules = tstate->interp->modules; + if (def->m_size == -1) { /* Module does not support repeated initialization */ if (def->m_base.m_copy == NULL) return NULL; - mod = import_add_module(tstate, name); + mod = import_add_module(tstate, name); if (mod == NULL) return NULL; mdict = PyModule_GetDict(mod); @@ -810,35 +810,35 @@ import_find_extension(PyThreadState *tstate, PyObject *name, } Py_DECREF(mod); } - if (_PyState_AddModule(tstate, mod, def) < 0) { + if (_PyState_AddModule(tstate, mod, def) < 0) { PyMapping_DelItem(modules, name); return NULL; } - - int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; - if (verbose) { + + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; + if (verbose) { PySys_FormatStderr("import %U # previously loaded (%R)\n", - name, filename); - } + name, filename); + } return mod; -} +} -PyObject * -_PyImport_FindExtensionObject(PyObject *name, PyObject *filename) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return import_find_extension(tstate, name, filename); +PyObject * +_PyImport_FindExtensionObject(PyObject *name, PyObject *filename) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return import_find_extension(tstate, name, filename); } - + PyObject * -_PyImport_FindBuiltin(PyThreadState *tstate, const char *name) +_PyImport_FindBuiltin(PyThreadState *tstate, const char *name) { PyObject *res, *nameobj; nameobj = PyUnicode_InternFromString(name); if (nameobj == NULL) return NULL; - res = import_find_extension(tstate, nameobj, nameobj); + res = import_find_extension(tstate, nameobj, nameobj); Py_DECREF(nameobj); return res; } @@ -849,15 +849,15 @@ _PyImport_FindBuiltin(PyThreadState *tstate, const char *name) Because the former action is most common, THIS DOES NOT RETURN A 'NEW' REFERENCE! */ -static PyObject * -import_add_module(PyThreadState *tstate, PyObject *name) +static PyObject * +import_add_module(PyThreadState *tstate, PyObject *name) { - PyObject *modules = tstate->interp->modules; - if (modules == NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "no import module dictionary"); - return NULL; - } + PyObject *modules = tstate->interp->modules; + if (modules == NULL) { + _PyErr_SetString(tstate, PyExc_RuntimeError, + "no import module dictionary"); + return NULL; + } PyObject *m; if (PyDict_CheckExact(modules)) { @@ -865,13 +865,13 @@ import_add_module(PyThreadState *tstate, PyObject *name) } else { m = PyObject_GetItem(modules, name); - // For backward-compatibility we copy the behavior + // For backward-compatibility we copy the behavior // of PyDict_GetItemWithError(). - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - _PyErr_Clear(tstate); + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + _PyErr_Clear(tstate); } } - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { return NULL; } if (m != NULL && PyModule_Check(m)) { @@ -890,49 +890,49 @@ import_add_module(PyThreadState *tstate, PyObject *name) } PyObject * -PyImport_AddModuleObject(PyObject *name) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return import_add_module(tstate, name); -} - - -PyObject * +PyImport_AddModuleObject(PyObject *name) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return import_add_module(tstate, name); +} + + +PyObject * PyImport_AddModule(const char *name) { - PyObject *nameobj = PyUnicode_FromString(name); - if (nameobj == NULL) { + PyObject *nameobj = PyUnicode_FromString(name); + if (nameobj == NULL) { return NULL; - } - PyObject *module = PyImport_AddModuleObject(nameobj); + } + PyObject *module = PyImport_AddModuleObject(nameobj); Py_DECREF(nameobj); return module; } -/* Remove name from sys.modules, if it's there. - * Can be called with an exception raised. - * If fail to remove name a new exception will be chained with the old - * exception, otherwise the old exception is preserved. - */ +/* Remove name from sys.modules, if it's there. + * Can be called with an exception raised. + * If fail to remove name a new exception will be chained with the old + * exception, otherwise the old exception is preserved. + */ static void -remove_module(PyThreadState *tstate, PyObject *name) +remove_module(PyThreadState *tstate, PyObject *name) { - PyObject *type, *value, *traceback; - _PyErr_Fetch(tstate, &type, &value, &traceback); - - PyObject *modules = tstate->interp->modules; - if (PyDict_CheckExact(modules)) { - PyObject *mod = _PyDict_Pop(modules, name, Py_None); - Py_XDECREF(mod); - } - else if (PyMapping_DelItem(modules, name) < 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - _PyErr_Clear(tstate); - } + PyObject *type, *value, *traceback; + _PyErr_Fetch(tstate, &type, &value, &traceback); + + PyObject *modules = tstate->interp->modules; + if (PyDict_CheckExact(modules)) { + PyObject *mod = _PyDict_Pop(modules, name, Py_None); + Py_XDECREF(mod); } - - _PyErr_ChainExceptions(type, value, traceback); + else if (PyMapping_DelItem(modules, name) < 0) { + if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + _PyErr_Clear(tstate); + } + } + + _PyErr_ChainExceptions(type, value, traceback); } @@ -986,18 +986,18 @@ PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, goto error; } else if (cpathobj != NULL) { - PyInterpreterState *interp = _PyInterpreterState_GET(); + PyInterpreterState *interp = _PyInterpreterState_GET(); _Py_IDENTIFIER(_get_sourcefile); if (interp == NULL) { - Py_FatalError("no current interpreter"); + Py_FatalError("no current interpreter"); } external= PyObject_GetAttrString(interp->importlib, "_bootstrap_external"); if (external != NULL) { - pathobj = _PyObject_CallMethodIdOneArg( - external, &PyId__get_sourcefile, cpathobj); + pathobj = _PyObject_CallMethodIdOneArg( + external, &PyId__get_sourcefile, cpathobj); Py_DECREF(external); } if (pathobj == NULL) @@ -1015,23 +1015,23 @@ error: } static PyObject * -module_dict_for_exec(PyThreadState *tstate, PyObject *name) +module_dict_for_exec(PyThreadState *tstate, PyObject *name) { - _Py_IDENTIFIER(__builtins__); + _Py_IDENTIFIER(__builtins__); PyObject *m, *d = NULL; - m = import_add_module(tstate, name); + m = import_add_module(tstate, name); if (m == NULL) return NULL; /* If the module is being reloaded, we get the old module back and re-use its dict to exec the new code. */ d = PyModule_GetDict(m); - if (_PyDict_GetItemIdWithError(d, &PyId___builtins__) == NULL) { - if (_PyErr_Occurred(tstate) || - _PyDict_SetItemId(d, &PyId___builtins__, - PyEval_GetBuiltins()) != 0) - { - remove_module(tstate, name); + if (_PyDict_GetItemIdWithError(d, &PyId___builtins__) == NULL) { + if (_PyErr_Occurred(tstate) || + _PyDict_SetItemId(d, &PyId___builtins__, + PyEval_GetBuiltins()) != 0) + { + remove_module(tstate, name); return NULL; } } @@ -1040,23 +1040,23 @@ module_dict_for_exec(PyThreadState *tstate, PyObject *name) } static PyObject * -exec_code_in_module(PyThreadState *tstate, PyObject *name, - PyObject *module_dict, PyObject *code_object) +exec_code_in_module(PyThreadState *tstate, PyObject *name, + PyObject *module_dict, PyObject *code_object) { PyObject *v, *m; v = PyEval_EvalCode(code_object, module_dict, module_dict); if (v == NULL) { - remove_module(tstate, name); + remove_module(tstate, name); return NULL; } Py_DECREF(v); - m = import_get_module(tstate, name); - if (m == NULL && !_PyErr_Occurred(tstate)) { - _PyErr_Format(tstate, PyExc_ImportError, - "Loaded module %R not found in sys.modules", - name); + m = import_get_module(tstate, name); + if (m == NULL && !_PyErr_Occurred(tstate)) { + _PyErr_Format(tstate, PyExc_ImportError, + "Loaded module %R not found in sys.modules", + name); } return m; @@ -1066,11 +1066,11 @@ PyObject* PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *d, *external, *res; _Py_IDENTIFIER(_fix_up_module); - d = module_dict_for_exec(tstate, name); + d = module_dict_for_exec(tstate, name); if (d == NULL) { return NULL; } @@ -1078,8 +1078,8 @@ PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname, if (pathname == NULL) { pathname = ((PyCodeObject *)co)->co_filename; } - external = PyObject_GetAttrString(tstate->interp->importlib, - "_bootstrap_external"); + external = PyObject_GetAttrString(tstate->interp->importlib, + "_bootstrap_external"); if (external == NULL) return NULL; res = _PyObject_CallMethodIdObjArgs(external, @@ -1088,7 +1088,7 @@ PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname, Py_DECREF(external); if (res != NULL) { Py_DECREF(res); - res = exec_code_in_module(tstate, name, d, co); + res = exec_code_in_module(tstate, name, d, co); } return res; } @@ -1187,8 +1187,8 @@ is_builtin(PyObject *name) Returns a borrowed reference. */ static PyObject * -get_path_importer(PyThreadState *tstate, PyObject *path_importer_cache, - PyObject *path_hooks, PyObject *p) +get_path_importer(PyThreadState *tstate, PyObject *path_importer_cache, + PyObject *path_hooks, PyObject *p) { PyObject *importer; Py_ssize_t j, nhooks; @@ -1201,8 +1201,8 @@ get_path_importer(PyThreadState *tstate, PyObject *path_importer_cache, if (nhooks < 0) return NULL; /* Shouldn't happen */ - importer = PyDict_GetItemWithError(path_importer_cache, p); - if (importer != NULL || _PyErr_Occurred(tstate)) + importer = PyDict_GetItemWithError(path_importer_cache, p); + if (importer != NULL || _PyErr_Occurred(tstate)) return importer; /* set path_importer_cache[p] to None to avoid recursion */ @@ -1213,14 +1213,14 @@ get_path_importer(PyThreadState *tstate, PyObject *path_importer_cache, PyObject *hook = PyList_GetItem(path_hooks, j); if (hook == NULL) return NULL; - importer = PyObject_CallOneArg(hook, p); + importer = PyObject_CallOneArg(hook, p); if (importer != NULL) break; - if (!_PyErr_ExceptionMatches(tstate, PyExc_ImportError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_ImportError)) { return NULL; } - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } if (importer == NULL) { return Py_None; @@ -1234,16 +1234,16 @@ get_path_importer(PyThreadState *tstate, PyObject *path_importer_cache, return importer; } -PyObject * -PyImport_GetImporter(PyObject *path) -{ - PyThreadState *tstate = _PyThreadState_GET(); +PyObject * +PyImport_GetImporter(PyObject *path) +{ + PyThreadState *tstate = _PyThreadState_GET(); PyObject *importer=NULL, *path_importer_cache=NULL, *path_hooks=NULL; path_importer_cache = PySys_GetObject("path_importer_cache"); path_hooks = PySys_GetObject("path_hooks"); if (path_importer_cache != NULL && path_hooks != NULL) { - importer = get_path_importer(tstate, path_importer_cache, + importer = get_path_importer(tstate, path_importer_cache, path_hooks, path); } Py_XINCREF(importer); /* get_path_importer returns a borrowed reference */ @@ -1263,7 +1263,7 @@ static PyObject * _imp_create_builtin(PyObject *module, PyObject *spec) /*[clinic end generated code: output=ace7ff22271e6f39 input=37f966f890384e47]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); struct _inittab *p; PyObject *name; const char *namestr; @@ -1275,7 +1275,7 @@ _imp_create_builtin(PyObject *module, PyObject *spec) } mod = _PyImport_FindExtensionObject(name, name); - if (mod || _PyErr_Occurred(tstate)) { + if (mod || _PyErr_Occurred(tstate)) { Py_DECREF(name); Py_XINCREF(mod); return mod; @@ -1287,7 +1287,7 @@ _imp_create_builtin(PyObject *module, PyObject *spec) return NULL; } - PyObject *modules = tstate->interp->modules; + PyObject *modules = tstate->interp->modules; for (p = PyImport_Inittab; p->name != NULL; p++) { PyModuleDef *def; if (_PyUnicode_EqualToASCIIString(name, p->name)) { @@ -1401,7 +1401,7 @@ is_frozen_package(PyObject *name) int PyImport_ImportFrozenModuleObject(PyObject *name) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); const struct _frozen *p; PyObject *co, *m, *d; int ispackage; @@ -1412,9 +1412,9 @@ PyImport_ImportFrozenModuleObject(PyObject *name) if (p == NULL) return 0; if (p->code == NULL) { - _PyErr_Format(tstate, PyExc_ImportError, - "Excluded frozen object named %R", - name); + _PyErr_Format(tstate, PyExc_ImportError, + "Excluded frozen object named %R", + name); return -1; } size = p->size; @@ -1425,16 +1425,16 @@ PyImport_ImportFrozenModuleObject(PyObject *name) if (co == NULL) return -1; if (!PyCode_Check(co)) { - _PyErr_Format(tstate, PyExc_TypeError, - "frozen object %R is not a code object", - name); + _PyErr_Format(tstate, PyExc_TypeError, + "frozen object %R is not a code object", + name); goto err_return; } if (ispackage) { /* Set __path__ to the empty list */ PyObject *l; int err; - m = import_add_module(tstate, name); + m = import_add_module(tstate, name); if (m == NULL) goto err_return; d = PyModule_GetDict(m); @@ -1447,18 +1447,18 @@ PyImport_ImportFrozenModuleObject(PyObject *name) if (err != 0) goto err_return; } - d = module_dict_for_exec(tstate, name); + d = module_dict_for_exec(tstate, name); if (d == NULL) { goto err_return; } - m = exec_code_in_module(tstate, name, d, co); - if (m == NULL) { + m = exec_code_in_module(tstate, name, d, co); + if (m == NULL) { goto err_return; - } + } Py_DECREF(co); Py_DECREF(m); return 1; - + err_return: Py_DECREF(co); return -1; @@ -1495,7 +1495,7 @@ PyImport_ImportModule(const char *name) return result; } - + /* Import a module without blocking * * At first it tries to fetch the module from sys.modules. If the module was @@ -1515,7 +1515,7 @@ PyImport_ImportModuleNoBlock(const char *name) /* Remove importlib frames from the traceback, * except in Verbose mode. */ static void -remove_importlib_frames(PyThreadState *tstate) +remove_importlib_frames(PyThreadState *tstate) { const char *importlib_filename = "<frozen importlib._bootstrap>"; const char *external_filename = "<frozen importlib._bootstrap_external>"; @@ -1530,11 +1530,11 @@ remove_importlib_frames(PyThreadState *tstate) from the traceback. We always trim chunks which end with a call to "_call_with_frames_removed". */ - _PyErr_Fetch(tstate, &exception, &value, &base_tb); - if (!exception || _PyInterpreterState_GetConfig(tstate->interp)->verbose) { + _PyErr_Fetch(tstate, &exception, &value, &base_tb); + if (!exception || _PyInterpreterState_GetConfig(tstate->interp)->verbose) { goto done; - } - + } + if (PyType_IsSubtype((PyTypeObject *) exception, (PyTypeObject *) PyExc_ImportError)) always_trim = 1; @@ -1545,7 +1545,7 @@ remove_importlib_frames(PyThreadState *tstate) PyTracebackObject *traceback = (PyTracebackObject *)tb; PyObject *next = (PyObject *) traceback->tb_next; PyFrameObject *frame = traceback->tb_frame; - PyCodeObject *code = PyFrame_GetCode(frame); + PyCodeObject *code = PyFrame_GetCode(frame); int now_in_importlib; assert(PyTraceBack_Check(tb)); @@ -1568,16 +1568,16 @@ remove_importlib_frames(PyThreadState *tstate) else { prev_link = (PyObject **) &traceback->tb_next; } - Py_DECREF(code); + Py_DECREF(code); tb = next; } done: - _PyErr_Restore(tstate, exception, value, base_tb); + _PyErr_Restore(tstate, exception, value, base_tb); } static PyObject * -resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level) +resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level) { _Py_IDENTIFIER(__package__); _Py_IDENTIFIER(__name__); @@ -1590,30 +1590,30 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level int level_up; if (globals == NULL) { - _PyErr_SetString(tstate, PyExc_KeyError, "'__name__' not in globals"); + _PyErr_SetString(tstate, PyExc_KeyError, "'__name__' not in globals"); goto error; } if (!PyDict_Check(globals)) { - _PyErr_SetString(tstate, PyExc_TypeError, "globals must be a dict"); + _PyErr_SetString(tstate, PyExc_TypeError, "globals must be a dict"); goto error; } - package = _PyDict_GetItemIdWithError(globals, &PyId___package__); + package = _PyDict_GetItemIdWithError(globals, &PyId___package__); if (package == Py_None) { package = NULL; } - else if (package == NULL && _PyErr_Occurred(tstate)) { - goto error; - } - spec = _PyDict_GetItemIdWithError(globals, &PyId___spec__); - if (spec == NULL && _PyErr_Occurred(tstate)) { - goto error; - } + else if (package == NULL && _PyErr_Occurred(tstate)) { + goto error; + } + spec = _PyDict_GetItemIdWithError(globals, &PyId___spec__); + if (spec == NULL && _PyErr_Occurred(tstate)) { + goto error; + } if (package != NULL) { Py_INCREF(package); if (!PyUnicode_Check(package)) { - _PyErr_SetString(tstate, PyExc_TypeError, - "package must be a string"); + _PyErr_SetString(tstate, PyExc_TypeError, + "package must be a string"); goto error; } else if (spec != NULL && spec != Py_None) { @@ -1642,8 +1642,8 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level goto error; } else if (!PyUnicode_Check(package)) { - _PyErr_SetString(tstate, PyExc_TypeError, - "__spec__.parent must be a string"); + _PyErr_SetString(tstate, PyExc_TypeError, + "__spec__.parent must be a string"); goto error; } } @@ -1654,26 +1654,26 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level goto error; } - package = _PyDict_GetItemIdWithError(globals, &PyId___name__); + package = _PyDict_GetItemIdWithError(globals, &PyId___name__); if (package == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_SetString(tstate, PyExc_KeyError, - "'__name__' not in globals"); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_SetString(tstate, PyExc_KeyError, + "'__name__' not in globals"); + } goto error; } Py_INCREF(package); if (!PyUnicode_Check(package)) { - _PyErr_SetString(tstate, PyExc_TypeError, - "__name__ must be a string"); + _PyErr_SetString(tstate, PyExc_TypeError, + "__name__ must be a string"); goto error; } - if (_PyDict_GetItemIdWithError(globals, &PyId___path__) == NULL) { + if (_PyDict_GetItemIdWithError(globals, &PyId___path__) == NULL) { Py_ssize_t dot; - if (_PyErr_Occurred(tstate) || PyUnicode_READY(package) < 0) { + if (_PyErr_Occurred(tstate) || PyUnicode_READY(package) < 0) { goto error; } @@ -1682,20 +1682,20 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level if (dot == -2) { goto error; } - else if (dot == -1) { - goto no_parent_error; + else if (dot == -1) { + goto no_parent_error; + } + PyObject *substr = PyUnicode_Substring(package, 0, dot); + if (substr == NULL) { + goto error; } - PyObject *substr = PyUnicode_Substring(package, 0, dot); - if (substr == NULL) { - goto error; - } - Py_SETREF(package, substr); + Py_SETREF(package, substr); } } last_dot = PyUnicode_GET_LENGTH(package); if (last_dot == 0) { - goto no_parent_error; + goto no_parent_error; } for (level_up = 1; level_up < level; level_up += 1) { @@ -1704,9 +1704,9 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level goto error; } else if (last_dot == -1) { - _PyErr_SetString(tstate, PyExc_ImportError, - "attempted relative import beyond top-level " - "package"); + _PyErr_SetString(tstate, PyExc_ImportError, + "attempted relative import beyond top-level " + "package"); goto error; } } @@ -1721,39 +1721,39 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level Py_DECREF(base); return abs_name; - no_parent_error: - _PyErr_SetString(tstate, PyExc_ImportError, - "attempted relative import " - "with no known parent package"); - + no_parent_error: + _PyErr_SetString(tstate, PyExc_ImportError, + "attempted relative import " + "with no known parent package"); + error: Py_XDECREF(package); return NULL; } static PyObject * -import_find_and_load(PyThreadState *tstate, PyObject *abs_name) +import_find_and_load(PyThreadState *tstate, PyObject *abs_name) { _Py_IDENTIFIER(_find_and_load); PyObject *mod = NULL; - PyInterpreterState *interp = tstate->interp; - int import_time = _PyInterpreterState_GetConfig(interp)->import_time; + PyInterpreterState *interp = tstate->interp; + int import_time = _PyInterpreterState_GetConfig(interp)->import_time; static int import_level; static _PyTime_t accumulated; _PyTime_t t1 = 0, accumulated_copy = accumulated; - PyObject *sys_path = PySys_GetObject("path"); - PyObject *sys_meta_path = PySys_GetObject("meta_path"); - PyObject *sys_path_hooks = PySys_GetObject("path_hooks"); - if (_PySys_Audit(tstate, "import", "OOOOO", - abs_name, Py_None, sys_path ? sys_path : Py_None, - sys_meta_path ? sys_meta_path : Py_None, - sys_path_hooks ? sys_path_hooks : Py_None) < 0) { - return NULL; - } - - + PyObject *sys_path = PySys_GetObject("path"); + PyObject *sys_meta_path = PySys_GetObject("meta_path"); + PyObject *sys_path_hooks = PySys_GetObject("path_hooks"); + if (_PySys_Audit(tstate, "import", "OOOOO", + abs_name, Py_None, sys_path ? sys_path : Py_None, + sys_meta_path ? sys_meta_path : Py_None, + sys_path_hooks ? sys_path_hooks : Py_None) < 0) { + return NULL; + } + + /* XOptions is initialized after first some imports. * So we can't have negative cache before completed initialization. * Anyway, importlib._find_and_load is much slower than @@ -1799,38 +1799,38 @@ import_find_and_load(PyThreadState *tstate, PyObject *abs_name) } PyObject * -PyImport_GetModule(PyObject *name) -{ - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *mod; - - mod = import_get_module(tstate, name); - if (mod != NULL && mod != Py_None) { - if (import_ensure_initialized(tstate, mod, name) < 0) { - Py_DECREF(mod); - remove_importlib_frames(tstate); - return NULL; - } - } - return mod; -} - -PyObject * +PyImport_GetModule(PyObject *name) +{ + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *mod; + + mod = import_get_module(tstate, name); + if (mod != NULL && mod != Py_None) { + if (import_ensure_initialized(tstate, mod, name) < 0) { + Py_DECREF(mod); + remove_importlib_frames(tstate); + return NULL; + } + } + return mod; +} + +PyObject * PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); _Py_IDENTIFIER(_handle_fromlist); PyObject *abs_name = NULL; PyObject *final_mod = NULL; PyObject *mod = NULL; PyObject *package = NULL; - PyInterpreterState *interp = tstate->interp; + PyInterpreterState *interp = tstate->interp; int has_from; if (name == NULL) { - _PyErr_SetString(tstate, PyExc_ValueError, "Empty module name"); + _PyErr_SetString(tstate, PyExc_ValueError, "Empty module name"); goto error; } @@ -1838,45 +1838,45 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, for added performance. */ if (!PyUnicode_Check(name)) { - _PyErr_SetString(tstate, PyExc_TypeError, - "module name must be a string"); + _PyErr_SetString(tstate, PyExc_TypeError, + "module name must be a string"); goto error; } if (PyUnicode_READY(name) < 0) { goto error; } if (level < 0) { - _PyErr_SetString(tstate, PyExc_ValueError, "level must be >= 0"); + _PyErr_SetString(tstate, PyExc_ValueError, "level must be >= 0"); goto error; } if (level > 0) { - abs_name = resolve_name(tstate, name, globals, level); + abs_name = resolve_name(tstate, name, globals, level); if (abs_name == NULL) goto error; } else { /* level == 0 */ if (PyUnicode_GET_LENGTH(name) == 0) { - _PyErr_SetString(tstate, PyExc_ValueError, "Empty module name"); + _PyErr_SetString(tstate, PyExc_ValueError, "Empty module name"); goto error; } abs_name = name; Py_INCREF(abs_name); } - mod = import_get_module(tstate, abs_name); - if (mod == NULL && _PyErr_Occurred(tstate)) { - goto error; - } - + mod = import_get_module(tstate, abs_name); + if (mod == NULL && _PyErr_Occurred(tstate)) { + goto error; + } + if (mod != NULL && mod != Py_None) { - if (import_ensure_initialized(tstate, mod, abs_name) < 0) { - goto error; + if (import_ensure_initialized(tstate, mod, abs_name) < 0) { + goto error; } } else { Py_XDECREF(mod); - mod = import_find_and_load(tstate, abs_name); + mod = import_find_and_load(tstate, abs_name); if (mod == NULL) { goto error; } @@ -1923,14 +1923,14 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, goto error; } - final_mod = import_get_module(tstate, to_return); + final_mod = import_get_module(tstate, to_return); Py_DECREF(to_return); if (final_mod == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_Format(tstate, PyExc_KeyError, - "%R not in sys.modules as expected", - to_return); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_Format(tstate, PyExc_KeyError, + "%R not in sys.modules as expected", + to_return); + } goto error; } } @@ -1941,29 +1941,29 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } } else { - PyObject *path; - if (_PyObject_LookupAttrId(mod, &PyId___path__, &path) < 0) { - goto error; - } - if (path) { - Py_DECREF(path); - final_mod = _PyObject_CallMethodIdObjArgs( - interp->importlib, &PyId__handle_fromlist, - mod, fromlist, interp->import_func, NULL); - } - else { - final_mod = mod; - Py_INCREF(mod); - } + PyObject *path; + if (_PyObject_LookupAttrId(mod, &PyId___path__, &path) < 0) { + goto error; + } + if (path) { + Py_DECREF(path); + final_mod = _PyObject_CallMethodIdObjArgs( + interp->importlib, &PyId__handle_fromlist, + mod, fromlist, interp->import_func, NULL); + } + else { + final_mod = mod; + Py_INCREF(mod); + } } error: Py_XDECREF(abs_name); Py_XDECREF(mod); Py_XDECREF(package); - if (final_mod == NULL) { - remove_importlib_frames(tstate); - } + if (final_mod == NULL) { + remove_importlib_frames(tstate); + } return final_mod; } @@ -1988,23 +1988,23 @@ PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals PyObject * PyImport_ReloadModule(PyObject *m) { - _Py_IDENTIFIER(importlib); + _Py_IDENTIFIER(importlib); _Py_IDENTIFIER(reload); PyObject *reloaded_module = NULL; - PyObject *importlib = _PyImport_GetModuleId(&PyId_importlib); - if (importlib == NULL) { - if (PyErr_Occurred()) { - return NULL; - } - - importlib = PyImport_ImportModule("importlib"); - if (importlib == NULL) { + PyObject *importlib = _PyImport_GetModuleId(&PyId_importlib); + if (importlib == NULL) { + if (PyErr_Occurred()) { + return NULL; + } + + importlib = PyImport_ImportModule("importlib"); + if (importlib == NULL) { return NULL; } } - reloaded_module = _PyObject_CallMethodIdOneArg(importlib, &PyId_reload, m); - Py_DECREF(importlib); + reloaded_module = _PyObject_CallMethodIdOneArg(importlib, &PyId_reload, m); + Py_DECREF(importlib); return reloaded_module; } @@ -2021,7 +2021,7 @@ PyImport_ReloadModule(PyObject *m) PyObject * PyImport_Import(PyObject *module_name) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); static PyObject *silly_list = NULL; static PyObject *builtins_str = NULL; static PyObject *import_str = NULL; @@ -2065,9 +2065,9 @@ PyImport_Import(PyObject *module_name) /* Get the __import__ function from the builtins */ if (PyDict_Check(builtins)) { import = PyObject_GetItem(builtins, import_str); - if (import == NULL) { - _PyErr_SetObject(tstate, PyExc_KeyError, import_str); - } + if (import == NULL) { + _PyErr_SetObject(tstate, PyExc_KeyError, import_str); + } } else import = PyObject_GetAttr(builtins, import_str); @@ -2083,9 +2083,9 @@ PyImport_Import(PyObject *module_name) goto err; Py_DECREF(r); - r = import_get_module(tstate, module_name); - if (r == NULL && !_PyErr_Occurred(tstate)) { - _PyErr_SetObject(tstate, PyExc_KeyError, module_name); + r = import_get_module(tstate, module_name); + if (r == NULL && !_PyErr_Occurred(tstate)) { + _PyErr_SetObject(tstate, PyExc_KeyError, module_name); } err: @@ -2112,9 +2112,9 @@ _imp_extension_suffixes_impl(PyObject *module) if (list == NULL) return NULL; #ifdef HAVE_DYNAMIC_LOADING - const char *suffix; - unsigned int index = 0; - + const char *suffix; + unsigned int index = 0; + while ((suffix = _PyImport_DynLoadFiletab[index])) { PyObject *item = PyUnicode_FromString(suffix); if (item == NULL) { @@ -2146,7 +2146,7 @@ static PyObject * _imp_init_frozen_impl(PyObject *module, PyObject *name) /*[clinic end generated code: output=fc0511ed869fd69c input=13019adfc04f3fb3]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int ret; PyObject *m; @@ -2156,7 +2156,7 @@ _imp_init_frozen_impl(PyObject *module, PyObject *name) if (ret == 0) { Py_RETURN_NONE; } - m = import_add_module(tstate, name); + m = import_add_module(tstate, name); Py_XINCREF(m); return m; } @@ -2415,16 +2415,16 @@ PyInit__imp(void) PyObject *m, *d; m = PyModule_Create(&impmodule); - if (m == NULL) { + if (m == NULL) { goto failure; - } + } d = PyModule_GetDict(m); - if (d == NULL) { + if (d == NULL) { goto failure; - } - - const wchar_t *mode = _Py_GetConfig()->check_hash_pycs_mode; - PyObject *pyc_mode = PyUnicode_FromWideChar(mode, -1); + } + + const wchar_t *mode = _Py_GetConfig()->check_hash_pycs_mode; + PyObject *pyc_mode = PyUnicode_FromWideChar(mode, -1); if (pyc_mode == NULL) { goto failure; } diff --git a/contrib/tools/python3/src/Python/importdl.c b/contrib/tools/python3/src/Python/importdl.c index 4ffa1ba287..134f6680c4 100644 --- a/contrib/tools/python3/src/Python/importdl.c +++ b/contrib/tools/python3/src/Python/importdl.c @@ -42,9 +42,9 @@ get_encoded_name(PyObject *name, const char **hook_prefix) { /* Get the short name (substring after last dot) */ name_len = PyUnicode_GetLength(name); - if (name_len < 0) { - return NULL; - } + if (name_len < 0) { + return NULL; + } lastdot = PyUnicode_FindChar(name, '.', 0, name_len, -1); if (lastdot < -1) { return NULL; @@ -122,11 +122,11 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) if (path == NULL) goto error; - if (PySys_Audit("import", "OOOOO", name_unicode, path, - Py_None, Py_None, Py_None) < 0) { - goto error; - } - + if (PySys_Audit("import", "OOOOO", name_unicode, path, + Py_None, Py_None, Py_None) < 0) { + goto error; + } + #ifdef MS_WINDOWS exportfunc = _PyImport_FindSharedFuncptrWindows(hook_prefix, name_buf, path, fp); @@ -184,7 +184,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) m = NULL; goto error; } - if (Py_IS_TYPE(m, NULL)) { + if (Py_IS_TYPE(m, NULL)) { /* This can happen when a PyModuleDef is returned without calling * PyModuleDef_Init on it */ @@ -207,7 +207,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) /* don't allow legacy init for non-ASCII module names */ PyErr_Format( PyExc_SystemError, - "initialization of %s did not return PyModuleDef", + "initialization of %s did not return PyModuleDef", name_buf); goto error; } diff --git a/contrib/tools/python3/src/Python/importlib.h b/contrib/tools/python3/src/Python/importlib.h index 75aeacaffb..1fb877a753 100644 --- a/contrib/tools/python3/src/Python/importlib.h +++ b/contrib/tools/python3/src/Python/importlib.h @@ -1,1812 +1,1812 @@ /* Auto-generated by Programs/_freeze_importlib.c */ -const unsigned char _Py_M__importlib_bootstrap[] = { - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,4,0,0,0,64,0,0,0,115,194,1,0,0,100,0, - 90,0,100,1,97,1,100,2,100,3,132,0,90,2,100,4, - 100,5,132,0,90,3,105,0,90,4,105,0,90,5,71,0, - 100,6,100,7,132,0,100,7,101,6,131,3,90,7,71,0, - 100,8,100,9,132,0,100,9,131,2,90,8,71,0,100,10, - 100,11,132,0,100,11,131,2,90,9,71,0,100,12,100,13, - 132,0,100,13,131,2,90,10,100,14,100,15,132,0,90,11, - 100,16,100,17,132,0,90,12,100,18,100,19,132,0,90,13, - 100,20,100,21,156,1,100,22,100,23,132,2,90,14,100,24, - 100,25,132,0,90,15,100,26,100,27,132,0,90,16,100,28, - 100,29,132,0,90,17,100,30,100,31,132,0,90,18,71,0, - 100,32,100,33,132,0,100,33,131,2,90,19,100,1,100,1, - 100,34,156,2,100,35,100,36,132,2,90,20,100,94,100,37, - 100,38,132,1,90,21,100,39,100,40,156,1,100,41,100,42, - 132,2,90,22,100,43,100,44,132,0,90,23,100,45,100,46, - 132,0,90,24,100,47,100,48,132,0,90,25,100,49,100,50, - 132,0,90,26,100,51,100,52,132,0,90,27,100,53,100,54, - 132,0,90,28,71,0,100,55,100,56,132,0,100,56,131,2, - 90,29,71,0,100,57,100,58,132,0,100,58,131,2,90,30, - 71,0,100,59,100,60,132,0,100,60,131,2,90,31,100,61, - 100,62,132,0,90,32,100,63,100,64,132,0,90,33,100,95, - 100,65,100,66,132,1,90,34,100,67,100,68,132,0,90,35, - 100,69,90,36,101,36,100,70,23,0,90,37,100,71,100,72, - 132,0,90,38,101,39,131,0,90,40,100,73,100,74,132,0, - 90,41,100,96,100,76,100,77,132,1,90,42,100,39,100,78, - 156,1,100,79,100,80,132,2,90,43,100,81,100,82,132,0, - 90,44,100,97,100,84,100,85,132,1,90,45,100,86,100,87, - 132,0,90,46,100,88,100,89,132,0,90,47,100,90,100,91, - 132,0,90,48,100,92,100,93,132,0,90,49,100,1,83,0, - 41,98,97,83,1,0,0,67,111,114,101,32,105,109,112,108, +const unsigned char _Py_M__importlib_bootstrap[] = { + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,4,0,0,0,64,0,0,0,115,194,1,0,0,100,0, + 90,0,100,1,97,1,100,2,100,3,132,0,90,2,100,4, + 100,5,132,0,90,3,105,0,90,4,105,0,90,5,71,0, + 100,6,100,7,132,0,100,7,101,6,131,3,90,7,71,0, + 100,8,100,9,132,0,100,9,131,2,90,8,71,0,100,10, + 100,11,132,0,100,11,131,2,90,9,71,0,100,12,100,13, + 132,0,100,13,131,2,90,10,100,14,100,15,132,0,90,11, + 100,16,100,17,132,0,90,12,100,18,100,19,132,0,90,13, + 100,20,100,21,156,1,100,22,100,23,132,2,90,14,100,24, + 100,25,132,0,90,15,100,26,100,27,132,0,90,16,100,28, + 100,29,132,0,90,17,100,30,100,31,132,0,90,18,71,0, + 100,32,100,33,132,0,100,33,131,2,90,19,100,1,100,1, + 100,34,156,2,100,35,100,36,132,2,90,20,100,94,100,37, + 100,38,132,1,90,21,100,39,100,40,156,1,100,41,100,42, + 132,2,90,22,100,43,100,44,132,0,90,23,100,45,100,46, + 132,0,90,24,100,47,100,48,132,0,90,25,100,49,100,50, + 132,0,90,26,100,51,100,52,132,0,90,27,100,53,100,54, + 132,0,90,28,71,0,100,55,100,56,132,0,100,56,131,2, + 90,29,71,0,100,57,100,58,132,0,100,58,131,2,90,30, + 71,0,100,59,100,60,132,0,100,60,131,2,90,31,100,61, + 100,62,132,0,90,32,100,63,100,64,132,0,90,33,100,95, + 100,65,100,66,132,1,90,34,100,67,100,68,132,0,90,35, + 100,69,90,36,101,36,100,70,23,0,90,37,100,71,100,72, + 132,0,90,38,101,39,131,0,90,40,100,73,100,74,132,0, + 90,41,100,96,100,76,100,77,132,1,90,42,100,39,100,78, + 156,1,100,79,100,80,132,2,90,43,100,81,100,82,132,0, + 90,44,100,97,100,84,100,85,132,1,90,45,100,86,100,87, + 132,0,90,46,100,88,100,89,132,0,90,47,100,90,100,91, + 132,0,90,48,100,92,100,93,132,0,90,49,100,1,83,0, + 41,98,97,83,1,0,0,67,111,114,101,32,105,109,112,108, 101,109,101,110,116,97,116,105,111,110,32,111,102,32,105,109, - 112,111,114,116,46,10,10,84,104,105,115,32,109,111,100,117, - 108,101,32,105,115,32,78,79,84,32,109,101,97,110,116,32, - 116,111,32,98,101,32,100,105,114,101,99,116,108,121,32,105, - 109,112,111,114,116,101,100,33,32,73,116,32,104,97,115,32, - 98,101,101,110,32,100,101,115,105,103,110,101,100,32,115,117, - 99,104,10,116,104,97,116,32,105,116,32,99,97,110,32,98, - 101,32,98,111,111,116,115,116,114,97,112,112,101,100,32,105, - 110,116,111,32,80,121,116,104,111,110,32,97,115,32,116,104, - 101,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, - 32,111,102,32,105,109,112,111,114,116,46,32,65,115,10,115, - 117,99,104,32,105,116,32,114,101,113,117,105,114,101,115,32, - 116,104,101,32,105,110,106,101,99,116,105,111,110,32,111,102, - 32,115,112,101,99,105,102,105,99,32,109,111,100,117,108,101, - 115,32,97,110,100,32,97,116,116,114,105,98,117,116,101,115, - 32,105,110,32,111,114,100,101,114,32,116,111,10,119,111,114, - 107,46,32,79,110,101,32,115,104,111,117,108,100,32,117,115, - 101,32,105,109,112,111,114,116,108,105,98,32,97,115,32,116, - 104,101,32,112,117,98,108,105,99,45,102,97,99,105,110,103, - 32,118,101,114,115,105,111,110,32,111,102,32,116,104,105,115, - 32,109,111,100,117,108,101,46,10,10,78,99,2,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,7,0,0,0, - 67,0,0,0,115,56,0,0,0,100,1,68,0,93,32,125, - 2,116,0,124,1,124,2,131,2,114,4,116,1,124,0,124, - 2,116,2,124,1,124,2,131,2,131,3,1,0,113,4,124, - 0,106,3,160,4,124,1,106,3,161,1,1,0,100,2,83, - 0,41,3,122,47,83,105,109,112,108,101,32,115,117,98,115, - 116,105,116,117,116,101,32,102,111,114,32,102,117,110,99,116, - 111,111,108,115,46,117,112,100,97,116,101,95,119,114,97,112, - 112,101,114,46,41,4,218,10,95,95,109,111,100,117,108,101, - 95,95,218,8,95,95,110,97,109,101,95,95,218,12,95,95, - 113,117,97,108,110,97,109,101,95,95,218,7,95,95,100,111, - 99,95,95,78,41,5,218,7,104,97,115,97,116,116,114,218, - 7,115,101,116,97,116,116,114,218,7,103,101,116,97,116,116, - 114,218,8,95,95,100,105,99,116,95,95,218,6,117,112,100, - 97,116,101,41,3,90,3,110,101,119,90,3,111,108,100,218, - 7,114,101,112,108,97,99,101,169,0,114,10,0,0,0,250, - 29,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108, - 105,98,46,95,98,111,111,116,115,116,114,97,112,62,218,5, - 95,119,114,97,112,27,0,0,0,115,8,0,0,0,0,2, - 8,1,10,1,20,1,114,12,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0, - 67,0,0,0,115,12,0,0,0,116,0,116,1,131,1,124, - 0,131,1,83,0,169,1,78,41,2,218,4,116,121,112,101, - 218,3,115,121,115,169,1,218,4,110,97,109,101,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,11,95,110, - 101,119,95,109,111,100,117,108,101,35,0,0,0,115,2,0, - 0,0,0,1,114,18,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0, - 0,0,115,12,0,0,0,101,0,90,1,100,0,90,2,100, - 1,83,0,41,2,218,14,95,68,101,97,100,108,111,99,107, - 69,114,114,111,114,78,41,3,114,1,0,0,0,114,0,0, - 0,0,114,2,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,19,0,0,0, - 48,0,0,0,115,2,0,0,0,8,1,114,19,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,64,0,0,0,115,56,0,0,0,101,0, - 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, - 90,4,100,4,100,5,132,0,90,5,100,6,100,7,132,0, - 90,6,100,8,100,9,132,0,90,7,100,10,100,11,132,0, - 90,8,100,12,83,0,41,13,218,11,95,77,111,100,117,108, - 101,76,111,99,107,122,169,65,32,114,101,99,117,114,115,105, - 118,101,32,108,111,99,107,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,119,104,105,99,104,32,105,115,32, - 97,98,108,101,32,116,111,32,100,101,116,101,99,116,32,100, - 101,97,100,108,111,99,107,115,10,32,32,32,32,40,101,46, - 103,46,32,116,104,114,101,97,100,32,49,32,116,114,121,105, - 110,103,32,116,111,32,116,97,107,101,32,108,111,99,107,115, - 32,65,32,116,104,101,110,32,66,44,32,97,110,100,32,116, - 104,114,101,97,100,32,50,32,116,114,121,105,110,103,32,116, - 111,10,32,32,32,32,116,97,107,101,32,108,111,99,107,115, - 32,66,32,116,104,101,110,32,65,41,46,10,32,32,32,32, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,2,0,0,0,67,0,0,0,115,48,0,0,0,116,0, - 160,1,161,0,124,0,95,2,116,0,160,1,161,0,124,0, - 95,3,124,1,124,0,95,4,100,0,124,0,95,5,100,1, - 124,0,95,6,100,1,124,0,95,7,100,0,83,0,169,2, - 78,233,0,0,0,0,41,8,218,7,95,116,104,114,101,97, - 100,90,13,97,108,108,111,99,97,116,101,95,108,111,99,107, - 218,4,108,111,99,107,218,6,119,97,107,101,117,112,114,17, - 0,0,0,218,5,111,119,110,101,114,218,5,99,111,117,110, - 116,218,7,119,97,105,116,101,114,115,169,2,218,4,115,101, - 108,102,114,17,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,8,95,95,105,110,105,116,95,95, - 58,0,0,0,115,12,0,0,0,0,1,10,1,10,1,6, - 1,6,1,6,1,122,20,95,77,111,100,117,108,101,76,111, - 99,107,46,95,95,105,110,105,116,95,95,99,1,0,0,0, - 0,0,0,0,0,0,0,0,5,0,0,0,3,0,0,0, - 67,0,0,0,115,88,0,0,0,116,0,160,1,161,0,125, - 1,124,0,106,2,125,2,116,3,131,0,125,3,116,4,160, - 5,124,2,161,1,125,4,124,4,100,0,117,0,114,42,100, - 1,83,0,124,4,106,2,125,2,124,2,124,1,107,2,114, - 60,100,2,83,0,124,2,124,3,118,0,114,72,100,1,83, - 0,124,3,160,6,124,2,161,1,1,0,113,20,100,0,83, - 0,41,3,78,70,84,41,7,114,23,0,0,0,218,9,103, - 101,116,95,105,100,101,110,116,114,26,0,0,0,218,3,115, - 101,116,218,12,95,98,108,111,99,107,105,110,103,95,111,110, - 218,3,103,101,116,218,3,97,100,100,41,5,114,30,0,0, - 0,90,2,109,101,218,3,116,105,100,90,4,115,101,101,110, - 114,24,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,12,104,97,115,95,100,101,97,100,108,111, - 99,107,66,0,0,0,115,24,0,0,0,0,2,8,1,6, - 1,6,2,10,1,8,1,4,1,6,1,8,1,4,1,8, - 6,4,1,122,24,95,77,111,100,117,108,101,76,111,99,107, - 46,104,97,115,95,100,101,97,100,108,111,99,107,99,1,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,0, - 0,0,67,0,0,0,115,210,0,0,0,116,0,160,1,161, - 0,125,1,124,0,116,2,124,1,60,0,122,180,124,0,106, - 3,143,126,1,0,124,0,106,4,100,1,107,2,115,46,124, - 0,106,5,124,1,107,2,114,90,124,1,124,0,95,5,124, - 0,4,0,106,4,100,2,55,0,2,0,95,4,87,0,100, - 3,4,0,4,0,131,3,1,0,87,0,116,2,124,1,61, - 0,100,4,83,0,124,0,160,6,161,0,114,110,116,7,100, - 5,124,0,22,0,131,1,130,1,124,0,106,8,160,9,100, - 6,161,1,114,136,124,0,4,0,106,10,100,2,55,0,2, - 0,95,10,87,0,100,3,4,0,4,0,131,3,1,0,110, - 16,49,0,115,156,48,0,1,0,1,0,1,0,89,0,1, - 0,124,0,106,8,160,9,161,0,1,0,124,0,106,8,160, - 11,161,0,1,0,113,18,87,0,116,2,124,1,61,0,110, - 8,116,2,124,1,61,0,48,0,100,3,83,0,41,7,122, - 185,10,32,32,32,32,32,32,32,32,65,99,113,117,105,114, - 101,32,116,104,101,32,109,111,100,117,108,101,32,108,111,99, - 107,46,32,32,73,102,32,97,32,112,111,116,101,110,116,105, - 97,108,32,100,101,97,100,108,111,99,107,32,105,115,32,100, - 101,116,101,99,116,101,100,44,10,32,32,32,32,32,32,32, - 32,97,32,95,68,101,97,100,108,111,99,107,69,114,114,111, - 114,32,105,115,32,114,97,105,115,101,100,46,10,32,32,32, - 32,32,32,32,32,79,116,104,101,114,119,105,115,101,44,32, - 116,104,101,32,108,111,99,107,32,105,115,32,97,108,119,97, - 121,115,32,97,99,113,117,105,114,101,100,32,97,110,100,32, - 84,114,117,101,32,105,115,32,114,101,116,117,114,110,101,100, - 46,10,32,32,32,32,32,32,32,32,114,22,0,0,0,233, - 1,0,0,0,78,84,122,23,100,101,97,100,108,111,99,107, - 32,100,101,116,101,99,116,101,100,32,98,121,32,37,114,70, - 41,12,114,23,0,0,0,114,32,0,0,0,114,34,0,0, - 0,114,24,0,0,0,114,27,0,0,0,114,26,0,0,0, - 114,38,0,0,0,114,19,0,0,0,114,25,0,0,0,218, - 7,97,99,113,117,105,114,101,114,28,0,0,0,218,7,114, - 101,108,101,97,115,101,169,2,114,30,0,0,0,114,37,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,40,0,0,0,87,0,0,0,115,34,0,0,0,0, - 6,8,1,8,1,2,2,8,1,20,1,6,1,14,1,14, - 9,6,247,4,1,8,1,12,1,12,1,44,2,10,1,14, - 2,122,19,95,77,111,100,117,108,101,76,111,99,107,46,97, - 99,113,117,105,114,101,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, - 142,0,0,0,116,0,160,1,161,0,125,1,124,0,106,2, - 143,108,1,0,124,0,106,3,124,1,107,3,114,34,116,4, - 100,1,131,1,130,1,124,0,106,5,100,2,107,4,115,48, - 74,0,130,1,124,0,4,0,106,5,100,3,56,0,2,0, - 95,5,124,0,106,5,100,2,107,2,114,108,100,0,124,0, - 95,3,124,0,106,6,114,108,124,0,4,0,106,6,100,3, - 56,0,2,0,95,6,124,0,106,7,160,8,161,0,1,0, - 87,0,100,0,4,0,4,0,131,3,1,0,110,16,49,0, - 115,128,48,0,1,0,1,0,1,0,89,0,1,0,100,0, - 83,0,41,4,78,250,31,99,97,110,110,111,116,32,114,101, - 108,101,97,115,101,32,117,110,45,97,99,113,117,105,114,101, - 100,32,108,111,99,107,114,22,0,0,0,114,39,0,0,0, - 41,9,114,23,0,0,0,114,32,0,0,0,114,24,0,0, - 0,114,26,0,0,0,218,12,82,117,110,116,105,109,101,69, - 114,114,111,114,114,27,0,0,0,114,28,0,0,0,114,25, - 0,0,0,114,41,0,0,0,114,42,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,41,0,0, - 0,112,0,0,0,115,22,0,0,0,0,1,8,1,8,1, - 10,1,8,1,14,1,14,1,10,1,6,1,6,1,14,1, - 122,19,95,77,111,100,117,108,101,76,111,99,107,46,114,101, - 108,101,97,115,101,99,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,5,0,0,0,67,0,0,0,115,18, - 0,0,0,100,1,160,0,124,0,106,1,116,2,124,0,131, - 1,161,2,83,0,41,2,78,122,23,95,77,111,100,117,108, - 101,76,111,99,107,40,123,33,114,125,41,32,97,116,32,123, - 125,169,3,218,6,102,111,114,109,97,116,114,17,0,0,0, - 218,2,105,100,169,1,114,30,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,8,95,95,114,101, - 112,114,95,95,125,0,0,0,115,2,0,0,0,0,1,122, - 20,95,77,111,100,117,108,101,76,111,99,107,46,95,95,114, - 101,112,114,95,95,78,41,9,114,1,0,0,0,114,0,0, - 0,0,114,2,0,0,0,114,3,0,0,0,114,31,0,0, - 0,114,38,0,0,0,114,40,0,0,0,114,41,0,0,0, - 114,49,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,20,0,0,0,52,0, - 0,0,115,12,0,0,0,8,1,4,5,8,8,8,21,8, - 25,8,13,114,20,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, - 0,115,48,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, - 90,5,100,6,100,7,132,0,90,6,100,8,100,9,132,0, - 90,7,100,10,83,0,41,11,218,16,95,68,117,109,109,121, - 77,111,100,117,108,101,76,111,99,107,122,86,65,32,115,105, - 109,112,108,101,32,95,77,111,100,117,108,101,76,111,99,107, - 32,101,113,117,105,118,97,108,101,110,116,32,102,111,114,32, - 80,121,116,104,111,110,32,98,117,105,108,100,115,32,119,105, - 116,104,111,117,116,10,32,32,32,32,109,117,108,116,105,45, - 116,104,114,101,97,100,105,110,103,32,115,117,112,112,111,114, - 116,46,99,2,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, - 124,1,124,0,95,0,100,1,124,0,95,1,100,0,83,0, - 114,21,0,0,0,41,2,114,17,0,0,0,114,27,0,0, - 0,114,29,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,31,0,0,0,133,0,0,0,115,4, - 0,0,0,0,1,6,1,122,25,95,68,117,109,109,121,77, - 111,100,117,108,101,76,111,99,107,46,95,95,105,110,105,116, - 95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,18,0,0,0, - 124,0,4,0,106,0,100,1,55,0,2,0,95,0,100,2, - 83,0,41,3,78,114,39,0,0,0,84,41,1,114,27,0, - 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,40,0,0,0,137,0,0,0,115, - 4,0,0,0,0,1,14,1,122,24,95,68,117,109,109,121, - 77,111,100,117,108,101,76,111,99,107,46,97,99,113,117,105, - 114,101,99,1,0,0,0,0,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,36,0,0,0, - 124,0,106,0,100,1,107,2,114,18,116,1,100,2,131,1, - 130,1,124,0,4,0,106,0,100,3,56,0,2,0,95,0, - 100,0,83,0,41,4,78,114,22,0,0,0,114,43,0,0, - 0,114,39,0,0,0,41,2,114,27,0,0,0,114,44,0, - 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,41,0,0,0,141,0,0,0,115, - 6,0,0,0,0,1,10,1,8,1,122,24,95,68,117,109, - 109,121,77,111,100,117,108,101,76,111,99,107,46,114,101,108, - 101,97,115,101,99,1,0,0,0,0,0,0,0,0,0,0, - 0,1,0,0,0,5,0,0,0,67,0,0,0,115,18,0, - 0,0,100,1,160,0,124,0,106,1,116,2,124,0,131,1, - 161,2,83,0,41,2,78,122,28,95,68,117,109,109,121,77, - 111,100,117,108,101,76,111,99,107,40,123,33,114,125,41,32, - 97,116,32,123,125,114,45,0,0,0,114,48,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,49, - 0,0,0,146,0,0,0,115,2,0,0,0,0,1,122,25, - 95,68,117,109,109,121,77,111,100,117,108,101,76,111,99,107, - 46,95,95,114,101,112,114,95,95,78,41,8,114,1,0,0, - 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, - 114,31,0,0,0,114,40,0,0,0,114,41,0,0,0,114, - 49,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,50,0,0,0,129,0,0, - 0,115,10,0,0,0,8,1,4,3,8,4,8,4,8,5, - 114,50,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,36, - 0,0,0,101,0,90,1,100,0,90,2,100,1,100,2,132, - 0,90,3,100,3,100,4,132,0,90,4,100,5,100,6,132, - 0,90,5,100,7,83,0,41,8,218,18,95,77,111,100,117, - 108,101,76,111,99,107,77,97,110,97,103,101,114,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, - 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, - 0,100,0,124,0,95,1,100,0,83,0,114,13,0,0,0, - 41,2,218,5,95,110,97,109,101,218,5,95,108,111,99,107, - 114,29,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,114,31,0,0,0,152,0,0,0,115,4,0, - 0,0,0,1,6,1,122,27,95,77,111,100,117,108,101,76, - 111,99,107,77,97,110,97,103,101,114,46,95,95,105,110,105, - 116,95,95,99,1,0,0,0,0,0,0,0,0,0,0,0, - 1,0,0,0,2,0,0,0,67,0,0,0,115,26,0,0, - 0,116,0,124,0,106,1,131,1,124,0,95,2,124,0,106, - 2,160,3,161,0,1,0,100,0,83,0,114,13,0,0,0, - 41,4,218,16,95,103,101,116,95,109,111,100,117,108,101,95, - 108,111,99,107,114,52,0,0,0,114,53,0,0,0,114,40, - 0,0,0,114,48,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,9,95,95,101,110,116,101,114, - 95,95,156,0,0,0,115,4,0,0,0,0,1,12,1,122, - 28,95,77,111,100,117,108,101,76,111,99,107,77,97,110,97, - 103,101,114,46,95,95,101,110,116,101,114,95,95,99,1,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0, - 0,0,79,0,0,0,115,14,0,0,0,124,0,106,0,160, - 1,161,0,1,0,100,0,83,0,114,13,0,0,0,41,2, - 114,53,0,0,0,114,41,0,0,0,41,3,114,30,0,0, - 0,218,4,97,114,103,115,90,6,107,119,97,114,103,115,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, - 95,95,101,120,105,116,95,95,160,0,0,0,115,2,0,0, - 0,0,1,122,27,95,77,111,100,117,108,101,76,111,99,107, - 77,97,110,97,103,101,114,46,95,95,101,120,105,116,95,95, - 78,41,6,114,1,0,0,0,114,0,0,0,0,114,2,0, - 0,0,114,31,0,0,0,114,55,0,0,0,114,57,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,51,0,0,0,150,0,0,0,115,6, - 0,0,0,8,2,8,4,8,4,114,51,0,0,0,99,1, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8, - 0,0,0,67,0,0,0,115,136,0,0,0,116,0,160,1, - 161,0,1,0,122,112,122,14,116,2,124,0,25,0,131,0, - 125,1,87,0,110,22,4,0,116,3,121,46,1,0,1,0, - 1,0,100,1,125,1,89,0,110,2,48,0,124,1,100,1, - 117,0,114,110,116,4,100,1,117,0,114,74,116,5,124,0, - 131,1,125,1,110,8,116,6,124,0,131,1,125,1,124,0, - 102,1,100,2,100,3,132,1,125,2,116,7,160,8,124,1, - 124,2,161,2,116,2,124,0,60,0,87,0,116,0,160,9, - 161,0,1,0,110,10,116,0,160,9,161,0,1,0,48,0, - 124,1,83,0,41,4,122,139,71,101,116,32,111,114,32,99, - 114,101,97,116,101,32,116,104,101,32,109,111,100,117,108,101, - 32,108,111,99,107,32,102,111,114,32,97,32,103,105,118,101, - 110,32,109,111,100,117,108,101,32,110,97,109,101,46,10,10, - 32,32,32,32,65,99,113,117,105,114,101,47,114,101,108,101, - 97,115,101,32,105,110,116,101,114,110,97,108,108,121,32,116, - 104,101,32,103,108,111,98,97,108,32,105,109,112,111,114,116, - 32,108,111,99,107,32,116,111,32,112,114,111,116,101,99,116, - 10,32,32,32,32,95,109,111,100,117,108,101,95,108,111,99, - 107,115,46,78,99,2,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,8,0,0,0,83,0,0,0,115,56,0, - 0,0,116,0,160,1,161,0,1,0,122,32,116,2,160,3, - 124,1,161,1,124,0,117,0,114,30,116,2,124,1,61,0, - 87,0,116,0,160,4,161,0,1,0,110,10,116,0,160,4, - 161,0,1,0,48,0,100,0,83,0,114,13,0,0,0,41, - 5,218,4,95,105,109,112,218,12,97,99,113,117,105,114,101, - 95,108,111,99,107,218,13,95,109,111,100,117,108,101,95,108, - 111,99,107,115,114,35,0,0,0,218,12,114,101,108,101,97, - 115,101,95,108,111,99,107,41,2,218,3,114,101,102,114,17, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,2,99,98,185,0,0,0,115,10,0,0,0,0, - 1,8,1,2,4,14,1,8,2,122,28,95,103,101,116,95, - 109,111,100,117,108,101,95,108,111,99,107,46,60,108,111,99, - 97,108,115,62,46,99,98,41,10,114,58,0,0,0,114,59, - 0,0,0,114,60,0,0,0,218,8,75,101,121,69,114,114, - 111,114,114,23,0,0,0,114,50,0,0,0,114,20,0,0, - 0,218,8,95,119,101,97,107,114,101,102,114,62,0,0,0, - 114,61,0,0,0,41,3,114,17,0,0,0,114,24,0,0, - 0,114,63,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,54,0,0,0,166,0,0,0,115,28, - 0,0,0,0,6,8,1,2,1,2,1,14,1,12,1,10, - 2,8,1,8,1,10,2,8,2,12,11,18,2,20,2,114, - 54,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,8,0,0,0,67,0,0,0,115,52,0, - 0,0,116,0,124,0,131,1,125,1,122,12,124,1,160,1, - 161,0,1,0,87,0,110,18,4,0,116,2,121,38,1,0, - 1,0,1,0,89,0,110,10,48,0,124,1,160,3,161,0, - 1,0,100,1,83,0,41,2,122,189,65,99,113,117,105,114, - 101,115,32,116,104,101,110,32,114,101,108,101,97,115,101,115, - 32,116,104,101,32,109,111,100,117,108,101,32,108,111,99,107, - 32,102,111,114,32,97,32,103,105,118,101,110,32,109,111,100, - 117,108,101,32,110,97,109,101,46,10,10,32,32,32,32,84, - 104,105,115,32,105,115,32,117,115,101,100,32,116,111,32,101, - 110,115,117,114,101,32,97,32,109,111,100,117,108,101,32,105, - 115,32,99,111,109,112,108,101,116,101,108,121,32,105,110,105, - 116,105,97,108,105,122,101,100,44,32,105,110,32,116,104,101, - 10,32,32,32,32,101,118,101,110,116,32,105,116,32,105,115, - 32,98,101,105,110,103,32,105,109,112,111,114,116,101,100,32, - 98,121,32,97,110,111,116,104,101,114,32,116,104,114,101,97, - 100,46,10,32,32,32,32,78,41,4,114,54,0,0,0,114, - 40,0,0,0,114,19,0,0,0,114,41,0,0,0,41,2, - 114,17,0,0,0,114,24,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,19,95,108,111,99,107, - 95,117,110,108,111,99,107,95,109,111,100,117,108,101,203,0, - 0,0,115,12,0,0,0,0,6,8,1,2,1,12,1,12, - 3,6,2,114,66,0,0,0,99,1,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,4,0,0,0,79,0,0, - 0,115,14,0,0,0,124,0,124,1,105,0,124,2,164,1, - 142,1,83,0,41,1,97,46,1,0,0,114,101,109,111,118, - 101,95,105,109,112,111,114,116,108,105,98,95,102,114,97,109, - 101,115,32,105,110,32,105,109,112,111,114,116,46,99,32,119, - 105,108,108,32,97,108,119,97,121,115,32,114,101,109,111,118, - 101,32,115,101,113,117,101,110,99,101,115,10,32,32,32,32, - 111,102,32,105,109,112,111,114,116,108,105,98,32,102,114,97, - 109,101,115,32,116,104,97,116,32,101,110,100,32,119,105,116, - 104,32,97,32,99,97,108,108,32,116,111,32,116,104,105,115, - 32,102,117,110,99,116,105,111,110,10,10,32,32,32,32,85, - 115,101,32,105,116,32,105,110,115,116,101,97,100,32,111,102, - 32,97,32,110,111,114,109,97,108,32,99,97,108,108,32,105, - 110,32,112,108,97,99,101,115,32,119,104,101,114,101,32,105, - 110,99,108,117,100,105,110,103,32,116,104,101,32,105,109,112, - 111,114,116,108,105,98,10,32,32,32,32,102,114,97,109,101, - 115,32,105,110,116,114,111,100,117,99,101,115,32,117,110,119, - 97,110,116,101,100,32,110,111,105,115,101,32,105,110,116,111, - 32,116,104,101,32,116,114,97,99,101,98,97,99,107,32,40, - 101,46,103,46,32,119,104,101,110,32,101,120,101,99,117,116, - 105,110,103,10,32,32,32,32,109,111,100,117,108,101,32,99, - 111,100,101,41,10,32,32,32,32,114,10,0,0,0,41,3, - 218,1,102,114,56,0,0,0,90,4,107,119,100,115,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,25,95, - 99,97,108,108,95,119,105,116,104,95,102,114,97,109,101,115, - 95,114,101,109,111,118,101,100,220,0,0,0,115,2,0,0, - 0,0,8,114,68,0,0,0,114,39,0,0,0,41,1,218, - 9,118,101,114,98,111,115,105,116,121,99,1,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,4,0,0,0,71, - 0,0,0,115,54,0,0,0,116,0,106,1,106,2,124,1, - 107,5,114,50,124,0,160,3,100,1,161,1,115,30,100,2, - 124,0,23,0,125,0,116,4,124,0,106,5,124,2,142,0, - 116,0,106,6,100,3,141,2,1,0,100,4,83,0,41,5, - 122,61,80,114,105,110,116,32,116,104,101,32,109,101,115,115, - 97,103,101,32,116,111,32,115,116,100,101,114,114,32,105,102, - 32,45,118,47,80,89,84,72,79,78,86,69,82,66,79,83, - 69,32,105,115,32,116,117,114,110,101,100,32,111,110,46,41, - 2,250,1,35,122,7,105,109,112,111,114,116,32,122,2,35, - 32,41,1,90,4,102,105,108,101,78,41,7,114,15,0,0, - 0,218,5,102,108,97,103,115,218,7,118,101,114,98,111,115, - 101,218,10,115,116,97,114,116,115,119,105,116,104,218,5,112, - 114,105,110,116,114,46,0,0,0,218,6,115,116,100,101,114, - 114,41,3,218,7,109,101,115,115,97,103,101,114,69,0,0, - 0,114,56,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,16,95,118,101,114,98,111,115,101,95, - 109,101,115,115,97,103,101,231,0,0,0,115,8,0,0,0, - 0,2,12,1,10,1,8,1,114,77,0,0,0,99,1,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,3,0,0,0,115,26,0,0,0,135,0,102,1,100, - 1,100,2,132,8,125,1,116,0,124,1,136,0,131,2,1, - 0,124,1,83,0,41,3,122,49,68,101,99,111,114,97,116, - 111,114,32,116,111,32,118,101,114,105,102,121,32,116,104,101, - 32,110,97,109,101,100,32,109,111,100,117,108,101,32,105,115, - 32,98,117,105,108,116,45,105,110,46,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,19, - 0,0,0,115,38,0,0,0,124,1,116,0,106,1,118,1, - 114,28,116,2,100,1,160,3,124,1,161,1,124,1,100,2, - 141,2,130,1,136,0,124,0,124,1,131,2,83,0,41,3, - 78,250,29,123,33,114,125,32,105,115,32,110,111,116,32,97, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, - 114,16,0,0,0,41,4,114,15,0,0,0,218,20,98,117, - 105,108,116,105,110,95,109,111,100,117,108,101,95,110,97,109, - 101,115,218,11,73,109,112,111,114,116,69,114,114,111,114,114, - 46,0,0,0,169,2,114,30,0,0,0,218,8,102,117,108, - 108,110,97,109,101,169,1,218,3,102,120,110,114,10,0,0, - 0,114,11,0,0,0,218,25,95,114,101,113,117,105,114,101, - 115,95,98,117,105,108,116,105,110,95,119,114,97,112,112,101, - 114,241,0,0,0,115,10,0,0,0,0,1,10,1,10,1, - 2,255,6,2,122,52,95,114,101,113,117,105,114,101,115,95, - 98,117,105,108,116,105,110,46,60,108,111,99,97,108,115,62, - 46,95,114,101,113,117,105,114,101,115,95,98,117,105,108,116, - 105,110,95,119,114,97,112,112,101,114,169,1,114,12,0,0, - 0,41,2,114,84,0,0,0,114,85,0,0,0,114,10,0, - 0,0,114,83,0,0,0,114,11,0,0,0,218,17,95,114, - 101,113,117,105,114,101,115,95,98,117,105,108,116,105,110,239, - 0,0,0,115,6,0,0,0,0,2,12,5,10,1,114,87, - 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,3,0,0,0,115,26,0,0, - 0,135,0,102,1,100,1,100,2,132,8,125,1,116,0,124, - 1,136,0,131,2,1,0,124,1,83,0,41,3,122,47,68, - 101,99,111,114,97,116,111,114,32,116,111,32,118,101,114,105, - 102,121,32,116,104,101,32,110,97,109,101,100,32,109,111,100, - 117,108,101,32,105,115,32,102,114,111,122,101,110,46,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,19,0,0,0,115,38,0,0,0,116,0,160,1, - 124,1,161,1,115,28,116,2,100,1,160,3,124,1,161,1, - 124,1,100,2,141,2,130,1,136,0,124,0,124,1,131,2, - 83,0,169,3,78,122,27,123,33,114,125,32,105,115,32,110, - 111,116,32,97,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,114,16,0,0,0,41,4,114,58,0,0,0,218,9, - 105,115,95,102,114,111,122,101,110,114,80,0,0,0,114,46, - 0,0,0,114,81,0,0,0,114,83,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,24,95,114,101,113,117,105,114, - 101,115,95,102,114,111,122,101,110,95,119,114,97,112,112,101, - 114,252,0,0,0,115,10,0,0,0,0,1,10,1,10,1, - 2,255,6,2,122,50,95,114,101,113,117,105,114,101,115,95, - 102,114,111,122,101,110,46,60,108,111,99,97,108,115,62,46, - 95,114,101,113,117,105,114,101,115,95,102,114,111,122,101,110, - 95,119,114,97,112,112,101,114,114,86,0,0,0,41,2,114, - 84,0,0,0,114,90,0,0,0,114,10,0,0,0,114,83, - 0,0,0,114,11,0,0,0,218,16,95,114,101,113,117,105, - 114,101,115,95,102,114,111,122,101,110,250,0,0,0,115,6, - 0,0,0,0,2,12,5,10,1,114,91,0,0,0,99,2, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,3, - 0,0,0,67,0,0,0,115,62,0,0,0,116,0,124,1, - 124,0,131,2,125,2,124,1,116,1,106,2,118,0,114,50, - 116,1,106,2,124,1,25,0,125,3,116,3,124,2,124,3, - 131,2,1,0,116,1,106,2,124,1,25,0,83,0,116,4, - 124,2,131,1,83,0,100,1,83,0,41,2,122,128,76,111, - 97,100,32,116,104,101,32,115,112,101,99,105,102,105,101,100, - 32,109,111,100,117,108,101,32,105,110,116,111,32,115,121,115, - 46,109,111,100,117,108,101,115,32,97,110,100,32,114,101,116, - 117,114,110,32,105,116,46,10,10,32,32,32,32,84,104,105, - 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, - 101,99,97,116,101,100,46,32,32,85,115,101,32,108,111,97, - 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,32, - 105,110,115,116,101,97,100,46,10,10,32,32,32,32,78,41, - 5,218,16,115,112,101,99,95,102,114,111,109,95,108,111,97, - 100,101,114,114,15,0,0,0,218,7,109,111,100,117,108,101, - 115,218,5,95,101,120,101,99,218,5,95,108,111,97,100,41, - 4,114,30,0,0,0,114,82,0,0,0,218,4,115,112,101, - 99,218,6,109,111,100,117,108,101,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,17,95,108,111,97,100,95, - 109,111,100,117,108,101,95,115,104,105,109,6,1,0,0,115, - 12,0,0,0,0,6,10,1,10,1,10,1,10,1,10,2, - 114,98,0,0,0,99,1,0,0,0,0,0,0,0,0,0, - 0,0,5,0,0,0,8,0,0,0,67,0,0,0,115,218, - 0,0,0,116,0,124,0,100,1,100,0,131,3,125,1,116, - 1,124,1,100,2,131,2,114,54,122,12,124,1,160,2,124, - 0,161,1,87,0,83,0,4,0,116,3,121,52,1,0,1, - 0,1,0,89,0,110,2,48,0,122,10,124,0,106,4,125, - 2,87,0,110,18,4,0,116,5,121,82,1,0,1,0,1, - 0,89,0,110,18,48,0,124,2,100,0,117,1,114,100,116, - 6,124,2,131,1,83,0,122,10,124,0,106,7,125,3,87, - 0,110,22,4,0,116,5,121,132,1,0,1,0,1,0,100, - 3,125,3,89,0,110,2,48,0,122,10,124,0,106,8,125, - 4,87,0,110,56,4,0,116,5,121,200,1,0,1,0,1, - 0,124,1,100,0,117,0,114,180,100,4,160,9,124,3,161, - 1,6,0,89,0,83,0,100,5,160,9,124,3,124,1,161, - 2,6,0,89,0,83,0,89,0,110,14,48,0,100,6,160, - 9,124,3,124,4,161,2,83,0,100,0,83,0,41,7,78, - 218,10,95,95,108,111,97,100,101,114,95,95,218,11,109,111, - 100,117,108,101,95,114,101,112,114,250,1,63,250,13,60,109, - 111,100,117,108,101,32,123,33,114,125,62,250,20,60,109,111, - 100,117,108,101,32,123,33,114,125,32,40,123,33,114,125,41, - 62,250,23,60,109,111,100,117,108,101,32,123,33,114,125,32, - 102,114,111,109,32,123,33,114,125,62,41,10,114,6,0,0, - 0,114,4,0,0,0,114,100,0,0,0,218,9,69,120,99, - 101,112,116,105,111,110,218,8,95,95,115,112,101,99,95,95, - 218,14,65,116,116,114,105,98,117,116,101,69,114,114,111,114, - 218,22,95,109,111,100,117,108,101,95,114,101,112,114,95,102, - 114,111,109,95,115,112,101,99,114,1,0,0,0,218,8,95, - 95,102,105,108,101,95,95,114,46,0,0,0,41,5,114,97, - 0,0,0,218,6,108,111,97,100,101,114,114,96,0,0,0, - 114,17,0,0,0,218,8,102,105,108,101,110,97,109,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,12, - 95,109,111,100,117,108,101,95,114,101,112,114,22,1,0,0, - 115,46,0,0,0,0,2,12,1,10,4,2,1,12,1,12, - 1,6,1,2,1,10,1,12,1,6,2,8,1,8,4,2, - 1,10,1,12,1,10,1,2,1,10,1,12,1,8,1,14, - 2,22,2,114,112,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, - 0,115,114,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,100,2,100,2,100,2,100,3,156,3,100,4,100,5, - 132,2,90,4,100,6,100,7,132,0,90,5,100,8,100,9, - 132,0,90,6,101,7,100,10,100,11,132,0,131,1,90,8, - 101,8,106,9,100,12,100,11,132,0,131,1,90,8,101,7, - 100,13,100,14,132,0,131,1,90,10,101,7,100,15,100,16, - 132,0,131,1,90,11,101,11,106,9,100,17,100,16,132,0, - 131,1,90,11,100,2,83,0,41,18,218,10,77,111,100,117, - 108,101,83,112,101,99,97,208,5,0,0,84,104,101,32,115, - 112,101,99,105,102,105,99,97,116,105,111,110,32,102,111,114, - 32,97,32,109,111,100,117,108,101,44,32,117,115,101,100,32, - 102,111,114,32,108,111,97,100,105,110,103,46,10,10,32,32, - 32,32,65,32,109,111,100,117,108,101,39,115,32,115,112,101, - 99,32,105,115,32,116,104,101,32,115,111,117,114,99,101,32, - 102,111,114,32,105,110,102,111,114,109,97,116,105,111,110,32, - 97,98,111,117,116,32,116,104,101,32,109,111,100,117,108,101, - 46,32,32,70,111,114,10,32,32,32,32,100,97,116,97,32, - 97,115,115,111,99,105,97,116,101,100,32,119,105,116,104,32, - 116,104,101,32,109,111,100,117,108,101,44,32,105,110,99,108, - 117,100,105,110,103,32,115,111,117,114,99,101,44,32,117,115, - 101,32,116,104,101,32,115,112,101,99,39,115,10,32,32,32, - 32,108,111,97,100,101,114,46,10,10,32,32,32,32,96,110, - 97,109,101,96,32,105,115,32,116,104,101,32,97,98,115,111, - 108,117,116,101,32,110,97,109,101,32,111,102,32,116,104,101, - 32,109,111,100,117,108,101,46,32,32,96,108,111,97,100,101, - 114,96,32,105,115,32,116,104,101,32,108,111,97,100,101,114, - 10,32,32,32,32,116,111,32,117,115,101,32,119,104,101,110, - 32,108,111,97,100,105,110,103,32,116,104,101,32,109,111,100, - 117,108,101,46,32,32,96,112,97,114,101,110,116,96,32,105, - 115,32,116,104,101,32,110,97,109,101,32,111,102,32,116,104, - 101,10,32,32,32,32,112,97,99,107,97,103,101,32,116,104, - 101,32,109,111,100,117,108,101,32,105,115,32,105,110,46,32, - 32,84,104,101,32,112,97,114,101,110,116,32,105,115,32,100, - 101,114,105,118,101,100,32,102,114,111,109,32,116,104,101,32, - 110,97,109,101,46,10,10,32,32,32,32,96,105,115,95,112, - 97,99,107,97,103,101,96,32,100,101,116,101,114,109,105,110, - 101,115,32,105,102,32,116,104,101,32,109,111,100,117,108,101, - 32,105,115,32,99,111,110,115,105,100,101,114,101,100,32,97, - 32,112,97,99,107,97,103,101,32,111,114,10,32,32,32,32, - 110,111,116,46,32,32,79,110,32,109,111,100,117,108,101,115, - 32,116,104,105,115,32,105,115,32,114,101,102,108,101,99,116, - 101,100,32,98,121,32,116,104,101,32,96,95,95,112,97,116, - 104,95,95,96,32,97,116,116,114,105,98,117,116,101,46,10, - 10,32,32,32,32,96,111,114,105,103,105,110,96,32,105,115, - 32,116,104,101,32,115,112,101,99,105,102,105,99,32,108,111, - 99,97,116,105,111,110,32,117,115,101,100,32,98,121,32,116, - 104,101,32,108,111,97,100,101,114,32,102,114,111,109,32,119, - 104,105,99,104,32,116,111,10,32,32,32,32,108,111,97,100, - 32,116,104,101,32,109,111,100,117,108,101,44,32,105,102,32, - 116,104,97,116,32,105,110,102,111,114,109,97,116,105,111,110, - 32,105,115,32,97,118,97,105,108,97,98,108,101,46,32,32, - 87,104,101,110,32,102,105,108,101,110,97,109,101,32,105,115, - 10,32,32,32,32,115,101,116,44,32,111,114,105,103,105,110, - 32,119,105,108,108,32,109,97,116,99,104,46,10,10,32,32, - 32,32,96,104,97,115,95,108,111,99,97,116,105,111,110,96, - 32,105,110,100,105,99,97,116,101,115,32,116,104,97,116,32, - 97,32,115,112,101,99,39,115,32,34,111,114,105,103,105,110, - 34,32,114,101,102,108,101,99,116,115,32,97,32,108,111,99, - 97,116,105,111,110,46,10,32,32,32,32,87,104,101,110,32, - 116,104,105,115,32,105,115,32,84,114,117,101,44,32,96,95, - 95,102,105,108,101,95,95,96,32,97,116,116,114,105,98,117, - 116,101,32,111,102,32,116,104,101,32,109,111,100,117,108,101, - 32,105,115,32,115,101,116,46,10,10,32,32,32,32,96,99, - 97,99,104,101,100,96,32,105,115,32,116,104,101,32,108,111, - 99,97,116,105,111,110,32,111,102,32,116,104,101,32,99,97, - 99,104,101,100,32,98,121,116,101,99,111,100,101,32,102,105, - 108,101,44,32,105,102,32,97,110,121,46,32,32,73,116,10, - 32,32,32,32,99,111,114,114,101,115,112,111,110,100,115,32, - 116,111,32,116,104,101,32,96,95,95,99,97,99,104,101,100, - 95,95,96,32,97,116,116,114,105,98,117,116,101,46,10,10, - 32,32,32,32,96,115,117,98,109,111,100,117,108,101,95,115, - 101,97,114,99,104,95,108,111,99,97,116,105,111,110,115,96, - 32,105,115,32,116,104,101,32,115,101,113,117,101,110,99,101, - 32,111,102,32,112,97,116,104,32,101,110,116,114,105,101,115, - 32,116,111,10,32,32,32,32,115,101,97,114,99,104,32,119, - 104,101,110,32,105,109,112,111,114,116,105,110,103,32,115,117, - 98,109,111,100,117,108,101,115,46,32,32,73,102,32,115,101, - 116,44,32,105,115,95,112,97,99,107,97,103,101,32,115,104, - 111,117,108,100,32,98,101,10,32,32,32,32,84,114,117,101, - 45,45,97,110,100,32,70,97,108,115,101,32,111,116,104,101, - 114,119,105,115,101,46,10,10,32,32,32,32,80,97,99,107, - 97,103,101,115,32,97,114,101,32,115,105,109,112,108,121,32, - 109,111,100,117,108,101,115,32,116,104,97,116,32,40,109,97, - 121,41,32,104,97,118,101,32,115,117,98,109,111,100,117,108, - 101,115,46,32,32,73,102,32,97,32,115,112,101,99,10,32, - 32,32,32,104,97,115,32,97,32,110,111,110,45,78,111,110, - 101,32,118,97,108,117,101,32,105,110,32,96,115,117,98,109, - 111,100,117,108,101,95,115,101,97,114,99,104,95,108,111,99, - 97,116,105,111,110,115,96,44,32,116,104,101,32,105,109,112, - 111,114,116,10,32,32,32,32,115,121,115,116,101,109,32,119, - 105,108,108,32,99,111,110,115,105,100,101,114,32,109,111,100, - 117,108,101,115,32,108,111,97,100,101,100,32,102,114,111,109, - 32,116,104,101,32,115,112,101,99,32,97,115,32,112,97,99, - 107,97,103,101,115,46,10,10,32,32,32,32,79,110,108,121, - 32,102,105,110,100,101,114,115,32,40,115,101,101,32,105,109, - 112,111,114,116,108,105,98,46,97,98,99,46,77,101,116,97, - 80,97,116,104,70,105,110,100,101,114,32,97,110,100,10,32, - 32,32,32,105,109,112,111,114,116,108,105,98,46,97,98,99, - 46,80,97,116,104,69,110,116,114,121,70,105,110,100,101,114, - 41,32,115,104,111,117,108,100,32,109,111,100,105,102,121,32, - 77,111,100,117,108,101,83,112,101,99,32,105,110,115,116,97, - 110,99,101,115,46,10,10,32,32,32,32,78,41,3,218,6, - 111,114,105,103,105,110,218,12,108,111,97,100,101,114,95,115, - 116,97,116,101,218,10,105,115,95,112,97,99,107,97,103,101, - 99,3,0,0,0,0,0,0,0,3,0,0,0,6,0,0, - 0,2,0,0,0,67,0,0,0,115,54,0,0,0,124,1, - 124,0,95,0,124,2,124,0,95,1,124,3,124,0,95,2, - 124,4,124,0,95,3,124,5,114,32,103,0,110,2,100,0, - 124,0,95,4,100,1,124,0,95,5,100,0,124,0,95,6, - 100,0,83,0,41,2,78,70,41,7,114,17,0,0,0,114, - 110,0,0,0,114,114,0,0,0,114,115,0,0,0,218,26, - 115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104, - 95,108,111,99,97,116,105,111,110,115,218,13,95,115,101,116, - 95,102,105,108,101,97,116,116,114,218,7,95,99,97,99,104, - 101,100,41,6,114,30,0,0,0,114,17,0,0,0,114,110, - 0,0,0,114,114,0,0,0,114,115,0,0,0,114,116,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,31,0,0,0,95,1,0,0,115,14,0,0,0,0, - 2,6,1,6,1,6,1,6,1,14,3,6,1,122,19,77, - 111,100,117,108,101,83,112,101,99,46,95,95,105,110,105,116, - 95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,6,0,0,0,67,0,0,0,115,102,0,0,0, - 100,1,160,0,124,0,106,1,161,1,100,2,160,0,124,0, - 106,2,161,1,103,2,125,1,124,0,106,3,100,0,117,1, - 114,52,124,1,160,4,100,3,160,0,124,0,106,3,161,1, - 161,1,1,0,124,0,106,5,100,0,117,1,114,80,124,1, - 160,4,100,4,160,0,124,0,106,5,161,1,161,1,1,0, - 100,5,160,0,124,0,106,6,106,7,100,6,160,8,124,1, - 161,1,161,2,83,0,41,7,78,122,9,110,97,109,101,61, - 123,33,114,125,122,11,108,111,97,100,101,114,61,123,33,114, - 125,122,11,111,114,105,103,105,110,61,123,33,114,125,122,29, - 115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104, - 95,108,111,99,97,116,105,111,110,115,61,123,125,122,6,123, - 125,40,123,125,41,122,2,44,32,41,9,114,46,0,0,0, - 114,17,0,0,0,114,110,0,0,0,114,114,0,0,0,218, - 6,97,112,112,101,110,100,114,117,0,0,0,218,9,95,95, - 99,108,97,115,115,95,95,114,1,0,0,0,218,4,106,111, - 105,110,41,2,114,30,0,0,0,114,56,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,49,0, - 0,0,107,1,0,0,115,20,0,0,0,0,1,10,1,10, - 255,4,2,10,1,18,1,10,1,8,1,4,255,6,2,122, - 19,77,111,100,117,108,101,83,112,101,99,46,95,95,114,101, - 112,114,95,95,99,2,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,8,0,0,0,67,0,0,0,115,106,0, - 0,0,124,0,106,0,125,2,122,72,124,0,106,1,124,1, - 106,1,107,2,111,76,124,0,106,2,124,1,106,2,107,2, - 111,76,124,0,106,3,124,1,106,3,107,2,111,76,124,2, - 124,1,106,0,107,2,111,76,124,0,106,4,124,1,106,4, - 107,2,111,76,124,0,106,5,124,1,106,5,107,2,87,0, - 83,0,4,0,116,6,121,100,1,0,1,0,1,0,116,7, - 6,0,89,0,83,0,48,0,100,0,83,0,114,13,0,0, - 0,41,8,114,117,0,0,0,114,17,0,0,0,114,110,0, - 0,0,114,114,0,0,0,218,6,99,97,99,104,101,100,218, - 12,104,97,115,95,108,111,99,97,116,105,111,110,114,107,0, - 0,0,218,14,78,111,116,73,109,112,108,101,109,101,110,116, - 101,100,41,3,114,30,0,0,0,90,5,111,116,104,101,114, - 90,4,115,109,115,108,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,6,95,95,101,113,95,95,117,1,0, - 0,115,30,0,0,0,0,1,6,1,2,1,12,1,10,255, - 2,2,10,254,2,3,8,253,2,4,10,252,2,5,10,251, - 4,6,12,1,122,17,77,111,100,117,108,101,83,112,101,99, - 46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,0, - 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, - 115,58,0,0,0,124,0,106,0,100,0,117,0,114,52,124, - 0,106,1,100,0,117,1,114,52,124,0,106,2,114,52,116, - 3,100,0,117,0,114,38,116,4,130,1,116,3,160,5,124, - 0,106,1,161,1,124,0,95,0,124,0,106,0,83,0,114, - 13,0,0,0,41,6,114,119,0,0,0,114,114,0,0,0, - 114,118,0,0,0,218,19,95,98,111,111,116,115,116,114,97, - 112,95,101,120,116,101,114,110,97,108,218,19,78,111,116,73, - 109,112,108,101,109,101,110,116,101,100,69,114,114,111,114,90, - 11,95,103,101,116,95,99,97,99,104,101,100,114,48,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,123,0,0,0,129,1,0,0,115,12,0,0,0,0,2, - 10,1,16,1,8,1,4,1,14,1,122,17,77,111,100,117, - 108,101,83,112,101,99,46,99,97,99,104,101,100,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, - 0,0,67,0,0,0,115,10,0,0,0,124,1,124,0,95, - 0,100,0,83,0,114,13,0,0,0,41,1,114,119,0,0, - 0,41,2,114,30,0,0,0,114,123,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,123,0,0, - 0,138,1,0,0,115,2,0,0,0,0,2,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,36,0,0,0,124,0,106,0,100,1, - 117,0,114,26,124,0,106,1,160,2,100,2,161,1,100,3, - 25,0,83,0,124,0,106,1,83,0,100,1,83,0,41,4, - 122,32,84,104,101,32,110,97,109,101,32,111,102,32,116,104, - 101,32,109,111,100,117,108,101,39,115,32,112,97,114,101,110, - 116,46,78,218,1,46,114,22,0,0,0,41,3,114,117,0, - 0,0,114,17,0,0,0,218,10,114,112,97,114,116,105,116, - 105,111,110,114,48,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,6,112,97,114,101,110,116,142, - 1,0,0,115,6,0,0,0,0,3,10,1,16,2,122,17, - 77,111,100,117,108,101,83,112,101,99,46,112,97,114,101,110, - 116,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, - 0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124, - 0,106,0,83,0,114,13,0,0,0,41,1,114,118,0,0, - 0,114,48,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,124,0,0,0,150,1,0,0,115,2, - 0,0,0,0,2,122,23,77,111,100,117,108,101,83,112,101, - 99,46,104,97,115,95,108,111,99,97,116,105,111,110,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2, - 0,0,0,67,0,0,0,115,14,0,0,0,116,0,124,1, - 131,1,124,0,95,1,100,0,83,0,114,13,0,0,0,41, - 2,218,4,98,111,111,108,114,118,0,0,0,41,2,114,30, - 0,0,0,218,5,118,97,108,117,101,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,124,0,0,0,154,1, - 0,0,115,2,0,0,0,0,2,41,12,114,1,0,0,0, - 114,0,0,0,0,114,2,0,0,0,114,3,0,0,0,114, - 31,0,0,0,114,49,0,0,0,114,126,0,0,0,218,8, - 112,114,111,112,101,114,116,121,114,123,0,0,0,218,6,115, - 101,116,116,101,114,114,131,0,0,0,114,124,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,113,0,0,0,58,1,0,0,115,32,0,0, - 0,8,1,4,36,4,1,2,255,12,12,8,10,8,12,2, - 1,10,8,4,1,10,3,2,1,10,7,2,1,10,3,4, - 1,114,113,0,0,0,169,2,114,114,0,0,0,114,116,0, - 0,0,99,2,0,0,0,0,0,0,0,2,0,0,0,6, - 0,0,0,8,0,0,0,67,0,0,0,115,152,0,0,0, - 116,0,124,1,100,1,131,2,114,74,116,1,100,2,117,0, - 114,22,116,2,130,1,116,1,106,3,125,4,124,3,100,2, - 117,0,114,48,124,4,124,0,124,1,100,3,141,2,83,0, - 124,3,114,56,103,0,110,2,100,2,125,5,124,4,124,0, - 124,1,124,5,100,4,141,3,83,0,124,3,100,2,117,0, - 114,136,116,0,124,1,100,5,131,2,114,132,122,14,124,1, - 160,4,124,0,161,1,125,3,87,0,113,136,4,0,116,5, - 121,128,1,0,1,0,1,0,100,2,125,3,89,0,113,136, - 48,0,110,4,100,6,125,3,116,6,124,0,124,1,124,2, - 124,3,100,7,141,4,83,0,41,8,122,53,82,101,116,117, - 114,110,32,97,32,109,111,100,117,108,101,32,115,112,101,99, - 32,98,97,115,101,100,32,111,110,32,118,97,114,105,111,117, - 115,32,108,111,97,100,101,114,32,109,101,116,104,111,100,115, - 46,90,12,103,101,116,95,102,105,108,101,110,97,109,101,78, - 41,1,114,110,0,0,0,41,2,114,110,0,0,0,114,117, - 0,0,0,114,116,0,0,0,70,114,136,0,0,0,41,7, - 114,4,0,0,0,114,127,0,0,0,114,128,0,0,0,218, - 23,115,112,101,99,95,102,114,111,109,95,102,105,108,101,95, - 108,111,99,97,116,105,111,110,114,116,0,0,0,114,80,0, - 0,0,114,113,0,0,0,41,6,114,17,0,0,0,114,110, - 0,0,0,114,114,0,0,0,114,116,0,0,0,114,137,0, - 0,0,90,6,115,101,97,114,99,104,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,92,0,0,0,159,1, - 0,0,115,36,0,0,0,0,2,10,1,8,1,4,1,6, - 2,8,1,12,1,12,1,6,1,2,255,6,3,8,1,10, - 1,2,1,14,1,12,1,12,3,4,2,114,92,0,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,8,0,0,0,67,0,0,0,115,42,1,0,0,122,10, - 124,0,106,0,125,3,87,0,110,18,4,0,116,1,121,28, - 1,0,1,0,1,0,89,0,110,14,48,0,124,3,100,0, - 117,1,114,42,124,3,83,0,124,0,106,2,125,4,124,1, - 100,0,117,0,114,86,122,10,124,0,106,3,125,1,87,0, - 110,18,4,0,116,1,121,84,1,0,1,0,1,0,89,0, - 110,2,48,0,122,10,124,0,106,4,125,5,87,0,110,22, - 4,0,116,1,121,118,1,0,1,0,1,0,100,0,125,5, - 89,0,110,2,48,0,124,2,100,0,117,0,114,176,124,5, - 100,0,117,0,114,172,122,10,124,1,106,5,125,2,87,0, - 113,176,4,0,116,1,121,168,1,0,1,0,1,0,100,0, - 125,2,89,0,113,176,48,0,110,4,124,5,125,2,122,10, - 124,0,106,6,125,6,87,0,110,22,4,0,116,1,121,208, - 1,0,1,0,1,0,100,0,125,6,89,0,110,2,48,0, - 122,14,116,7,124,0,106,8,131,1,125,7,87,0,110,22, - 4,0,116,1,121,246,1,0,1,0,1,0,100,0,125,7, - 89,0,110,2,48,0,116,9,124,4,124,1,124,2,100,1, - 141,3,125,3,124,5,100,0,117,0,144,1,114,20,100,2, - 110,2,100,3,124,3,95,10,124,6,124,3,95,11,124,7, - 124,3,95,12,124,3,83,0,41,4,78,169,1,114,114,0, - 0,0,70,84,41,13,114,106,0,0,0,114,107,0,0,0, - 114,1,0,0,0,114,99,0,0,0,114,109,0,0,0,218, - 7,95,79,82,73,71,73,78,218,10,95,95,99,97,99,104, - 101,100,95,95,218,4,108,105,115,116,218,8,95,95,112,97, - 116,104,95,95,114,113,0,0,0,114,118,0,0,0,114,123, - 0,0,0,114,117,0,0,0,41,8,114,97,0,0,0,114, - 110,0,0,0,114,114,0,0,0,114,96,0,0,0,114,17, - 0,0,0,90,8,108,111,99,97,116,105,111,110,114,123,0, - 0,0,114,117,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,17,95,115,112,101,99,95,102,114, - 111,109,95,109,111,100,117,108,101,185,1,0,0,115,72,0, - 0,0,0,2,2,1,10,1,12,1,6,2,8,1,4,2, - 6,1,8,1,2,1,10,1,12,2,6,1,2,1,10,1, - 12,1,10,1,8,1,8,1,2,1,10,1,12,1,12,2, - 4,1,2,1,10,1,12,1,10,1,2,1,14,1,12,1, - 10,2,14,1,20,1,6,1,6,1,114,143,0,0,0,70, - 169,1,218,8,111,118,101,114,114,105,100,101,99,2,0,0, - 0,0,0,0,0,1,0,0,0,5,0,0,0,8,0,0, - 0,67,0,0,0,115,210,1,0,0,124,2,115,20,116,0, - 124,1,100,1,100,0,131,3,100,0,117,0,114,52,122,12, - 124,0,106,1,124,1,95,2,87,0,110,18,4,0,116,3, - 121,50,1,0,1,0,1,0,89,0,110,2,48,0,124,2, - 115,72,116,0,124,1,100,2,100,0,131,3,100,0,117,0, - 114,174,124,0,106,4,125,3,124,3,100,0,117,0,114,144, - 124,0,106,5,100,0,117,1,114,144,116,6,100,0,117,0, - 114,108,116,7,130,1,116,6,106,8,125,4,124,4,160,9, - 124,4,161,1,125,3,124,0,106,5,124,3,95,10,124,3, - 124,0,95,4,100,0,124,1,95,11,122,10,124,3,124,1, - 95,12,87,0,110,18,4,0,116,3,121,172,1,0,1,0, - 1,0,89,0,110,2,48,0,124,2,115,194,116,0,124,1, - 100,3,100,0,131,3,100,0,117,0,114,226,122,12,124,0, - 106,13,124,1,95,14,87,0,110,18,4,0,116,3,121,224, - 1,0,1,0,1,0,89,0,110,2,48,0,122,10,124,0, - 124,1,95,15,87,0,110,18,4,0,116,3,121,254,1,0, - 1,0,1,0,89,0,110,2,48,0,124,2,144,1,115,24, - 116,0,124,1,100,4,100,0,131,3,100,0,117,0,144,1, - 114,70,124,0,106,5,100,0,117,1,144,1,114,70,122,12, - 124,0,106,5,124,1,95,16,87,0,110,20,4,0,116,3, - 144,1,121,68,1,0,1,0,1,0,89,0,110,2,48,0, - 124,0,106,17,144,1,114,206,124,2,144,1,115,102,116,0, - 124,1,100,5,100,0,131,3,100,0,117,0,144,1,114,136, - 122,12,124,0,106,18,124,1,95,11,87,0,110,20,4,0, - 116,3,144,1,121,134,1,0,1,0,1,0,89,0,110,2, - 48,0,124,2,144,1,115,160,116,0,124,1,100,6,100,0, - 131,3,100,0,117,0,144,1,114,206,124,0,106,19,100,0, - 117,1,144,1,114,206,122,12,124,0,106,19,124,1,95,20, - 87,0,110,20,4,0,116,3,144,1,121,204,1,0,1,0, - 1,0,89,0,110,2,48,0,124,1,83,0,41,7,78,114, - 1,0,0,0,114,99,0,0,0,218,11,95,95,112,97,99, - 107,97,103,101,95,95,114,142,0,0,0,114,109,0,0,0, - 114,140,0,0,0,41,21,114,6,0,0,0,114,17,0,0, - 0,114,1,0,0,0,114,107,0,0,0,114,110,0,0,0, - 114,117,0,0,0,114,127,0,0,0,114,128,0,0,0,218, - 16,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,218,7,95,95,110,101,119,95,95,90,5,95,112,97,116, - 104,114,109,0,0,0,114,99,0,0,0,114,131,0,0,0, - 114,146,0,0,0,114,106,0,0,0,114,142,0,0,0,114, - 124,0,0,0,114,114,0,0,0,114,123,0,0,0,114,140, - 0,0,0,41,5,114,96,0,0,0,114,97,0,0,0,114, - 145,0,0,0,114,110,0,0,0,114,147,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,18,95, - 105,110,105,116,95,109,111,100,117,108,101,95,97,116,116,114, - 115,230,1,0,0,115,96,0,0,0,0,4,20,1,2,1, - 12,1,12,1,6,2,20,1,6,1,8,2,10,1,8,1, - 4,1,6,2,10,1,8,1,6,11,6,1,2,1,10,1, - 12,1,6,2,20,1,2,1,12,1,12,1,6,2,2,1, - 10,1,12,1,6,2,24,1,12,1,2,1,12,1,14,1, - 6,2,8,1,24,1,2,1,12,1,14,1,6,2,24,1, - 12,1,2,1,12,1,14,1,6,1,114,149,0,0,0,99, - 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,82,0,0,0,100,1,125, - 1,116,0,124,0,106,1,100,2,131,2,114,30,124,0,106, - 1,160,2,124,0,161,1,125,1,110,20,116,0,124,0,106, - 1,100,3,131,2,114,50,116,3,100,4,131,1,130,1,124, - 1,100,1,117,0,114,68,116,4,124,0,106,5,131,1,125, - 1,116,6,124,0,124,1,131,2,1,0,124,1,83,0,41, - 5,122,43,67,114,101,97,116,101,32,97,32,109,111,100,117, - 108,101,32,98,97,115,101,100,32,111,110,32,116,104,101,32, - 112,114,111,118,105,100,101,100,32,115,112,101,99,46,78,218, - 13,99,114,101,97,116,101,95,109,111,100,117,108,101,218,11, - 101,120,101,99,95,109,111,100,117,108,101,122,66,108,111,97, - 100,101,114,115,32,116,104,97,116,32,100,101,102,105,110,101, - 32,101,120,101,99,95,109,111,100,117,108,101,40,41,32,109, - 117,115,116,32,97,108,115,111,32,100,101,102,105,110,101,32, - 99,114,101,97,116,101,95,109,111,100,117,108,101,40,41,41, - 7,114,4,0,0,0,114,110,0,0,0,114,150,0,0,0, - 114,80,0,0,0,114,18,0,0,0,114,17,0,0,0,114, - 149,0,0,0,169,2,114,96,0,0,0,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 16,109,111,100,117,108,101,95,102,114,111,109,95,115,112,101, - 99,46,2,0,0,115,18,0,0,0,0,3,4,1,12,3, - 14,1,12,1,8,2,8,1,10,1,10,1,114,153,0,0, - 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,106,0,0,0,124, - 0,106,0,100,1,117,0,114,14,100,2,110,4,124,0,106, - 0,125,1,124,0,106,1,100,1,117,0,114,66,124,0,106, - 2,100,1,117,0,114,50,100,3,160,3,124,1,161,1,83, - 0,100,4,160,3,124,1,124,0,106,2,161,2,83,0,110, - 36,124,0,106,4,114,86,100,5,160,3,124,1,124,0,106, - 1,161,2,83,0,100,6,160,3,124,0,106,0,124,0,106, - 1,161,2,83,0,100,1,83,0,41,7,122,38,82,101,116, - 117,114,110,32,116,104,101,32,114,101,112,114,32,116,111,32, - 117,115,101,32,102,111,114,32,116,104,101,32,109,111,100,117, - 108,101,46,78,114,101,0,0,0,114,102,0,0,0,114,103, - 0,0,0,114,104,0,0,0,250,18,60,109,111,100,117,108, - 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,17, - 0,0,0,114,114,0,0,0,114,110,0,0,0,114,46,0, - 0,0,114,124,0,0,0,41,2,114,96,0,0,0,114,17, + 112,111,114,116,46,10,10,84,104,105,115,32,109,111,100,117, + 108,101,32,105,115,32,78,79,84,32,109,101,97,110,116,32, + 116,111,32,98,101,32,100,105,114,101,99,116,108,121,32,105, + 109,112,111,114,116,101,100,33,32,73,116,32,104,97,115,32, + 98,101,101,110,32,100,101,115,105,103,110,101,100,32,115,117, + 99,104,10,116,104,97,116,32,105,116,32,99,97,110,32,98, + 101,32,98,111,111,116,115,116,114,97,112,112,101,100,32,105, + 110,116,111,32,80,121,116,104,111,110,32,97,115,32,116,104, + 101,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, + 32,111,102,32,105,109,112,111,114,116,46,32,65,115,10,115, + 117,99,104,32,105,116,32,114,101,113,117,105,114,101,115,32, + 116,104,101,32,105,110,106,101,99,116,105,111,110,32,111,102, + 32,115,112,101,99,105,102,105,99,32,109,111,100,117,108,101, + 115,32,97,110,100,32,97,116,116,114,105,98,117,116,101,115, + 32,105,110,32,111,114,100,101,114,32,116,111,10,119,111,114, + 107,46,32,79,110,101,32,115,104,111,117,108,100,32,117,115, + 101,32,105,109,112,111,114,116,108,105,98,32,97,115,32,116, + 104,101,32,112,117,98,108,105,99,45,102,97,99,105,110,103, + 32,118,101,114,115,105,111,110,32,111,102,32,116,104,105,115, + 32,109,111,100,117,108,101,46,10,10,78,99,2,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,7,0,0,0, + 67,0,0,0,115,56,0,0,0,100,1,68,0,93,32,125, + 2,116,0,124,1,124,2,131,2,114,4,116,1,124,0,124, + 2,116,2,124,1,124,2,131,2,131,3,1,0,113,4,124, + 0,106,3,160,4,124,1,106,3,161,1,1,0,100,2,83, + 0,41,3,122,47,83,105,109,112,108,101,32,115,117,98,115, + 116,105,116,117,116,101,32,102,111,114,32,102,117,110,99,116, + 111,111,108,115,46,117,112,100,97,116,101,95,119,114,97,112, + 112,101,114,46,41,4,218,10,95,95,109,111,100,117,108,101, + 95,95,218,8,95,95,110,97,109,101,95,95,218,12,95,95, + 113,117,97,108,110,97,109,101,95,95,218,7,95,95,100,111, + 99,95,95,78,41,5,218,7,104,97,115,97,116,116,114,218, + 7,115,101,116,97,116,116,114,218,7,103,101,116,97,116,116, + 114,218,8,95,95,100,105,99,116,95,95,218,6,117,112,100, + 97,116,101,41,3,90,3,110,101,119,90,3,111,108,100,218, + 7,114,101,112,108,97,99,101,169,0,114,10,0,0,0,250, + 29,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108, + 105,98,46,95,98,111,111,116,115,116,114,97,112,62,218,5, + 95,119,114,97,112,27,0,0,0,115,8,0,0,0,0,2, + 8,1,10,1,20,1,114,12,0,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0, + 67,0,0,0,115,12,0,0,0,116,0,116,1,131,1,124, + 0,131,1,83,0,169,1,78,41,2,218,4,116,121,112,101, + 218,3,115,121,115,169,1,218,4,110,97,109,101,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,11,95,110, + 101,119,95,109,111,100,117,108,101,35,0,0,0,115,2,0, + 0,0,0,1,114,18,0,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0, + 0,0,115,12,0,0,0,101,0,90,1,100,0,90,2,100, + 1,83,0,41,2,218,14,95,68,101,97,100,108,111,99,107, + 69,114,114,111,114,78,41,3,114,1,0,0,0,114,0,0, + 0,0,114,2,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,19,0,0,0, + 48,0,0,0,115,2,0,0,0,8,1,114,19,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,64,0,0,0,115,56,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,4,100,5,132,0,90,5,100,6,100,7,132,0, + 90,6,100,8,100,9,132,0,90,7,100,10,100,11,132,0, + 90,8,100,12,83,0,41,13,218,11,95,77,111,100,117,108, + 101,76,111,99,107,122,169,65,32,114,101,99,117,114,115,105, + 118,101,32,108,111,99,107,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,119,104,105,99,104,32,105,115,32, + 97,98,108,101,32,116,111,32,100,101,116,101,99,116,32,100, + 101,97,100,108,111,99,107,115,10,32,32,32,32,40,101,46, + 103,46,32,116,104,114,101,97,100,32,49,32,116,114,121,105, + 110,103,32,116,111,32,116,97,107,101,32,108,111,99,107,115, + 32,65,32,116,104,101,110,32,66,44,32,97,110,100,32,116, + 104,114,101,97,100,32,50,32,116,114,121,105,110,103,32,116, + 111,10,32,32,32,32,116,97,107,101,32,108,111,99,107,115, + 32,66,32,116,104,101,110,32,65,41,46,10,32,32,32,32, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,2,0,0,0,67,0,0,0,115,48,0,0,0,116,0, + 160,1,161,0,124,0,95,2,116,0,160,1,161,0,124,0, + 95,3,124,1,124,0,95,4,100,0,124,0,95,5,100,1, + 124,0,95,6,100,1,124,0,95,7,100,0,83,0,169,2, + 78,233,0,0,0,0,41,8,218,7,95,116,104,114,101,97, + 100,90,13,97,108,108,111,99,97,116,101,95,108,111,99,107, + 218,4,108,111,99,107,218,6,119,97,107,101,117,112,114,17, + 0,0,0,218,5,111,119,110,101,114,218,5,99,111,117,110, + 116,218,7,119,97,105,116,101,114,115,169,2,218,4,115,101, + 108,102,114,17,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,8,95,95,105,110,105,116,95,95, + 58,0,0,0,115,12,0,0,0,0,1,10,1,10,1,6, + 1,6,1,6,1,122,20,95,77,111,100,117,108,101,76,111, + 99,107,46,95,95,105,110,105,116,95,95,99,1,0,0,0, + 0,0,0,0,0,0,0,0,5,0,0,0,3,0,0,0, + 67,0,0,0,115,88,0,0,0,116,0,160,1,161,0,125, + 1,124,0,106,2,125,2,116,3,131,0,125,3,116,4,160, + 5,124,2,161,1,125,4,124,4,100,0,117,0,114,42,100, + 1,83,0,124,4,106,2,125,2,124,2,124,1,107,2,114, + 60,100,2,83,0,124,2,124,3,118,0,114,72,100,1,83, + 0,124,3,160,6,124,2,161,1,1,0,113,20,100,0,83, + 0,41,3,78,70,84,41,7,114,23,0,0,0,218,9,103, + 101,116,95,105,100,101,110,116,114,26,0,0,0,218,3,115, + 101,116,218,12,95,98,108,111,99,107,105,110,103,95,111,110, + 218,3,103,101,116,218,3,97,100,100,41,5,114,30,0,0, + 0,90,2,109,101,218,3,116,105,100,90,4,115,101,101,110, + 114,24,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,12,104,97,115,95,100,101,97,100,108,111, + 99,107,66,0,0,0,115,24,0,0,0,0,2,8,1,6, + 1,6,2,10,1,8,1,4,1,6,1,8,1,4,1,8, + 6,4,1,122,24,95,77,111,100,117,108,101,76,111,99,107, + 46,104,97,115,95,100,101,97,100,108,111,99,107,99,1,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,0, + 0,0,67,0,0,0,115,210,0,0,0,116,0,160,1,161, + 0,125,1,124,0,116,2,124,1,60,0,122,180,124,0,106, + 3,143,126,1,0,124,0,106,4,100,1,107,2,115,46,124, + 0,106,5,124,1,107,2,114,90,124,1,124,0,95,5,124, + 0,4,0,106,4,100,2,55,0,2,0,95,4,87,0,100, + 3,4,0,4,0,131,3,1,0,87,0,116,2,124,1,61, + 0,100,4,83,0,124,0,160,6,161,0,114,110,116,7,100, + 5,124,0,22,0,131,1,130,1,124,0,106,8,160,9,100, + 6,161,1,114,136,124,0,4,0,106,10,100,2,55,0,2, + 0,95,10,87,0,100,3,4,0,4,0,131,3,1,0,110, + 16,49,0,115,156,48,0,1,0,1,0,1,0,89,0,1, + 0,124,0,106,8,160,9,161,0,1,0,124,0,106,8,160, + 11,161,0,1,0,113,18,87,0,116,2,124,1,61,0,110, + 8,116,2,124,1,61,0,48,0,100,3,83,0,41,7,122, + 185,10,32,32,32,32,32,32,32,32,65,99,113,117,105,114, + 101,32,116,104,101,32,109,111,100,117,108,101,32,108,111,99, + 107,46,32,32,73,102,32,97,32,112,111,116,101,110,116,105, + 97,108,32,100,101,97,100,108,111,99,107,32,105,115,32,100, + 101,116,101,99,116,101,100,44,10,32,32,32,32,32,32,32, + 32,97,32,95,68,101,97,100,108,111,99,107,69,114,114,111, + 114,32,105,115,32,114,97,105,115,101,100,46,10,32,32,32, + 32,32,32,32,32,79,116,104,101,114,119,105,115,101,44,32, + 116,104,101,32,108,111,99,107,32,105,115,32,97,108,119,97, + 121,115,32,97,99,113,117,105,114,101,100,32,97,110,100,32, + 84,114,117,101,32,105,115,32,114,101,116,117,114,110,101,100, + 46,10,32,32,32,32,32,32,32,32,114,22,0,0,0,233, + 1,0,0,0,78,84,122,23,100,101,97,100,108,111,99,107, + 32,100,101,116,101,99,116,101,100,32,98,121,32,37,114,70, + 41,12,114,23,0,0,0,114,32,0,0,0,114,34,0,0, + 0,114,24,0,0,0,114,27,0,0,0,114,26,0,0,0, + 114,38,0,0,0,114,19,0,0,0,114,25,0,0,0,218, + 7,97,99,113,117,105,114,101,114,28,0,0,0,218,7,114, + 101,108,101,97,115,101,169,2,114,30,0,0,0,114,37,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,40,0,0,0,87,0,0,0,115,34,0,0,0,0, + 6,8,1,8,1,2,2,8,1,20,1,6,1,14,1,14, + 9,6,247,4,1,8,1,12,1,12,1,44,2,10,1,14, + 2,122,19,95,77,111,100,117,108,101,76,111,99,107,46,97, + 99,113,117,105,114,101,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, + 142,0,0,0,116,0,160,1,161,0,125,1,124,0,106,2, + 143,108,1,0,124,0,106,3,124,1,107,3,114,34,116,4, + 100,1,131,1,130,1,124,0,106,5,100,2,107,4,115,48, + 74,0,130,1,124,0,4,0,106,5,100,3,56,0,2,0, + 95,5,124,0,106,5,100,2,107,2,114,108,100,0,124,0, + 95,3,124,0,106,6,114,108,124,0,4,0,106,6,100,3, + 56,0,2,0,95,6,124,0,106,7,160,8,161,0,1,0, + 87,0,100,0,4,0,4,0,131,3,1,0,110,16,49,0, + 115,128,48,0,1,0,1,0,1,0,89,0,1,0,100,0, + 83,0,41,4,78,250,31,99,97,110,110,111,116,32,114,101, + 108,101,97,115,101,32,117,110,45,97,99,113,117,105,114,101, + 100,32,108,111,99,107,114,22,0,0,0,114,39,0,0,0, + 41,9,114,23,0,0,0,114,32,0,0,0,114,24,0,0, + 0,114,26,0,0,0,218,12,82,117,110,116,105,109,101,69, + 114,114,111,114,114,27,0,0,0,114,28,0,0,0,114,25, + 0,0,0,114,41,0,0,0,114,42,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,41,0,0, + 0,112,0,0,0,115,22,0,0,0,0,1,8,1,8,1, + 10,1,8,1,14,1,14,1,10,1,6,1,6,1,14,1, + 122,19,95,77,111,100,117,108,101,76,111,99,107,46,114,101, + 108,101,97,115,101,99,1,0,0,0,0,0,0,0,0,0, + 0,0,1,0,0,0,5,0,0,0,67,0,0,0,115,18, + 0,0,0,100,1,160,0,124,0,106,1,116,2,124,0,131, + 1,161,2,83,0,41,2,78,122,23,95,77,111,100,117,108, + 101,76,111,99,107,40,123,33,114,125,41,32,97,116,32,123, + 125,169,3,218,6,102,111,114,109,97,116,114,17,0,0,0, + 218,2,105,100,169,1,114,30,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,8,95,95,114,101, + 112,114,95,95,125,0,0,0,115,2,0,0,0,0,1,122, + 20,95,77,111,100,117,108,101,76,111,99,107,46,95,95,114, + 101,112,114,95,95,78,41,9,114,1,0,0,0,114,0,0, + 0,0,114,2,0,0,0,114,3,0,0,0,114,31,0,0, + 0,114,38,0,0,0,114,40,0,0,0,114,41,0,0,0, + 114,49,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,20,0,0,0,52,0, + 0,0,115,12,0,0,0,8,1,4,5,8,8,8,21,8, + 25,8,13,114,20,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, + 0,115,48,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,100,6,100,7,132,0,90,6,100,8,100,9,132,0, + 90,7,100,10,83,0,41,11,218,16,95,68,117,109,109,121, + 77,111,100,117,108,101,76,111,99,107,122,86,65,32,115,105, + 109,112,108,101,32,95,77,111,100,117,108,101,76,111,99,107, + 32,101,113,117,105,118,97,108,101,110,116,32,102,111,114,32, + 80,121,116,104,111,110,32,98,117,105,108,100,115,32,119,105, + 116,104,111,117,116,10,32,32,32,32,109,117,108,116,105,45, + 116,104,114,101,97,100,105,110,103,32,115,117,112,112,111,114, + 116,46,99,2,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, + 124,1,124,0,95,0,100,1,124,0,95,1,100,0,83,0, + 114,21,0,0,0,41,2,114,17,0,0,0,114,27,0,0, + 0,114,29,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,31,0,0,0,133,0,0,0,115,4, + 0,0,0,0,1,6,1,122,25,95,68,117,109,109,121,77, + 111,100,117,108,101,76,111,99,107,46,95,95,105,110,105,116, + 95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,18,0,0,0, + 124,0,4,0,106,0,100,1,55,0,2,0,95,0,100,2, + 83,0,41,3,78,114,39,0,0,0,84,41,1,114,27,0, + 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,40,0,0,0,137,0,0,0,115, + 4,0,0,0,0,1,14,1,122,24,95,68,117,109,109,121, + 77,111,100,117,108,101,76,111,99,107,46,97,99,113,117,105, + 114,101,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,36,0,0,0, + 124,0,106,0,100,1,107,2,114,18,116,1,100,2,131,1, + 130,1,124,0,4,0,106,0,100,3,56,0,2,0,95,0, + 100,0,83,0,41,4,78,114,22,0,0,0,114,43,0,0, + 0,114,39,0,0,0,41,2,114,27,0,0,0,114,44,0, + 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,41,0,0,0,141,0,0,0,115, + 6,0,0,0,0,1,10,1,8,1,122,24,95,68,117,109, + 109,121,77,111,100,117,108,101,76,111,99,107,46,114,101,108, + 101,97,115,101,99,1,0,0,0,0,0,0,0,0,0,0, + 0,1,0,0,0,5,0,0,0,67,0,0,0,115,18,0, + 0,0,100,1,160,0,124,0,106,1,116,2,124,0,131,1, + 161,2,83,0,41,2,78,122,28,95,68,117,109,109,121,77, + 111,100,117,108,101,76,111,99,107,40,123,33,114,125,41,32, + 97,116,32,123,125,114,45,0,0,0,114,48,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,49, + 0,0,0,146,0,0,0,115,2,0,0,0,0,1,122,25, + 95,68,117,109,109,121,77,111,100,117,108,101,76,111,99,107, + 46,95,95,114,101,112,114,95,95,78,41,8,114,1,0,0, + 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, + 114,31,0,0,0,114,40,0,0,0,114,41,0,0,0,114, + 49,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,50,0,0,0,129,0,0, + 0,115,10,0,0,0,8,1,4,3,8,4,8,4,8,5, + 114,50,0,0,0,99,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,36, + 0,0,0,101,0,90,1,100,0,90,2,100,1,100,2,132, + 0,90,3,100,3,100,4,132,0,90,4,100,5,100,6,132, + 0,90,5,100,7,83,0,41,8,218,18,95,77,111,100,117, + 108,101,76,111,99,107,77,97,110,97,103,101,114,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, + 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, + 0,100,0,124,0,95,1,100,0,83,0,114,13,0,0,0, + 41,2,218,5,95,110,97,109,101,218,5,95,108,111,99,107, + 114,29,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,31,0,0,0,152,0,0,0,115,4,0, + 0,0,0,1,6,1,122,27,95,77,111,100,117,108,101,76, + 111,99,107,77,97,110,97,103,101,114,46,95,95,105,110,105, + 116,95,95,99,1,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,2,0,0,0,67,0,0,0,115,26,0,0, + 0,116,0,124,0,106,1,131,1,124,0,95,2,124,0,106, + 2,160,3,161,0,1,0,100,0,83,0,114,13,0,0,0, + 41,4,218,16,95,103,101,116,95,109,111,100,117,108,101,95, + 108,111,99,107,114,52,0,0,0,114,53,0,0,0,114,40, + 0,0,0,114,48,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,9,95,95,101,110,116,101,114, + 95,95,156,0,0,0,115,4,0,0,0,0,1,12,1,122, + 28,95,77,111,100,117,108,101,76,111,99,107,77,97,110,97, + 103,101,114,46,95,95,101,110,116,101,114,95,95,99,1,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0, + 0,0,79,0,0,0,115,14,0,0,0,124,0,106,0,160, + 1,161,0,1,0,100,0,83,0,114,13,0,0,0,41,2, + 114,53,0,0,0,114,41,0,0,0,41,3,114,30,0,0, + 0,218,4,97,114,103,115,90,6,107,119,97,114,103,115,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, + 95,95,101,120,105,116,95,95,160,0,0,0,115,2,0,0, + 0,0,1,122,27,95,77,111,100,117,108,101,76,111,99,107, + 77,97,110,97,103,101,114,46,95,95,101,120,105,116,95,95, + 78,41,6,114,1,0,0,0,114,0,0,0,0,114,2,0, + 0,0,114,31,0,0,0,114,55,0,0,0,114,57,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,51,0,0,0,150,0,0,0,115,6, + 0,0,0,8,2,8,4,8,4,114,51,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8, + 0,0,0,67,0,0,0,115,136,0,0,0,116,0,160,1, + 161,0,1,0,122,112,122,14,116,2,124,0,25,0,131,0, + 125,1,87,0,110,22,4,0,116,3,121,46,1,0,1,0, + 1,0,100,1,125,1,89,0,110,2,48,0,124,1,100,1, + 117,0,114,110,116,4,100,1,117,0,114,74,116,5,124,0, + 131,1,125,1,110,8,116,6,124,0,131,1,125,1,124,0, + 102,1,100,2,100,3,132,1,125,2,116,7,160,8,124,1, + 124,2,161,2,116,2,124,0,60,0,87,0,116,0,160,9, + 161,0,1,0,110,10,116,0,160,9,161,0,1,0,48,0, + 124,1,83,0,41,4,122,139,71,101,116,32,111,114,32,99, + 114,101,97,116,101,32,116,104,101,32,109,111,100,117,108,101, + 32,108,111,99,107,32,102,111,114,32,97,32,103,105,118,101, + 110,32,109,111,100,117,108,101,32,110,97,109,101,46,10,10, + 32,32,32,32,65,99,113,117,105,114,101,47,114,101,108,101, + 97,115,101,32,105,110,116,101,114,110,97,108,108,121,32,116, + 104,101,32,103,108,111,98,97,108,32,105,109,112,111,114,116, + 32,108,111,99,107,32,116,111,32,112,114,111,116,101,99,116, + 10,32,32,32,32,95,109,111,100,117,108,101,95,108,111,99, + 107,115,46,78,99,2,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,8,0,0,0,83,0,0,0,115,56,0, + 0,0,116,0,160,1,161,0,1,0,122,32,116,2,160,3, + 124,1,161,1,124,0,117,0,114,30,116,2,124,1,61,0, + 87,0,116,0,160,4,161,0,1,0,110,10,116,0,160,4, + 161,0,1,0,48,0,100,0,83,0,114,13,0,0,0,41, + 5,218,4,95,105,109,112,218,12,97,99,113,117,105,114,101, + 95,108,111,99,107,218,13,95,109,111,100,117,108,101,95,108, + 111,99,107,115,114,35,0,0,0,218,12,114,101,108,101,97, + 115,101,95,108,111,99,107,41,2,218,3,114,101,102,114,17, 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,108,0,0,0,63,2,0,0,115,16,0,0,0, - 0,3,20,1,10,1,10,1,10,2,16,2,6,1,14,2, - 114,108,0,0,0,99,2,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,10,0,0,0,67,0,0,0,115,250, - 0,0,0,124,0,106,0,125,2,116,1,124,2,131,1,143, - 216,1,0,116,2,106,3,160,4,124,2,161,1,124,1,117, - 1,114,54,100,1,160,5,124,2,161,1,125,3,116,6,124, - 3,124,2,100,2,141,2,130,1,122,132,124,0,106,7,100, - 3,117,0,114,106,124,0,106,8,100,3,117,0,114,90,116, - 6,100,4,124,0,106,0,100,2,141,2,130,1,116,9,124, - 0,124,1,100,5,100,6,141,3,1,0,110,52,116,9,124, - 0,124,1,100,5,100,6,141,3,1,0,116,10,124,0,106, - 7,100,7,131,2,115,146,124,0,106,7,160,11,124,2,161, - 1,1,0,110,12,124,0,106,7,160,12,124,1,161,1,1, - 0,87,0,116,2,106,3,160,13,124,0,106,0,161,1,125, - 1,124,1,116,2,106,3,124,0,106,0,60,0,110,28,116, - 2,106,3,160,13,124,0,106,0,161,1,125,1,124,1,116, - 2,106,3,124,0,106,0,60,0,48,0,87,0,100,3,4, - 0,4,0,131,3,1,0,110,16,49,0,115,236,48,0,1, - 0,1,0,1,0,89,0,1,0,124,1,83,0,41,8,122, - 70,69,120,101,99,117,116,101,32,116,104,101,32,115,112,101, - 99,39,115,32,115,112,101,99,105,102,105,101,100,32,109,111, - 100,117,108,101,32,105,110,32,97,110,32,101,120,105,115,116, - 105,110,103,32,109,111,100,117,108,101,39,115,32,110,97,109, - 101,115,112,97,99,101,46,122,30,109,111,100,117,108,101,32, - 123,33,114,125,32,110,111,116,32,105,110,32,115,121,115,46, - 109,111,100,117,108,101,115,114,16,0,0,0,78,250,14,109, - 105,115,115,105,110,103,32,108,111,97,100,101,114,84,114,144, - 0,0,0,114,151,0,0,0,41,14,114,17,0,0,0,114, - 51,0,0,0,114,15,0,0,0,114,93,0,0,0,114,35, - 0,0,0,114,46,0,0,0,114,80,0,0,0,114,110,0, - 0,0,114,117,0,0,0,114,149,0,0,0,114,4,0,0, - 0,218,11,108,111,97,100,95,109,111,100,117,108,101,114,151, - 0,0,0,218,3,112,111,112,41,4,114,96,0,0,0,114, - 97,0,0,0,114,17,0,0,0,218,3,109,115,103,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,94,0, - 0,0,80,2,0,0,115,38,0,0,0,0,2,6,1,10, - 1,16,1,10,1,12,1,2,1,10,1,10,1,14,2,16, - 2,14,1,12,4,14,2,14,4,14,1,14,255,14,1,44, - 1,114,94,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, - 20,1,0,0,122,18,124,0,106,0,160,1,124,0,106,2, - 161,1,1,0,87,0,110,52,1,0,1,0,1,0,124,0, - 106,2,116,3,106,4,118,0,114,64,116,3,106,4,160,5, - 124,0,106,2,161,1,125,1,124,1,116,3,106,4,124,0, - 106,2,60,0,130,0,89,0,110,2,48,0,116,3,106,4, - 160,5,124,0,106,2,161,1,125,1,124,1,116,3,106,4, - 124,0,106,2,60,0,116,6,124,1,100,1,100,0,131,3, - 100,0,117,0,114,146,122,12,124,0,106,0,124,1,95,7, - 87,0,110,18,4,0,116,8,121,144,1,0,1,0,1,0, - 89,0,110,2,48,0,116,6,124,1,100,2,100,0,131,3, - 100,0,117,0,114,222,122,40,124,1,106,9,124,1,95,10, - 116,11,124,1,100,3,131,2,115,200,124,0,106,2,160,12, - 100,4,161,1,100,5,25,0,124,1,95,10,87,0,110,18, - 4,0,116,8,121,220,1,0,1,0,1,0,89,0,110,2, - 48,0,116,6,124,1,100,6,100,0,131,3,100,0,117,0, - 144,1,114,16,122,10,124,0,124,1,95,13,87,0,110,20, - 4,0,116,8,144,1,121,14,1,0,1,0,1,0,89,0, - 110,2,48,0,124,1,83,0,41,7,78,114,99,0,0,0, - 114,146,0,0,0,114,142,0,0,0,114,129,0,0,0,114, - 22,0,0,0,114,106,0,0,0,41,14,114,110,0,0,0, - 114,156,0,0,0,114,17,0,0,0,114,15,0,0,0,114, - 93,0,0,0,114,157,0,0,0,114,6,0,0,0,114,99, - 0,0,0,114,107,0,0,0,114,1,0,0,0,114,146,0, - 0,0,114,4,0,0,0,114,130,0,0,0,114,106,0,0, - 0,114,152,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,25,95,108,111,97,100,95,98,97,99, - 107,119,97,114,100,95,99,111,109,112,97,116,105,98,108,101, - 110,2,0,0,115,54,0,0,0,0,4,2,1,18,1,6, - 1,12,1,14,1,12,1,8,3,14,1,12,1,16,1,2, - 1,12,1,12,1,6,1,16,1,2,4,8,1,10,1,22, - 1,12,1,6,1,18,1,2,1,10,1,14,1,6,1,114, - 159,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,11,0,0,0,67,0,0,0,115,224,0, - 0,0,124,0,106,0,100,0,117,1,114,30,116,1,124,0, - 106,0,100,1,131,2,115,30,116,2,124,0,131,1,83,0, - 116,3,124,0,131,1,125,1,100,2,124,0,95,4,122,166, - 124,1,116,5,106,6,124,0,106,7,60,0,122,52,124,0, - 106,0,100,0,117,0,114,96,124,0,106,8,100,0,117,0, - 114,108,116,9,100,3,124,0,106,7,100,4,141,2,130,1, - 110,12,124,0,106,0,160,10,124,1,161,1,1,0,87,0, - 110,48,1,0,1,0,1,0,122,14,116,5,106,6,124,0, - 106,7,61,0,87,0,110,18,4,0,116,11,121,150,1,0, - 1,0,1,0,89,0,110,2,48,0,130,0,89,0,110,2, - 48,0,116,5,106,6,160,12,124,0,106,7,161,1,125,1, - 124,1,116,5,106,6,124,0,106,7,60,0,116,13,100,5, - 124,0,106,7,124,0,106,0,131,3,1,0,87,0,100,6, - 124,0,95,4,110,8,100,6,124,0,95,4,48,0,124,1, - 83,0,41,7,78,114,151,0,0,0,84,114,155,0,0,0, - 114,16,0,0,0,122,18,105,109,112,111,114,116,32,123,33, - 114,125,32,35,32,123,33,114,125,70,41,14,114,110,0,0, - 0,114,4,0,0,0,114,159,0,0,0,114,153,0,0,0, - 90,13,95,105,110,105,116,105,97,108,105,122,105,110,103,114, - 15,0,0,0,114,93,0,0,0,114,17,0,0,0,114,117, - 0,0,0,114,80,0,0,0,114,151,0,0,0,114,64,0, - 0,0,114,157,0,0,0,114,77,0,0,0,114,152,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,14,95,108,111,97,100,95,117,110,108,111,99,107,101,100, - 147,2,0,0,115,46,0,0,0,0,2,10,2,12,1,8, - 2,8,5,6,1,2,1,12,1,2,1,10,1,10,1,16, - 3,16,1,6,1,2,1,14,1,12,1,6,1,8,5,14, - 1,12,1,18,2,16,2,114,160,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0, - 0,67,0,0,0,115,54,0,0,0,116,0,124,0,106,1, - 131,1,143,24,1,0,116,2,124,0,131,1,87,0,2,0, - 100,1,4,0,4,0,131,3,1,0,83,0,49,0,115,40, - 48,0,1,0,1,0,1,0,89,0,1,0,100,1,83,0, - 41,2,122,191,82,101,116,117,114,110,32,97,32,110,101,119, - 32,109,111,100,117,108,101,32,111,98,106,101,99,116,44,32, - 108,111,97,100,101,100,32,98,121,32,116,104,101,32,115,112, - 101,99,39,115,32,108,111,97,100,101,114,46,10,10,32,32, - 32,32,84,104,101,32,109,111,100,117,108,101,32,105,115,32, - 110,111,116,32,97,100,100,101,100,32,116,111,32,105,116,115, - 32,112,97,114,101,110,116,46,10,10,32,32,32,32,73,102, - 32,97,32,109,111,100,117,108,101,32,105,115,32,97,108,114, - 101,97,100,121,32,105,110,32,115,121,115,46,109,111,100,117, - 108,101,115,44,32,116,104,97,116,32,101,120,105,115,116,105, - 110,103,32,109,111,100,117,108,101,32,103,101,116,115,10,32, - 32,32,32,99,108,111,98,98,101,114,101,100,46,10,10,32, - 32,32,32,78,41,3,114,51,0,0,0,114,17,0,0,0, - 114,160,0,0,0,41,1,114,96,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,95,0,0,0, - 189,2,0,0,115,4,0,0,0,0,9,12,1,114,95,0, - 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,4,0,0,0,64,0,0,0,115,140,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,90,4, - 101,5,100,3,100,4,132,0,131,1,90,6,101,7,100,20, - 100,6,100,7,132,1,131,1,90,8,101,7,100,21,100,8, - 100,9,132,1,131,1,90,9,101,7,100,10,100,11,132,0, - 131,1,90,10,101,7,100,12,100,13,132,0,131,1,90,11, - 101,7,101,12,100,14,100,15,132,0,131,1,131,1,90,13, - 101,7,101,12,100,16,100,17,132,0,131,1,131,1,90,14, - 101,7,101,12,100,18,100,19,132,0,131,1,131,1,90,15, - 101,7,101,16,131,1,90,17,100,5,83,0,41,22,218,15, - 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,122, - 144,77,101,116,97,32,112,97,116,104,32,105,109,112,111,114, - 116,32,102,111,114,32,98,117,105,108,116,45,105,110,32,109, - 111,100,117,108,101,115,46,10,10,32,32,32,32,65,108,108, - 32,109,101,116,104,111,100,115,32,97,114,101,32,101,105,116, - 104,101,114,32,99,108,97,115,115,32,111,114,32,115,116,97, - 116,105,99,32,109,101,116,104,111,100,115,32,116,111,32,97, - 118,111,105,100,32,116,104,101,32,110,101,101,100,32,116,111, - 10,32,32,32,32,105,110,115,116,97,110,116,105,97,116,101, - 32,116,104,101,32,99,108,97,115,115,46,10,10,32,32,32, - 32,122,8,98,117,105,108,116,45,105,110,99,1,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0, - 67,0,0,0,115,22,0,0,0,100,1,124,0,106,0,155, - 2,100,2,116,1,106,2,155,0,100,3,157,5,83,0,41, - 4,250,115,82,101,116,117,114,110,32,114,101,112,114,32,102, - 111,114,32,116,104,101,32,109,111,100,117,108,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,101,32,109,101,116,104, - 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, - 46,32,32,84,104,101,32,105,109,112,111,114,116,32,109,97, - 99,104,105,110,101,114,121,32,100,111,101,115,32,116,104,101, - 32,106,111,98,32,105,116,115,101,108,102,46,10,10,32,32, - 32,32,32,32,32,32,122,8,60,109,111,100,117,108,101,32, - 122,2,32,40,122,2,41,62,41,3,114,1,0,0,0,114, - 161,0,0,0,114,139,0,0,0,41,1,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 100,0,0,0,215,2,0,0,115,2,0,0,0,0,7,122, - 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, - 46,109,111,100,117,108,101,95,114,101,112,114,78,99,4,0, - 0,0,0,0,0,0,0,0,0,0,4,0,0,0,5,0, - 0,0,67,0,0,0,115,46,0,0,0,124,2,100,0,117, - 1,114,12,100,0,83,0,116,0,160,1,124,1,161,1,114, - 38,116,2,124,1,124,0,124,0,106,3,100,1,141,3,83, - 0,100,0,83,0,100,0,83,0,169,2,78,114,138,0,0, - 0,41,4,114,58,0,0,0,90,10,105,115,95,98,117,105, - 108,116,105,110,114,92,0,0,0,114,139,0,0,0,169,4, - 218,3,99,108,115,114,82,0,0,0,218,4,112,97,116,104, - 218,6,116,97,114,103,101,116,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,9,102,105,110,100,95,115,112, - 101,99,224,2,0,0,115,10,0,0,0,0,2,8,1,4, - 1,10,1,16,2,122,25,66,117,105,108,116,105,110,73,109, - 112,111,114,116,101,114,46,102,105,110,100,95,115,112,101,99, - 99,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,4,0,0,0,67,0,0,0,115,30,0,0,0,124,0, - 160,0,124,1,124,2,161,2,125,3,124,3,100,1,117,1, - 114,26,124,3,106,1,83,0,100,1,83,0,41,2,122,175, - 70,105,110,100,32,116,104,101,32,98,117,105,108,116,45,105, - 110,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, - 32,32,32,73,102,32,39,112,97,116,104,39,32,105,115,32, - 101,118,101,114,32,115,112,101,99,105,102,105,101,100,32,116, - 104,101,110,32,116,104,101,32,115,101,97,114,99,104,32,105, - 115,32,99,111,110,115,105,100,101,114,101,100,32,97,32,102, - 97,105,108,117,114,101,46,10,10,32,32,32,32,32,32,32, - 32,84,104,105,115,32,109,101,116,104,111,100,32,105,115,32, - 100,101,112,114,101,99,97,116,101,100,46,32,32,85,115,101, - 32,102,105,110,100,95,115,112,101,99,40,41,32,105,110,115, - 116,101,97,100,46,10,10,32,32,32,32,32,32,32,32,78, - 41,2,114,168,0,0,0,114,110,0,0,0,41,4,114,165, - 0,0,0,114,82,0,0,0,114,166,0,0,0,114,96,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,11,102,105,110,100,95,109,111,100,117,108,101,233,2, - 0,0,115,4,0,0,0,0,9,12,1,122,27,66,117,105, - 108,116,105,110,73,109,112,111,114,116,101,114,46,102,105,110, - 100,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, - 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, - 0,115,46,0,0,0,124,1,106,0,116,1,106,2,118,1, - 114,34,116,3,100,1,160,4,124,1,106,0,161,1,124,1, - 106,0,100,2,141,2,130,1,116,5,116,6,106,7,124,1, - 131,2,83,0,41,3,122,24,67,114,101,97,116,101,32,97, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, - 114,78,0,0,0,114,16,0,0,0,41,8,114,17,0,0, - 0,114,15,0,0,0,114,79,0,0,0,114,80,0,0,0, - 114,46,0,0,0,114,68,0,0,0,114,58,0,0,0,90, - 14,99,114,101,97,116,101,95,98,117,105,108,116,105,110,41, - 2,114,30,0,0,0,114,96,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,150,0,0,0,245, - 2,0,0,115,10,0,0,0,0,3,12,1,12,1,4,255, - 6,2,122,29,66,117,105,108,116,105,110,73,109,112,111,114, - 116,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,116, - 0,116,1,106,2,124,1,131,2,1,0,100,1,83,0,41, - 2,122,22,69,120,101,99,32,97,32,98,117,105,108,116,45, - 105,110,32,109,111,100,117,108,101,78,41,3,114,68,0,0, - 0,114,58,0,0,0,90,12,101,120,101,99,95,98,117,105, - 108,116,105,110,41,2,114,30,0,0,0,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 151,0,0,0,253,2,0,0,115,2,0,0,0,0,3,122, - 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, - 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, - 122,57,82,101,116,117,114,110,32,78,111,110,101,32,97,115, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, - 115,32,100,111,32,110,111,116,32,104,97,118,101,32,99,111, - 100,101,32,111,98,106,101,99,116,115,46,78,114,10,0,0, - 0,169,2,114,165,0,0,0,114,82,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,8,103,101, - 116,95,99,111,100,101,2,3,0,0,115,2,0,0,0,0, - 4,122,24,66,117,105,108,116,105,110,73,109,112,111,114,116, - 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, - 56,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, - 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, - 32,100,111,32,110,111,116,32,104,97,118,101,32,115,111,117, - 114,99,101,32,99,111,100,101,46,78,114,10,0,0,0,114, - 170,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,8, - 3,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, - 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, - 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 4,0,0,0,100,1,83,0,41,2,122,52,82,101,116,117, - 114,110,32,70,97,108,115,101,32,97,115,32,98,117,105,108, - 116,45,105,110,32,109,111,100,117,108,101,115,32,97,114,101, - 32,110,101,118,101,114,32,112,97,99,107,97,103,101,115,46, - 70,114,10,0,0,0,114,170,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,116,0,0,0,14, - 3,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, - 116,105,110,73,109,112,111,114,116,101,114,46,105,115,95,112, - 97,99,107,97,103,101,41,2,78,78,41,1,78,41,18,114, - 1,0,0,0,114,0,0,0,0,114,2,0,0,0,114,3, - 0,0,0,114,139,0,0,0,218,12,115,116,97,116,105,99, - 109,101,116,104,111,100,114,100,0,0,0,218,11,99,108,97, - 115,115,109,101,116,104,111,100,114,168,0,0,0,114,169,0, - 0,0,114,150,0,0,0,114,151,0,0,0,114,87,0,0, - 0,114,171,0,0,0,114,172,0,0,0,114,116,0,0,0, - 114,98,0,0,0,114,156,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,161, - 0,0,0,204,2,0,0,115,44,0,0,0,8,2,4,7, - 4,2,2,1,10,8,2,1,12,8,2,1,12,11,2,1, - 10,7,2,1,10,4,2,1,2,1,12,4,2,1,2,1, - 12,4,2,1,2,1,12,4,114,161,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0, - 0,0,64,0,0,0,115,144,0,0,0,101,0,90,1,100, - 0,90,2,100,1,90,3,100,2,90,4,101,5,100,3,100, - 4,132,0,131,1,90,6,101,7,100,22,100,6,100,7,132, - 1,131,1,90,8,101,7,100,23,100,8,100,9,132,1,131, - 1,90,9,101,7,100,10,100,11,132,0,131,1,90,10,101, - 5,100,12,100,13,132,0,131,1,90,11,101,7,100,14,100, - 15,132,0,131,1,90,12,101,7,101,13,100,16,100,17,132, - 0,131,1,131,1,90,14,101,7,101,13,100,18,100,19,132, - 0,131,1,131,1,90,15,101,7,101,13,100,20,100,21,132, - 0,131,1,131,1,90,16,100,5,83,0,41,24,218,14,70, - 114,111,122,101,110,73,109,112,111,114,116,101,114,122,142,77, - 101,116,97,32,112,97,116,104,32,105,109,112,111,114,116,32, - 102,111,114,32,102,114,111,122,101,110,32,109,111,100,117,108, - 101,115,46,10,10,32,32,32,32,65,108,108,32,109,101,116, - 104,111,100,115,32,97,114,101,32,101,105,116,104,101,114,32, - 99,108,97,115,115,32,111,114,32,115,116,97,116,105,99,32, - 109,101,116,104,111,100,115,32,116,111,32,97,118,111,105,100, - 32,116,104,101,32,110,101,101,100,32,116,111,10,32,32,32, - 32,105,110,115,116,97,110,116,105,97,116,101,32,116,104,101, - 32,99,108,97,115,115,46,10,10,32,32,32,32,90,6,102, - 114,111,122,101,110,99,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,16, - 0,0,0,100,1,160,0,124,0,106,1,116,2,106,3,161, - 2,83,0,41,2,114,162,0,0,0,114,154,0,0,0,41, - 4,114,46,0,0,0,114,1,0,0,0,114,175,0,0,0, - 114,139,0,0,0,41,1,218,1,109,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,100,0,0,0,34,3, - 0,0,115,2,0,0,0,0,7,122,26,70,114,111,122,101, - 110,73,109,112,111,114,116,101,114,46,109,111,100,117,108,101, - 95,114,101,112,114,78,99,4,0,0,0,0,0,0,0,0, - 0,0,0,4,0,0,0,5,0,0,0,67,0,0,0,115, - 34,0,0,0,116,0,160,1,124,1,161,1,114,26,116,2, - 124,1,124,0,124,0,106,3,100,1,141,3,83,0,100,0, - 83,0,100,0,83,0,114,163,0,0,0,41,4,114,58,0, - 0,0,114,89,0,0,0,114,92,0,0,0,114,139,0,0, - 0,114,164,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,168,0,0,0,43,3,0,0,115,6, - 0,0,0,0,2,10,1,16,2,122,24,70,114,111,122,101, - 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,115, - 112,101,99,99,3,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, - 0,116,0,160,1,124,1,161,1,114,14,124,0,83,0,100, - 1,83,0,41,2,122,93,70,105,110,100,32,97,32,102,114, - 111,122,101,110,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,85,115,101,32,102,105,110,100,95,115,112,101,99,40, - 41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32, - 32,32,32,32,78,41,2,114,58,0,0,0,114,89,0,0, - 0,41,3,114,165,0,0,0,114,82,0,0,0,114,166,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,169,0,0,0,50,3,0,0,115,2,0,0,0,0, - 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, - 114,46,102,105,110,100,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,122,42,85,115,101,32,100,101,102,97,117,108,116,32,115, - 101,109,97,110,116,105,99,115,32,102,111,114,32,109,111,100, - 117,108,101,32,99,114,101,97,116,105,111,110,46,78,114,10, - 0,0,0,41,2,114,165,0,0,0,114,96,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,150, - 0,0,0,59,3,0,0,115,2,0,0,0,0,2,122,28, - 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,99, - 114,101,97,116,101,95,109,111,100,117,108,101,99,1,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0, - 0,67,0,0,0,115,64,0,0,0,124,0,106,0,106,1, - 125,1,116,2,160,3,124,1,161,1,115,36,116,4,100,1, - 160,5,124,1,161,1,124,1,100,2,141,2,130,1,116,6, - 116,2,106,7,124,1,131,2,125,2,116,8,124,2,124,0, - 106,9,131,2,1,0,100,0,83,0,114,88,0,0,0,41, - 10,114,106,0,0,0,114,17,0,0,0,114,58,0,0,0, - 114,89,0,0,0,114,80,0,0,0,114,46,0,0,0,114, - 68,0,0,0,218,17,103,101,116,95,102,114,111,122,101,110, - 95,111,98,106,101,99,116,218,4,101,120,101,99,114,7,0, - 0,0,41,3,114,97,0,0,0,114,17,0,0,0,218,4, - 99,111,100,101,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,151,0,0,0,63,3,0,0,115,14,0,0, - 0,0,2,8,1,10,1,10,1,2,255,6,2,12,1,122, - 26,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, - 101,120,101,99,95,109,111,100,117,108,101,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,10,0,0,0,116,0,124,0,124,1,131, - 2,83,0,41,1,122,95,76,111,97,100,32,97,32,102,114, - 111,122,101,110,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, - 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, - 32,32,32,32,32,32,41,1,114,98,0,0,0,114,170,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,156,0,0,0,72,3,0,0,115,2,0,0,0,0, - 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, - 114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,10,0,0,0,116,0,160,1,124, - 1,161,1,83,0,41,1,122,45,82,101,116,117,114,110,32, - 116,104,101,32,99,111,100,101,32,111,98,106,101,99,116,32, - 102,111,114,32,116,104,101,32,102,114,111,122,101,110,32,109, - 111,100,117,108,101,46,41,2,114,58,0,0,0,114,177,0, - 0,0,114,170,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,171,0,0,0,81,3,0,0,115, - 2,0,0,0,0,4,122,23,70,114,111,122,101,110,73,109, - 112,111,114,116,101,114,46,103,101,116,95,99,111,100,101,99, - 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,122,54,82,101,116,117,114,110,32,78,111,110,101, - 32,97,115,32,102,114,111,122,101,110,32,109,111,100,117,108, - 101,115,32,100,111,32,110,111,116,32,104,97,118,101,32,115, - 111,117,114,99,101,32,99,111,100,101,46,78,114,10,0,0, - 0,114,170,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,172,0,0,0,87,3,0,0,115,2, - 0,0,0,0,4,122,25,70,114,111,122,101,110,73,109,112, - 111,114,116,101,114,46,103,101,116,95,115,111,117,114,99,101, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,67,0,0,0,115,10,0,0,0,116,0, - 160,1,124,1,161,1,83,0,41,1,122,46,82,101,116,117, - 114,110,32,84,114,117,101,32,105,102,32,116,104,101,32,102, - 114,111,122,101,110,32,109,111,100,117,108,101,32,105,115,32, - 97,32,112,97,99,107,97,103,101,46,41,2,114,58,0,0, - 0,90,17,105,115,95,102,114,111,122,101,110,95,112,97,99, - 107,97,103,101,114,170,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,116,0,0,0,93,3,0, - 0,115,2,0,0,0,0,4,122,25,70,114,111,122,101,110, - 73,109,112,111,114,116,101,114,46,105,115,95,112,97,99,107, - 97,103,101,41,2,78,78,41,1,78,41,17,114,1,0,0, - 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, - 114,139,0,0,0,114,173,0,0,0,114,100,0,0,0,114, - 174,0,0,0,114,168,0,0,0,114,169,0,0,0,114,150, - 0,0,0,114,151,0,0,0,114,156,0,0,0,114,91,0, - 0,0,114,171,0,0,0,114,172,0,0,0,114,116,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,175,0,0,0,23,3,0,0,115,46, - 0,0,0,8,2,4,7,4,2,2,1,10,8,2,1,12, - 6,2,1,12,8,2,1,10,3,2,1,10,8,2,1,10, - 8,2,1,2,1,12,4,2,1,2,1,12,4,2,1,2, - 1,114,175,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, - 32,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 100,6,83,0,41,7,218,18,95,73,109,112,111,114,116,76, - 111,99,107,67,111,110,116,101,120,116,122,36,67,111,110,116, - 101,120,116,32,109,97,110,97,103,101,114,32,102,111,114,32, - 116,104,101,32,105,109,112,111,114,116,32,108,111,99,107,46, - 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - 0,2,0,0,0,67,0,0,0,115,12,0,0,0,116,0, - 160,1,161,0,1,0,100,1,83,0,41,2,122,24,65,99, - 113,117,105,114,101,32,116,104,101,32,105,109,112,111,114,116, - 32,108,111,99,107,46,78,41,2,114,58,0,0,0,114,59, - 0,0,0,114,48,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,55,0,0,0,106,3,0,0, - 115,2,0,0,0,0,2,122,28,95,73,109,112,111,114,116, - 76,111,99,107,67,111,110,116,101,120,116,46,95,95,101,110, - 116,101,114,95,95,99,4,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,2,0,0,0,67,0,0,0,115,12, - 0,0,0,116,0,160,1,161,0,1,0,100,1,83,0,41, - 2,122,60,82,101,108,101,97,115,101,32,116,104,101,32,105, - 109,112,111,114,116,32,108,111,99,107,32,114,101,103,97,114, - 100,108,101,115,115,32,111,102,32,97,110,121,32,114,97,105, - 115,101,100,32,101,120,99,101,112,116,105,111,110,115,46,78, - 41,2,114,58,0,0,0,114,61,0,0,0,41,4,114,30, - 0,0,0,218,8,101,120,99,95,116,121,112,101,218,9,101, - 120,99,95,118,97,108,117,101,218,13,101,120,99,95,116,114, - 97,99,101,98,97,99,107,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,57,0,0,0,110,3,0,0,115, - 2,0,0,0,0,2,122,27,95,73,109,112,111,114,116,76, - 111,99,107,67,111,110,116,101,120,116,46,95,95,101,120,105, - 116,95,95,78,41,6,114,1,0,0,0,114,0,0,0,0, - 114,2,0,0,0,114,3,0,0,0,114,55,0,0,0,114, - 57,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,180,0,0,0,102,3,0, - 0,115,6,0,0,0,8,2,4,2,8,4,114,180,0,0, - 0,99,3,0,0,0,0,0,0,0,0,0,0,0,5,0, - 0,0,5,0,0,0,67,0,0,0,115,64,0,0,0,124, - 1,160,0,100,1,124,2,100,2,24,0,161,2,125,3,116, - 1,124,3,131,1,124,2,107,0,114,36,116,2,100,3,131, - 1,130,1,124,3,100,4,25,0,125,4,124,0,114,60,100, - 5,160,3,124,4,124,0,161,2,83,0,124,4,83,0,41, - 6,122,50,82,101,115,111,108,118,101,32,97,32,114,101,108, - 97,116,105,118,101,32,109,111,100,117,108,101,32,110,97,109, - 101,32,116,111,32,97,110,32,97,98,115,111,108,117,116,101, - 32,111,110,101,46,114,129,0,0,0,114,39,0,0,0,122, - 50,97,116,116,101,109,112,116,101,100,32,114,101,108,97,116, - 105,118,101,32,105,109,112,111,114,116,32,98,101,121,111,110, - 100,32,116,111,112,45,108,101,118,101,108,32,112,97,99,107, - 97,103,101,114,22,0,0,0,250,5,123,125,46,123,125,41, - 4,218,6,114,115,112,108,105,116,218,3,108,101,110,114,80, - 0,0,0,114,46,0,0,0,41,5,114,17,0,0,0,218, - 7,112,97,99,107,97,103,101,218,5,108,101,118,101,108,90, - 4,98,105,116,115,90,4,98,97,115,101,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,13,95,114,101,115, - 111,108,118,101,95,110,97,109,101,115,3,0,0,115,10,0, - 0,0,0,2,16,1,12,1,8,1,8,1,114,189,0,0, - 0,99,3,0,0,0,0,0,0,0,0,0,0,0,4,0, - 0,0,4,0,0,0,67,0,0,0,115,34,0,0,0,124, - 0,160,0,124,1,124,2,161,2,125,3,124,3,100,0,117, - 0,114,24,100,0,83,0,116,1,124,1,124,3,131,2,83, - 0,114,13,0,0,0,41,2,114,169,0,0,0,114,92,0, - 0,0,41,4,218,6,102,105,110,100,101,114,114,17,0,0, - 0,114,166,0,0,0,114,110,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,17,95,102,105,110, - 100,95,115,112,101,99,95,108,101,103,97,99,121,124,3,0, - 0,115,8,0,0,0,0,3,12,1,8,1,4,1,114,191, - 0,0,0,99,3,0,0,0,0,0,0,0,0,0,0,0, - 10,0,0,0,10,0,0,0,67,0,0,0,115,32,1,0, - 0,116,0,106,1,125,3,124,3,100,1,117,0,114,22,116, - 2,100,2,131,1,130,1,124,3,115,38,116,3,160,4,100, - 3,116,5,161,2,1,0,124,0,116,0,106,6,118,0,125, - 4,124,3,68,0,93,230,125,5,116,7,131,0,143,94,1, - 0,122,10,124,5,106,8,125,6,87,0,110,54,4,0,116, - 9,121,128,1,0,1,0,1,0,116,10,124,5,124,0,124, - 1,131,3,125,7,124,7,100,1,117,0,114,124,89,0,87, - 0,100,1,4,0,4,0,131,3,1,0,113,52,89,0,110, - 14,48,0,124,6,124,0,124,1,124,2,131,3,125,7,87, - 0,100,1,4,0,4,0,131,3,1,0,110,16,49,0,115, - 162,48,0,1,0,1,0,1,0,89,0,1,0,124,7,100, - 1,117,1,114,52,124,4,144,1,115,18,124,0,116,0,106, - 6,118,0,144,1,114,18,116,0,106,6,124,0,25,0,125, - 8,122,10,124,8,106,11,125,9,87,0,110,26,4,0,116, - 9,121,244,1,0,1,0,1,0,124,7,6,0,89,0,2, - 0,1,0,83,0,48,0,124,9,100,1,117,0,144,1,114, - 8,124,7,2,0,1,0,83,0,124,9,2,0,1,0,83, - 0,113,52,124,7,2,0,1,0,83,0,113,52,100,1,83, - 0,41,4,122,21,70,105,110,100,32,97,32,109,111,100,117, - 108,101,39,115,32,115,112,101,99,46,78,122,53,115,121,115, - 46,109,101,116,97,95,112,97,116,104,32,105,115,32,78,111, - 110,101,44,32,80,121,116,104,111,110,32,105,115,32,108,105, - 107,101,108,121,32,115,104,117,116,116,105,110,103,32,100,111, - 119,110,122,22,115,121,115,46,109,101,116,97,95,112,97,116, - 104,32,105,115,32,101,109,112,116,121,41,12,114,15,0,0, - 0,218,9,109,101,116,97,95,112,97,116,104,114,80,0,0, - 0,218,9,95,119,97,114,110,105,110,103,115,218,4,119,97, - 114,110,218,13,73,109,112,111,114,116,87,97,114,110,105,110, - 103,114,93,0,0,0,114,180,0,0,0,114,168,0,0,0, - 114,107,0,0,0,114,191,0,0,0,114,106,0,0,0,41, - 10,114,17,0,0,0,114,166,0,0,0,114,167,0,0,0, - 114,192,0,0,0,90,9,105,115,95,114,101,108,111,97,100, - 114,190,0,0,0,114,168,0,0,0,114,96,0,0,0,114, - 97,0,0,0,114,106,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,10,95,102,105,110,100,95, - 115,112,101,99,133,3,0,0,115,54,0,0,0,0,2,6, - 1,8,2,8,3,4,1,12,5,10,1,8,1,8,1,2, - 1,10,1,12,1,12,1,8,1,22,2,42,1,8,2,18, - 1,10,1,2,1,10,1,12,4,14,2,10,1,8,2,10, - 2,10,2,114,196,0,0,0,99,3,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,5,0,0,0,67,0,0, - 0,115,108,0,0,0,116,0,124,0,116,1,131,2,115,28, - 116,2,100,1,160,3,116,4,124,0,131,1,161,1,131,1, - 130,1,124,2,100,2,107,0,114,44,116,5,100,3,131,1, - 130,1,124,2,100,2,107,4,114,84,116,0,124,1,116,1, - 131,2,115,72,116,2,100,4,131,1,130,1,110,12,124,1, - 115,84,116,6,100,5,131,1,130,1,124,0,115,104,124,2, - 100,2,107,2,114,104,116,5,100,6,131,1,130,1,100,7, - 83,0,41,8,122,28,86,101,114,105,102,121,32,97,114,103, - 117,109,101,110,116,115,32,97,114,101,32,34,115,97,110,101, - 34,46,122,31,109,111,100,117,108,101,32,110,97,109,101,32, - 109,117,115,116,32,98,101,32,115,116,114,44,32,110,111,116, - 32,123,125,114,22,0,0,0,122,18,108,101,118,101,108,32, - 109,117,115,116,32,98,101,32,62,61,32,48,122,31,95,95, - 112,97,99,107,97,103,101,95,95,32,110,111,116,32,115,101, - 116,32,116,111,32,97,32,115,116,114,105,110,103,122,54,97, - 116,116,101,109,112,116,101,100,32,114,101,108,97,116,105,118, - 101,32,105,109,112,111,114,116,32,119,105,116,104,32,110,111, - 32,107,110,111,119,110,32,112,97,114,101,110,116,32,112,97, - 99,107,97,103,101,122,17,69,109,112,116,121,32,109,111,100, - 117,108,101,32,110,97,109,101,78,41,7,218,10,105,115,105, - 110,115,116,97,110,99,101,218,3,115,116,114,218,9,84,121, - 112,101,69,114,114,111,114,114,46,0,0,0,114,14,0,0, - 0,218,10,86,97,108,117,101,69,114,114,111,114,114,80,0, - 0,0,169,3,114,17,0,0,0,114,187,0,0,0,114,188, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,13,95,115,97,110,105,116,121,95,99,104,101,99, - 107,180,3,0,0,115,22,0,0,0,0,2,10,1,18,1, - 8,1,8,1,8,1,10,1,10,1,4,1,8,2,12,1, - 114,202,0,0,0,122,16,78,111,32,109,111,100,117,108,101, - 32,110,97,109,101,100,32,122,4,123,33,114,125,99,2,0, - 0,0,0,0,0,0,0,0,0,0,9,0,0,0,8,0, - 0,0,67,0,0,0,115,22,1,0,0,100,0,125,2,124, - 0,160,0,100,1,161,1,100,2,25,0,125,3,124,3,114, - 132,124,3,116,1,106,2,118,1,114,42,116,3,124,1,124, - 3,131,2,1,0,124,0,116,1,106,2,118,0,114,62,116, - 1,106,2,124,0,25,0,83,0,116,1,106,2,124,3,25, - 0,125,4,122,10,124,4,106,4,125,2,87,0,110,48,4, - 0,116,5,121,130,1,0,1,0,1,0,116,6,100,3,23, - 0,160,7,124,0,124,3,161,2,125,5,116,8,124,5,124, - 0,100,4,141,2,100,0,130,2,89,0,110,2,48,0,116, - 9,124,0,124,2,131,2,125,6,124,6,100,0,117,0,114, - 170,116,8,116,6,160,7,124,0,161,1,124,0,100,4,141, - 2,130,1,110,8,116,10,124,6,131,1,125,7,124,3,144, - 1,114,18,116,1,106,2,124,3,25,0,125,4,124,0,160, - 0,100,1,161,1,100,5,25,0,125,8,122,16,116,11,124, - 4,124,8,124,7,131,3,1,0,87,0,110,48,4,0,116, - 5,144,1,121,16,1,0,1,0,1,0,100,6,124,3,155, - 2,100,7,124,8,155,2,157,4,125,5,116,12,160,13,124, - 5,116,14,161,2,1,0,89,0,110,2,48,0,124,7,83, - 0,41,8,78,114,129,0,0,0,114,22,0,0,0,122,23, - 59,32,123,33,114,125,32,105,115,32,110,111,116,32,97,32, - 112,97,99,107,97,103,101,114,16,0,0,0,233,2,0,0, - 0,122,27,67,97,110,110,111,116,32,115,101,116,32,97,110, - 32,97,116,116,114,105,98,117,116,101,32,111,110,32,122,18, - 32,102,111,114,32,99,104,105,108,100,32,109,111,100,117,108, - 101,32,41,15,114,130,0,0,0,114,15,0,0,0,114,93, - 0,0,0,114,68,0,0,0,114,142,0,0,0,114,107,0, - 0,0,218,8,95,69,82,82,95,77,83,71,114,46,0,0, - 0,218,19,77,111,100,117,108,101,78,111,116,70,111,117,110, - 100,69,114,114,111,114,114,196,0,0,0,114,160,0,0,0, - 114,5,0,0,0,114,193,0,0,0,114,194,0,0,0,114, - 195,0,0,0,41,9,114,17,0,0,0,218,7,105,109,112, - 111,114,116,95,114,166,0,0,0,114,131,0,0,0,90,13, - 112,97,114,101,110,116,95,109,111,100,117,108,101,114,158,0, - 0,0,114,96,0,0,0,114,97,0,0,0,90,5,99,104, - 105,108,100,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,23,95,102,105,110,100,95,97,110,100,95,108,111, - 97,100,95,117,110,108,111,99,107,101,100,199,3,0,0,115, - 52,0,0,0,0,1,4,1,14,1,4,1,10,1,10,2, - 10,1,10,1,10,1,2,1,10,1,12,1,16,1,20,1, - 10,1,8,1,20,2,8,1,6,2,10,1,14,1,2,1, - 16,1,14,1,16,1,18,1,114,207,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,4,0,0,0,8,0, - 0,0,67,0,0,0,115,128,0,0,0,116,0,124,0,131, - 1,143,62,1,0,116,1,106,2,160,3,124,0,116,4,161, - 2,125,2,124,2,116,4,117,0,114,56,116,5,124,0,124, - 1,131,2,87,0,2,0,100,1,4,0,4,0,131,3,1, - 0,83,0,87,0,100,1,4,0,4,0,131,3,1,0,110, - 16,49,0,115,76,48,0,1,0,1,0,1,0,89,0,1, - 0,124,2,100,1,117,0,114,116,100,2,160,6,124,0,161, - 1,125,3,116,7,124,3,124,0,100,3,141,2,130,1,116, - 8,124,0,131,1,1,0,124,2,83,0,41,4,122,25,70, - 105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,101, - 32,109,111,100,117,108,101,46,78,122,40,105,109,112,111,114, - 116,32,111,102,32,123,125,32,104,97,108,116,101,100,59,32, - 78,111,110,101,32,105,110,32,115,121,115,46,109,111,100,117, - 108,101,115,114,16,0,0,0,41,9,114,51,0,0,0,114, - 15,0,0,0,114,93,0,0,0,114,35,0,0,0,218,14, - 95,78,69,69,68,83,95,76,79,65,68,73,78,71,114,207, - 0,0,0,114,46,0,0,0,114,205,0,0,0,114,66,0, - 0,0,41,4,114,17,0,0,0,114,206,0,0,0,114,97, - 0,0,0,114,76,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,14,95,102,105,110,100,95,97, - 110,100,95,108,111,97,100,234,3,0,0,115,22,0,0,0, - 0,2,10,1,14,1,8,1,54,2,8,1,4,1,2,255, - 4,2,12,2,8,1,114,209,0,0,0,114,22,0,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,4,0,0,0,67,0,0,0,115,42,0,0,0,116,0, - 124,0,124,1,124,2,131,3,1,0,124,2,100,1,107,4, - 114,32,116,1,124,0,124,1,124,2,131,3,125,0,116,2, - 124,0,116,3,131,2,83,0,41,2,97,50,1,0,0,73, - 109,112,111,114,116,32,97,110,100,32,114,101,116,117,114,110, - 32,116,104,101,32,109,111,100,117,108,101,32,98,97,115,101, - 100,32,111,110,32,105,116,115,32,110,97,109,101,44,32,116, - 104,101,32,112,97,99,107,97,103,101,32,116,104,101,32,99, - 97,108,108,32,105,115,10,32,32,32,32,98,101,105,110,103, - 32,109,97,100,101,32,102,114,111,109,44,32,97,110,100,32, - 116,104,101,32,108,101,118,101,108,32,97,100,106,117,115,116, - 109,101,110,116,46,10,10,32,32,32,32,84,104,105,115,32, - 102,117,110,99,116,105,111,110,32,114,101,112,114,101,115,101, - 110,116,115,32,116,104,101,32,103,114,101,97,116,101,115,116, - 32,99,111,109,109,111,110,32,100,101,110,111,109,105,110,97, - 116,111,114,32,111,102,32,102,117,110,99,116,105,111,110,97, - 108,105,116,121,10,32,32,32,32,98,101,116,119,101,101,110, - 32,105,109,112,111,114,116,95,109,111,100,117,108,101,32,97, - 110,100,32,95,95,105,109,112,111,114,116,95,95,46,32,84, - 104,105,115,32,105,110,99,108,117,100,101,115,32,115,101,116, - 116,105,110,103,32,95,95,112,97,99,107,97,103,101,95,95, - 32,105,102,10,32,32,32,32,116,104,101,32,108,111,97,100, - 101,114,32,100,105,100,32,110,111,116,46,10,10,32,32,32, - 32,114,22,0,0,0,41,4,114,202,0,0,0,114,189,0, - 0,0,114,209,0,0,0,218,11,95,103,99,100,95,105,109, - 112,111,114,116,114,201,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,210,0,0,0,250,3,0, - 0,115,8,0,0,0,0,9,12,1,8,1,12,1,114,210, - 0,0,0,169,1,218,9,114,101,99,117,114,115,105,118,101, - 99,3,0,0,0,0,0,0,0,1,0,0,0,8,0,0, - 0,11,0,0,0,67,0,0,0,115,232,0,0,0,124,1, - 68,0,93,222,125,4,116,0,124,4,116,1,131,2,115,66, - 124,3,114,34,124,0,106,2,100,1,23,0,125,5,110,4, - 100,2,125,5,116,3,100,3,124,5,155,0,100,4,116,4, - 124,4,131,1,106,2,155,0,157,4,131,1,130,1,113,4, - 124,4,100,5,107,2,114,108,124,3,115,226,116,5,124,0, - 100,6,131,2,114,226,116,6,124,0,124,0,106,7,124,2, - 100,7,100,8,141,4,1,0,113,4,116,5,124,0,124,4, - 131,2,115,4,100,9,160,8,124,0,106,2,124,4,161,2, - 125,6,122,14,116,9,124,2,124,6,131,2,1,0,87,0, - 113,4,4,0,116,10,121,224,1,0,125,7,1,0,122,54, - 124,7,106,11,124,6,107,2,114,202,116,12,106,13,160,14, - 124,6,116,15,161,2,100,10,117,1,114,202,87,0,89,0, - 100,10,125,7,126,7,113,4,130,0,87,0,89,0,100,10, - 125,7,126,7,113,4,100,10,125,7,126,7,48,0,48,0, - 113,4,124,0,83,0,41,11,122,238,70,105,103,117,114,101, - 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111, - 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117, - 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112, - 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105, - 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105, - 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109, - 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32, - 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115, - 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99, - 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105, - 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103, - 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32, - 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101, - 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108, - 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, - 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, - 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, - 1,42,218,7,95,95,97,108,108,95,95,84,114,211,0,0, - 0,114,184,0,0,0,78,41,16,114,197,0,0,0,114,198, - 0,0,0,114,1,0,0,0,114,199,0,0,0,114,14,0, - 0,0,114,4,0,0,0,218,16,95,104,97,110,100,108,101, - 95,102,114,111,109,108,105,115,116,114,214,0,0,0,114,46, - 0,0,0,114,68,0,0,0,114,205,0,0,0,114,17,0, - 0,0,114,15,0,0,0,114,93,0,0,0,114,35,0,0, - 0,114,208,0,0,0,41,8,114,97,0,0,0,218,8,102, - 114,111,109,108,105,115,116,114,206,0,0,0,114,212,0,0, - 0,218,1,120,90,5,119,104,101,114,101,90,9,102,114,111, - 109,95,110,97,109,101,90,3,101,120,99,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,215,0,0,0,9, - 4,0,0,115,48,0,0,0,0,10,8,1,10,1,4,1, - 12,2,4,1,10,1,8,255,10,2,8,1,14,1,10,1, - 2,255,8,2,10,1,14,1,2,1,14,1,14,4,10,1, - 16,255,2,2,12,1,26,1,114,215,0,0,0,99,1,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,6,0, - 0,0,67,0,0,0,115,146,0,0,0,124,0,160,0,100, - 1,161,1,125,1,124,0,160,0,100,2,161,1,125,2,124, - 1,100,3,117,1,114,82,124,2,100,3,117,1,114,78,124, - 1,124,2,106,1,107,3,114,78,116,2,106,3,100,4,124, - 1,155,2,100,5,124,2,106,1,155,2,100,6,157,5,116, - 4,100,7,100,8,141,3,1,0,124,1,83,0,124,2,100, - 3,117,1,114,96,124,2,106,1,83,0,116,2,106,3,100, - 9,116,4,100,7,100,8,141,3,1,0,124,0,100,10,25, - 0,125,1,100,11,124,0,118,1,114,142,124,1,160,5,100, - 12,161,1,100,13,25,0,125,1,124,1,83,0,41,14,122, - 167,67,97,108,99,117,108,97,116,101,32,119,104,97,116,32, - 95,95,112,97,99,107,97,103,101,95,95,32,115,104,111,117, - 108,100,32,98,101,46,10,10,32,32,32,32,95,95,112,97, - 99,107,97,103,101,95,95,32,105,115,32,110,111,116,32,103, - 117,97,114,97,110,116,101,101,100,32,116,111,32,98,101,32, - 100,101,102,105,110,101,100,32,111,114,32,99,111,117,108,100, - 32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,10, - 32,32,32,32,116,111,32,114,101,112,114,101,115,101,110,116, - 32,116,104,97,116,32,105,116,115,32,112,114,111,112,101,114, - 32,118,97,108,117,101,32,105,115,32,117,110,107,110,111,119, - 110,46,10,10,32,32,32,32,114,146,0,0,0,114,106,0, - 0,0,78,122,32,95,95,112,97,99,107,97,103,101,95,95, - 32,33,61,32,95,95,115,112,101,99,95,95,46,112,97,114, - 101,110,116,32,40,122,4,32,33,61,32,250,1,41,233,3, - 0,0,0,41,1,90,10,115,116,97,99,107,108,101,118,101, - 108,122,89,99,97,110,39,116,32,114,101,115,111,108,118,101, - 32,112,97,99,107,97,103,101,32,102,114,111,109,32,95,95, - 115,112,101,99,95,95,32,111,114,32,95,95,112,97,99,107, - 97,103,101,95,95,44,32,102,97,108,108,105,110,103,32,98, - 97,99,107,32,111,110,32,95,95,110,97,109,101,95,95,32, - 97,110,100,32,95,95,112,97,116,104,95,95,114,1,0,0, - 0,114,142,0,0,0,114,129,0,0,0,114,22,0,0,0, - 41,6,114,35,0,0,0,114,131,0,0,0,114,193,0,0, - 0,114,194,0,0,0,114,195,0,0,0,114,130,0,0,0, - 41,3,218,7,103,108,111,98,97,108,115,114,187,0,0,0, - 114,96,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,17,95,99,97,108,99,95,95,95,112,97, - 99,107,97,103,101,95,95,46,4,0,0,115,42,0,0,0, - 0,7,10,1,10,1,8,1,18,1,6,1,2,255,4,1, - 4,255,6,2,4,254,6,3,4,1,8,1,6,2,6,2, - 4,254,6,3,8,1,8,1,14,1,114,221,0,0,0,114, - 10,0,0,0,99,5,0,0,0,0,0,0,0,0,0,0, - 0,9,0,0,0,5,0,0,0,67,0,0,0,115,180,0, - 0,0,124,4,100,1,107,2,114,18,116,0,124,0,131,1, - 125,5,110,36,124,1,100,2,117,1,114,30,124,1,110,2, - 105,0,125,6,116,1,124,6,131,1,125,7,116,0,124,0, - 124,7,124,4,131,3,125,5,124,3,115,150,124,4,100,1, - 107,2,114,84,116,0,124,0,160,2,100,3,161,1,100,1, - 25,0,131,1,83,0,124,0,115,92,124,5,83,0,116,3, - 124,0,131,1,116,3,124,0,160,2,100,3,161,1,100,1, - 25,0,131,1,24,0,125,8,116,4,106,5,124,5,106,6, - 100,2,116,3,124,5,106,6,131,1,124,8,24,0,133,2, - 25,0,25,0,83,0,110,26,116,7,124,5,100,4,131,2, - 114,172,116,8,124,5,124,3,116,0,131,3,83,0,124,5, - 83,0,100,2,83,0,41,5,97,215,1,0,0,73,109,112, - 111,114,116,32,97,32,109,111,100,117,108,101,46,10,10,32, - 32,32,32,84,104,101,32,39,103,108,111,98,97,108,115,39, - 32,97,114,103,117,109,101,110,116,32,105,115,32,117,115,101, - 100,32,116,111,32,105,110,102,101,114,32,119,104,101,114,101, - 32,116,104,101,32,105,109,112,111,114,116,32,105,115,32,111, - 99,99,117,114,114,105,110,103,32,102,114,111,109,10,32,32, - 32,32,116,111,32,104,97,110,100,108,101,32,114,101,108,97, - 116,105,118,101,32,105,109,112,111,114,116,115,46,32,84,104, - 101,32,39,108,111,99,97,108,115,39,32,97,114,103,117,109, - 101,110,116,32,105,115,32,105,103,110,111,114,101,100,46,32, - 84,104,101,10,32,32,32,32,39,102,114,111,109,108,105,115, - 116,39,32,97,114,103,117,109,101,110,116,32,115,112,101,99, - 105,102,105,101,115,32,119,104,97,116,32,115,104,111,117,108, - 100,32,101,120,105,115,116,32,97,115,32,97,116,116,114,105, - 98,117,116,101,115,32,111,110,32,116,104,101,32,109,111,100, - 117,108,101,10,32,32,32,32,98,101,105,110,103,32,105,109, - 112,111,114,116,101,100,32,40,101,46,103,46,32,96,96,102, - 114,111,109,32,109,111,100,117,108,101,32,105,109,112,111,114, - 116,32,60,102,114,111,109,108,105,115,116,62,96,96,41,46, - 32,32,84,104,101,32,39,108,101,118,101,108,39,10,32,32, - 32,32,97,114,103,117,109,101,110,116,32,114,101,112,114,101, - 115,101,110,116,115,32,116,104,101,32,112,97,99,107,97,103, - 101,32,108,111,99,97,116,105,111,110,32,116,111,32,105,109, - 112,111,114,116,32,102,114,111,109,32,105,110,32,97,32,114, - 101,108,97,116,105,118,101,10,32,32,32,32,105,109,112,111, - 114,116,32,40,101,46,103,46,32,96,96,102,114,111,109,32, - 46,46,112,107,103,32,105,109,112,111,114,116,32,109,111,100, - 96,96,32,119,111,117,108,100,32,104,97,118,101,32,97,32, - 39,108,101,118,101,108,39,32,111,102,32,50,41,46,10,10, - 32,32,32,32,114,22,0,0,0,78,114,129,0,0,0,114, - 142,0,0,0,41,9,114,210,0,0,0,114,221,0,0,0, - 218,9,112,97,114,116,105,116,105,111,110,114,186,0,0,0, - 114,15,0,0,0,114,93,0,0,0,114,1,0,0,0,114, - 4,0,0,0,114,215,0,0,0,41,9,114,17,0,0,0, - 114,220,0,0,0,218,6,108,111,99,97,108,115,114,216,0, - 0,0,114,188,0,0,0,114,97,0,0,0,90,8,103,108, - 111,98,97,108,115,95,114,187,0,0,0,90,7,99,117,116, - 95,111,102,102,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,10,95,95,105,109,112,111,114,116,95,95,73, - 4,0,0,115,30,0,0,0,0,11,8,1,10,2,16,1, - 8,1,12,1,4,3,8,1,18,1,4,1,4,4,26,3, - 32,1,10,1,12,2,114,224,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,160,1,124,0,161, - 1,125,1,124,1,100,0,117,0,114,30,116,2,100,1,124, - 0,23,0,131,1,130,1,116,3,124,1,131,1,83,0,41, - 2,78,122,25,110,111,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,32,110,97,109,101,100,32,41,4,114, - 161,0,0,0,114,168,0,0,0,114,80,0,0,0,114,160, - 0,0,0,41,2,114,17,0,0,0,114,96,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,18, - 95,98,117,105,108,116,105,110,95,102,114,111,109,95,110,97, - 109,101,110,4,0,0,115,8,0,0,0,0,1,10,1,8, - 1,12,1,114,225,0,0,0,99,2,0,0,0,0,0,0, - 0,0,0,0,0,10,0,0,0,5,0,0,0,67,0,0, - 0,115,166,0,0,0,124,1,97,0,124,0,97,1,116,2, - 116,1,131,1,125,2,116,1,106,3,160,4,161,0,68,0, - 93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2, - 114,26,124,3,116,1,106,6,118,0,114,60,116,7,125,5, - 110,18,116,0,160,8,124,3,161,1,114,26,116,9,125,5, - 110,2,113,26,116,10,124,4,124,5,131,2,125,6,116,11, - 124,6,124,4,131,2,1,0,113,26,116,1,106,3,116,12, - 25,0,125,7,100,1,68,0,93,46,125,8,124,8,116,1, - 106,3,118,1,114,138,116,13,124,8,131,1,125,9,110,10, - 116,1,106,3,124,8,25,0,125,9,116,14,124,7,124,8, - 124,9,131,3,1,0,113,114,100,2,83,0,41,3,122,250, - 83,101,116,117,112,32,105,109,112,111,114,116,108,105,98,32, - 98,121,32,105,109,112,111,114,116,105,110,103,32,110,101,101, - 100,101,100,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, - 110,103,32,116,104,101,109,10,32,32,32,32,105,110,116,111, - 32,116,104,101,32,103,108,111,98,97,108,32,110,97,109,101, - 115,112,97,99,101,46,10,10,32,32,32,32,65,115,32,115, - 121,115,32,105,115,32,110,101,101,100,101,100,32,102,111,114, - 32,115,121,115,46,109,111,100,117,108,101,115,32,97,99,99, - 101,115,115,32,97,110,100,32,95,105,109,112,32,105,115,32, - 110,101,101,100,101,100,32,116,111,32,108,111,97,100,32,98, - 117,105,108,116,45,105,110,10,32,32,32,32,109,111,100,117, - 108,101,115,44,32,116,104,111,115,101,32,116,119,111,32,109, - 111,100,117,108,101,115,32,109,117,115,116,32,98,101,32,101, - 120,112,108,105,99,105,116,108,121,32,112,97,115,115,101,100, - 32,105,110,46,10,10,32,32,32,32,41,3,114,23,0,0, - 0,114,193,0,0,0,114,65,0,0,0,78,41,15,114,58, - 0,0,0,114,15,0,0,0,114,14,0,0,0,114,93,0, - 0,0,218,5,105,116,101,109,115,114,197,0,0,0,114,79, - 0,0,0,114,161,0,0,0,114,89,0,0,0,114,175,0, - 0,0,114,143,0,0,0,114,149,0,0,0,114,1,0,0, - 0,114,225,0,0,0,114,5,0,0,0,41,10,218,10,115, - 121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,95, - 109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,116, - 121,112,101,114,17,0,0,0,114,97,0,0,0,114,110,0, - 0,0,114,96,0,0,0,90,11,115,101,108,102,95,109,111, - 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, - 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, - 108,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,6,95,115,101,116,117,112,117,4,0,0,115,36,0, - 0,0,0,9,4,1,4,3,8,1,18,1,10,1,10,1, - 6,1,10,1,6,2,2,1,10,1,12,3,10,1,8,1, - 10,1,10,2,10,1,114,229,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131, - 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116, - 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41, - 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114, - 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110, - 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,115,78,41,6,114,229,0,0,0,114,15,0,0,0, - 114,192,0,0,0,114,120,0,0,0,114,161,0,0,0,114, - 175,0,0,0,41,2,114,227,0,0,0,114,228,0,0,0, + 0,0,218,2,99,98,185,0,0,0,115,10,0,0,0,0, + 1,8,1,2,4,14,1,8,2,122,28,95,103,101,116,95, + 109,111,100,117,108,101,95,108,111,99,107,46,60,108,111,99, + 97,108,115,62,46,99,98,41,10,114,58,0,0,0,114,59, + 0,0,0,114,60,0,0,0,218,8,75,101,121,69,114,114, + 111,114,114,23,0,0,0,114,50,0,0,0,114,20,0,0, + 0,218,8,95,119,101,97,107,114,101,102,114,62,0,0,0, + 114,61,0,0,0,41,3,114,17,0,0,0,114,24,0,0, + 0,114,63,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,54,0,0,0,166,0,0,0,115,28, + 0,0,0,0,6,8,1,2,1,2,1,14,1,12,1,10, + 2,8,1,8,1,10,2,8,2,12,11,18,2,20,2,114, + 54,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,8,0,0,0,67,0,0,0,115,52,0, + 0,0,116,0,124,0,131,1,125,1,122,12,124,1,160,1, + 161,0,1,0,87,0,110,18,4,0,116,2,121,38,1,0, + 1,0,1,0,89,0,110,10,48,0,124,1,160,3,161,0, + 1,0,100,1,83,0,41,2,122,189,65,99,113,117,105,114, + 101,115,32,116,104,101,110,32,114,101,108,101,97,115,101,115, + 32,116,104,101,32,109,111,100,117,108,101,32,108,111,99,107, + 32,102,111,114,32,97,32,103,105,118,101,110,32,109,111,100, + 117,108,101,32,110,97,109,101,46,10,10,32,32,32,32,84, + 104,105,115,32,105,115,32,117,115,101,100,32,116,111,32,101, + 110,115,117,114,101,32,97,32,109,111,100,117,108,101,32,105, + 115,32,99,111,109,112,108,101,116,101,108,121,32,105,110,105, + 116,105,97,108,105,122,101,100,44,32,105,110,32,116,104,101, + 10,32,32,32,32,101,118,101,110,116,32,105,116,32,105,115, + 32,98,101,105,110,103,32,105,109,112,111,114,116,101,100,32, + 98,121,32,97,110,111,116,104,101,114,32,116,104,114,101,97, + 100,46,10,32,32,32,32,78,41,4,114,54,0,0,0,114, + 40,0,0,0,114,19,0,0,0,114,41,0,0,0,41,2, + 114,17,0,0,0,114,24,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,19,95,108,111,99,107, + 95,117,110,108,111,99,107,95,109,111,100,117,108,101,203,0, + 0,0,115,12,0,0,0,0,6,8,1,2,1,12,1,12, + 3,6,2,114,66,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,4,0,0,0,79,0,0, + 0,115,14,0,0,0,124,0,124,1,105,0,124,2,164,1, + 142,1,83,0,41,1,97,46,1,0,0,114,101,109,111,118, + 101,95,105,109,112,111,114,116,108,105,98,95,102,114,97,109, + 101,115,32,105,110,32,105,109,112,111,114,116,46,99,32,119, + 105,108,108,32,97,108,119,97,121,115,32,114,101,109,111,118, + 101,32,115,101,113,117,101,110,99,101,115,10,32,32,32,32, + 111,102,32,105,109,112,111,114,116,108,105,98,32,102,114,97, + 109,101,115,32,116,104,97,116,32,101,110,100,32,119,105,116, + 104,32,97,32,99,97,108,108,32,116,111,32,116,104,105,115, + 32,102,117,110,99,116,105,111,110,10,10,32,32,32,32,85, + 115,101,32,105,116,32,105,110,115,116,101,97,100,32,111,102, + 32,97,32,110,111,114,109,97,108,32,99,97,108,108,32,105, + 110,32,112,108,97,99,101,115,32,119,104,101,114,101,32,105, + 110,99,108,117,100,105,110,103,32,116,104,101,32,105,109,112, + 111,114,116,108,105,98,10,32,32,32,32,102,114,97,109,101, + 115,32,105,110,116,114,111,100,117,99,101,115,32,117,110,119, + 97,110,116,101,100,32,110,111,105,115,101,32,105,110,116,111, + 32,116,104,101,32,116,114,97,99,101,98,97,99,107,32,40, + 101,46,103,46,32,119,104,101,110,32,101,120,101,99,117,116, + 105,110,103,10,32,32,32,32,109,111,100,117,108,101,32,99, + 111,100,101,41,10,32,32,32,32,114,10,0,0,0,41,3, + 218,1,102,114,56,0,0,0,90,4,107,119,100,115,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,25,95, + 99,97,108,108,95,119,105,116,104,95,102,114,97,109,101,115, + 95,114,101,109,111,118,101,100,220,0,0,0,115,2,0,0, + 0,0,8,114,68,0,0,0,114,39,0,0,0,41,1,218, + 9,118,101,114,98,111,115,105,116,121,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,4,0,0,0,71, + 0,0,0,115,54,0,0,0,116,0,106,1,106,2,124,1, + 107,5,114,50,124,0,160,3,100,1,161,1,115,30,100,2, + 124,0,23,0,125,0,116,4,124,0,106,5,124,2,142,0, + 116,0,106,6,100,3,141,2,1,0,100,4,83,0,41,5, + 122,61,80,114,105,110,116,32,116,104,101,32,109,101,115,115, + 97,103,101,32,116,111,32,115,116,100,101,114,114,32,105,102, + 32,45,118,47,80,89,84,72,79,78,86,69,82,66,79,83, + 69,32,105,115,32,116,117,114,110,101,100,32,111,110,46,41, + 2,250,1,35,122,7,105,109,112,111,114,116,32,122,2,35, + 32,41,1,90,4,102,105,108,101,78,41,7,114,15,0,0, + 0,218,5,102,108,97,103,115,218,7,118,101,114,98,111,115, + 101,218,10,115,116,97,114,116,115,119,105,116,104,218,5,112, + 114,105,110,116,114,46,0,0,0,218,6,115,116,100,101,114, + 114,41,3,218,7,109,101,115,115,97,103,101,114,69,0,0, + 0,114,56,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,16,95,118,101,114,98,111,115,101,95, + 109,101,115,115,97,103,101,231,0,0,0,115,8,0,0,0, + 0,2,12,1,10,1,8,1,114,77,0,0,0,99,1,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,3,0,0,0,115,26,0,0,0,135,0,102,1,100, + 1,100,2,132,8,125,1,116,0,124,1,136,0,131,2,1, + 0,124,1,83,0,41,3,122,49,68,101,99,111,114,97,116, + 111,114,32,116,111,32,118,101,114,105,102,121,32,116,104,101, + 32,110,97,109,101,100,32,109,111,100,117,108,101,32,105,115, + 32,98,117,105,108,116,45,105,110,46,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,19, + 0,0,0,115,38,0,0,0,124,1,116,0,106,1,118,1, + 114,28,116,2,100,1,160,3,124,1,161,1,124,1,100,2, + 141,2,130,1,136,0,124,0,124,1,131,2,83,0,41,3, + 78,250,29,123,33,114,125,32,105,115,32,110,111,116,32,97, + 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, + 114,16,0,0,0,41,4,114,15,0,0,0,218,20,98,117, + 105,108,116,105,110,95,109,111,100,117,108,101,95,110,97,109, + 101,115,218,11,73,109,112,111,114,116,69,114,114,111,114,114, + 46,0,0,0,169,2,114,30,0,0,0,218,8,102,117,108, + 108,110,97,109,101,169,1,218,3,102,120,110,114,10,0,0, + 0,114,11,0,0,0,218,25,95,114,101,113,117,105,114,101, + 115,95,98,117,105,108,116,105,110,95,119,114,97,112,112,101, + 114,241,0,0,0,115,10,0,0,0,0,1,10,1,10,1, + 2,255,6,2,122,52,95,114,101,113,117,105,114,101,115,95, + 98,117,105,108,116,105,110,46,60,108,111,99,97,108,115,62, + 46,95,114,101,113,117,105,114,101,115,95,98,117,105,108,116, + 105,110,95,119,114,97,112,112,101,114,169,1,114,12,0,0, + 0,41,2,114,84,0,0,0,114,85,0,0,0,114,10,0, + 0,0,114,83,0,0,0,114,11,0,0,0,218,17,95,114, + 101,113,117,105,114,101,115,95,98,117,105,108,116,105,110,239, + 0,0,0,115,6,0,0,0,0,2,12,5,10,1,114,87, + 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,3,0,0,0,115,26,0,0, + 0,135,0,102,1,100,1,100,2,132,8,125,1,116,0,124, + 1,136,0,131,2,1,0,124,1,83,0,41,3,122,47,68, + 101,99,111,114,97,116,111,114,32,116,111,32,118,101,114,105, + 102,121,32,116,104,101,32,110,97,109,101,100,32,109,111,100, + 117,108,101,32,105,115,32,102,114,111,122,101,110,46,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,19,0,0,0,115,38,0,0,0,116,0,160,1, + 124,1,161,1,115,28,116,2,100,1,160,3,124,1,161,1, + 124,1,100,2,141,2,130,1,136,0,124,0,124,1,131,2, + 83,0,169,3,78,122,27,123,33,114,125,32,105,115,32,110, + 111,116,32,97,32,102,114,111,122,101,110,32,109,111,100,117, + 108,101,114,16,0,0,0,41,4,114,58,0,0,0,218,9, + 105,115,95,102,114,111,122,101,110,114,80,0,0,0,114,46, + 0,0,0,114,81,0,0,0,114,83,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,24,95,114,101,113,117,105,114, + 101,115,95,102,114,111,122,101,110,95,119,114,97,112,112,101, + 114,252,0,0,0,115,10,0,0,0,0,1,10,1,10,1, + 2,255,6,2,122,50,95,114,101,113,117,105,114,101,115,95, + 102,114,111,122,101,110,46,60,108,111,99,97,108,115,62,46, + 95,114,101,113,117,105,114,101,115,95,102,114,111,122,101,110, + 95,119,114,97,112,112,101,114,114,86,0,0,0,41,2,114, + 84,0,0,0,114,90,0,0,0,114,10,0,0,0,114,83, + 0,0,0,114,11,0,0,0,218,16,95,114,101,113,117,105, + 114,101,115,95,102,114,111,122,101,110,250,0,0,0,115,6, + 0,0,0,0,2,12,5,10,1,114,91,0,0,0,99,2, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,3, + 0,0,0,67,0,0,0,115,62,0,0,0,116,0,124,1, + 124,0,131,2,125,2,124,1,116,1,106,2,118,0,114,50, + 116,1,106,2,124,1,25,0,125,3,116,3,124,2,124,3, + 131,2,1,0,116,1,106,2,124,1,25,0,83,0,116,4, + 124,2,131,1,83,0,100,1,83,0,41,2,122,128,76,111, + 97,100,32,116,104,101,32,115,112,101,99,105,102,105,101,100, + 32,109,111,100,117,108,101,32,105,110,116,111,32,115,121,115, + 46,109,111,100,117,108,101,115,32,97,110,100,32,114,101,116, + 117,114,110,32,105,116,46,10,10,32,32,32,32,84,104,105, + 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, + 101,99,97,116,101,100,46,32,32,85,115,101,32,108,111,97, + 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,32, + 105,110,115,116,101,97,100,46,10,10,32,32,32,32,78,41, + 5,218,16,115,112,101,99,95,102,114,111,109,95,108,111,97, + 100,101,114,114,15,0,0,0,218,7,109,111,100,117,108,101, + 115,218,5,95,101,120,101,99,218,5,95,108,111,97,100,41, + 4,114,30,0,0,0,114,82,0,0,0,218,4,115,112,101, + 99,218,6,109,111,100,117,108,101,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,17,95,108,111,97,100,95, + 109,111,100,117,108,101,95,115,104,105,109,6,1,0,0,115, + 12,0,0,0,0,6,10,1,10,1,10,1,10,1,10,2, + 114,98,0,0,0,99,1,0,0,0,0,0,0,0,0,0, + 0,0,5,0,0,0,8,0,0,0,67,0,0,0,115,218, + 0,0,0,116,0,124,0,100,1,100,0,131,3,125,1,116, + 1,124,1,100,2,131,2,114,54,122,12,124,1,160,2,124, + 0,161,1,87,0,83,0,4,0,116,3,121,52,1,0,1, + 0,1,0,89,0,110,2,48,0,122,10,124,0,106,4,125, + 2,87,0,110,18,4,0,116,5,121,82,1,0,1,0,1, + 0,89,0,110,18,48,0,124,2,100,0,117,1,114,100,116, + 6,124,2,131,1,83,0,122,10,124,0,106,7,125,3,87, + 0,110,22,4,0,116,5,121,132,1,0,1,0,1,0,100, + 3,125,3,89,0,110,2,48,0,122,10,124,0,106,8,125, + 4,87,0,110,56,4,0,116,5,121,200,1,0,1,0,1, + 0,124,1,100,0,117,0,114,180,100,4,160,9,124,3,161, + 1,6,0,89,0,83,0,100,5,160,9,124,3,124,1,161, + 2,6,0,89,0,83,0,89,0,110,14,48,0,100,6,160, + 9,124,3,124,4,161,2,83,0,100,0,83,0,41,7,78, + 218,10,95,95,108,111,97,100,101,114,95,95,218,11,109,111, + 100,117,108,101,95,114,101,112,114,250,1,63,250,13,60,109, + 111,100,117,108,101,32,123,33,114,125,62,250,20,60,109,111, + 100,117,108,101,32,123,33,114,125,32,40,123,33,114,125,41, + 62,250,23,60,109,111,100,117,108,101,32,123,33,114,125,32, + 102,114,111,109,32,123,33,114,125,62,41,10,114,6,0,0, + 0,114,4,0,0,0,114,100,0,0,0,218,9,69,120,99, + 101,112,116,105,111,110,218,8,95,95,115,112,101,99,95,95, + 218,14,65,116,116,114,105,98,117,116,101,69,114,114,111,114, + 218,22,95,109,111,100,117,108,101,95,114,101,112,114,95,102, + 114,111,109,95,115,112,101,99,114,1,0,0,0,218,8,95, + 95,102,105,108,101,95,95,114,46,0,0,0,41,5,114,97, + 0,0,0,218,6,108,111,97,100,101,114,114,96,0,0,0, + 114,17,0,0,0,218,8,102,105,108,101,110,97,109,101,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,12, + 95,109,111,100,117,108,101,95,114,101,112,114,22,1,0,0, + 115,46,0,0,0,0,2,12,1,10,4,2,1,12,1,12, + 1,6,1,2,1,10,1,12,1,6,2,8,1,8,4,2, + 1,10,1,12,1,10,1,2,1,10,1,12,1,8,1,14, + 2,22,2,114,112,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, + 0,115,114,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,2,100,2,100,3,156,3,100,4,100,5, + 132,2,90,4,100,6,100,7,132,0,90,5,100,8,100,9, + 132,0,90,6,101,7,100,10,100,11,132,0,131,1,90,8, + 101,8,106,9,100,12,100,11,132,0,131,1,90,8,101,7, + 100,13,100,14,132,0,131,1,90,10,101,7,100,15,100,16, + 132,0,131,1,90,11,101,11,106,9,100,17,100,16,132,0, + 131,1,90,11,100,2,83,0,41,18,218,10,77,111,100,117, + 108,101,83,112,101,99,97,208,5,0,0,84,104,101,32,115, + 112,101,99,105,102,105,99,97,116,105,111,110,32,102,111,114, + 32,97,32,109,111,100,117,108,101,44,32,117,115,101,100,32, + 102,111,114,32,108,111,97,100,105,110,103,46,10,10,32,32, + 32,32,65,32,109,111,100,117,108,101,39,115,32,115,112,101, + 99,32,105,115,32,116,104,101,32,115,111,117,114,99,101,32, + 102,111,114,32,105,110,102,111,114,109,97,116,105,111,110,32, + 97,98,111,117,116,32,116,104,101,32,109,111,100,117,108,101, + 46,32,32,70,111,114,10,32,32,32,32,100,97,116,97,32, + 97,115,115,111,99,105,97,116,101,100,32,119,105,116,104,32, + 116,104,101,32,109,111,100,117,108,101,44,32,105,110,99,108, + 117,100,105,110,103,32,115,111,117,114,99,101,44,32,117,115, + 101,32,116,104,101,32,115,112,101,99,39,115,10,32,32,32, + 32,108,111,97,100,101,114,46,10,10,32,32,32,32,96,110, + 97,109,101,96,32,105,115,32,116,104,101,32,97,98,115,111, + 108,117,116,101,32,110,97,109,101,32,111,102,32,116,104,101, + 32,109,111,100,117,108,101,46,32,32,96,108,111,97,100,101, + 114,96,32,105,115,32,116,104,101,32,108,111,97,100,101,114, + 10,32,32,32,32,116,111,32,117,115,101,32,119,104,101,110, + 32,108,111,97,100,105,110,103,32,116,104,101,32,109,111,100, + 117,108,101,46,32,32,96,112,97,114,101,110,116,96,32,105, + 115,32,116,104,101,32,110,97,109,101,32,111,102,32,116,104, + 101,10,32,32,32,32,112,97,99,107,97,103,101,32,116,104, + 101,32,109,111,100,117,108,101,32,105,115,32,105,110,46,32, + 32,84,104,101,32,112,97,114,101,110,116,32,105,115,32,100, + 101,114,105,118,101,100,32,102,114,111,109,32,116,104,101,32, + 110,97,109,101,46,10,10,32,32,32,32,96,105,115,95,112, + 97,99,107,97,103,101,96,32,100,101,116,101,114,109,105,110, + 101,115,32,105,102,32,116,104,101,32,109,111,100,117,108,101, + 32,105,115,32,99,111,110,115,105,100,101,114,101,100,32,97, + 32,112,97,99,107,97,103,101,32,111,114,10,32,32,32,32, + 110,111,116,46,32,32,79,110,32,109,111,100,117,108,101,115, + 32,116,104,105,115,32,105,115,32,114,101,102,108,101,99,116, + 101,100,32,98,121,32,116,104,101,32,96,95,95,112,97,116, + 104,95,95,96,32,97,116,116,114,105,98,117,116,101,46,10, + 10,32,32,32,32,96,111,114,105,103,105,110,96,32,105,115, + 32,116,104,101,32,115,112,101,99,105,102,105,99,32,108,111, + 99,97,116,105,111,110,32,117,115,101,100,32,98,121,32,116, + 104,101,32,108,111,97,100,101,114,32,102,114,111,109,32,119, + 104,105,99,104,32,116,111,10,32,32,32,32,108,111,97,100, + 32,116,104,101,32,109,111,100,117,108,101,44,32,105,102,32, + 116,104,97,116,32,105,110,102,111,114,109,97,116,105,111,110, + 32,105,115,32,97,118,97,105,108,97,98,108,101,46,32,32, + 87,104,101,110,32,102,105,108,101,110,97,109,101,32,105,115, + 10,32,32,32,32,115,101,116,44,32,111,114,105,103,105,110, + 32,119,105,108,108,32,109,97,116,99,104,46,10,10,32,32, + 32,32,96,104,97,115,95,108,111,99,97,116,105,111,110,96, + 32,105,110,100,105,99,97,116,101,115,32,116,104,97,116,32, + 97,32,115,112,101,99,39,115,32,34,111,114,105,103,105,110, + 34,32,114,101,102,108,101,99,116,115,32,97,32,108,111,99, + 97,116,105,111,110,46,10,32,32,32,32,87,104,101,110,32, + 116,104,105,115,32,105,115,32,84,114,117,101,44,32,96,95, + 95,102,105,108,101,95,95,96,32,97,116,116,114,105,98,117, + 116,101,32,111,102,32,116,104,101,32,109,111,100,117,108,101, + 32,105,115,32,115,101,116,46,10,10,32,32,32,32,96,99, + 97,99,104,101,100,96,32,105,115,32,116,104,101,32,108,111, + 99,97,116,105,111,110,32,111,102,32,116,104,101,32,99,97, + 99,104,101,100,32,98,121,116,101,99,111,100,101,32,102,105, + 108,101,44,32,105,102,32,97,110,121,46,32,32,73,116,10, + 32,32,32,32,99,111,114,114,101,115,112,111,110,100,115,32, + 116,111,32,116,104,101,32,96,95,95,99,97,99,104,101,100, + 95,95,96,32,97,116,116,114,105,98,117,116,101,46,10,10, + 32,32,32,32,96,115,117,98,109,111,100,117,108,101,95,115, + 101,97,114,99,104,95,108,111,99,97,116,105,111,110,115,96, + 32,105,115,32,116,104,101,32,115,101,113,117,101,110,99,101, + 32,111,102,32,112,97,116,104,32,101,110,116,114,105,101,115, + 32,116,111,10,32,32,32,32,115,101,97,114,99,104,32,119, + 104,101,110,32,105,109,112,111,114,116,105,110,103,32,115,117, + 98,109,111,100,117,108,101,115,46,32,32,73,102,32,115,101, + 116,44,32,105,115,95,112,97,99,107,97,103,101,32,115,104, + 111,117,108,100,32,98,101,10,32,32,32,32,84,114,117,101, + 45,45,97,110,100,32,70,97,108,115,101,32,111,116,104,101, + 114,119,105,115,101,46,10,10,32,32,32,32,80,97,99,107, + 97,103,101,115,32,97,114,101,32,115,105,109,112,108,121,32, + 109,111,100,117,108,101,115,32,116,104,97,116,32,40,109,97, + 121,41,32,104,97,118,101,32,115,117,98,109,111,100,117,108, + 101,115,46,32,32,73,102,32,97,32,115,112,101,99,10,32, + 32,32,32,104,97,115,32,97,32,110,111,110,45,78,111,110, + 101,32,118,97,108,117,101,32,105,110,32,96,115,117,98,109, + 111,100,117,108,101,95,115,101,97,114,99,104,95,108,111,99, + 97,116,105,111,110,115,96,44,32,116,104,101,32,105,109,112, + 111,114,116,10,32,32,32,32,115,121,115,116,101,109,32,119, + 105,108,108,32,99,111,110,115,105,100,101,114,32,109,111,100, + 117,108,101,115,32,108,111,97,100,101,100,32,102,114,111,109, + 32,116,104,101,32,115,112,101,99,32,97,115,32,112,97,99, + 107,97,103,101,115,46,10,10,32,32,32,32,79,110,108,121, + 32,102,105,110,100,101,114,115,32,40,115,101,101,32,105,109, + 112,111,114,116,108,105,98,46,97,98,99,46,77,101,116,97, + 80,97,116,104,70,105,110,100,101,114,32,97,110,100,10,32, + 32,32,32,105,109,112,111,114,116,108,105,98,46,97,98,99, + 46,80,97,116,104,69,110,116,114,121,70,105,110,100,101,114, + 41,32,115,104,111,117,108,100,32,109,111,100,105,102,121,32, + 77,111,100,117,108,101,83,112,101,99,32,105,110,115,116,97, + 110,99,101,115,46,10,10,32,32,32,32,78,41,3,218,6, + 111,114,105,103,105,110,218,12,108,111,97,100,101,114,95,115, + 116,97,116,101,218,10,105,115,95,112,97,99,107,97,103,101, + 99,3,0,0,0,0,0,0,0,3,0,0,0,6,0,0, + 0,2,0,0,0,67,0,0,0,115,54,0,0,0,124,1, + 124,0,95,0,124,2,124,0,95,1,124,3,124,0,95,2, + 124,4,124,0,95,3,124,5,114,32,103,0,110,2,100,0, + 124,0,95,4,100,1,124,0,95,5,100,0,124,0,95,6, + 100,0,83,0,41,2,78,70,41,7,114,17,0,0,0,114, + 110,0,0,0,114,114,0,0,0,114,115,0,0,0,218,26, + 115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104, + 95,108,111,99,97,116,105,111,110,115,218,13,95,115,101,116, + 95,102,105,108,101,97,116,116,114,218,7,95,99,97,99,104, + 101,100,41,6,114,30,0,0,0,114,17,0,0,0,114,110, + 0,0,0,114,114,0,0,0,114,115,0,0,0,114,116,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,31,0,0,0,95,1,0,0,115,14,0,0,0,0, + 2,6,1,6,1,6,1,6,1,14,3,6,1,122,19,77, + 111,100,117,108,101,83,112,101,99,46,95,95,105,110,105,116, + 95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,6,0,0,0,67,0,0,0,115,102,0,0,0, + 100,1,160,0,124,0,106,1,161,1,100,2,160,0,124,0, + 106,2,161,1,103,2,125,1,124,0,106,3,100,0,117,1, + 114,52,124,1,160,4,100,3,160,0,124,0,106,3,161,1, + 161,1,1,0,124,0,106,5,100,0,117,1,114,80,124,1, + 160,4,100,4,160,0,124,0,106,5,161,1,161,1,1,0, + 100,5,160,0,124,0,106,6,106,7,100,6,160,8,124,1, + 161,1,161,2,83,0,41,7,78,122,9,110,97,109,101,61, + 123,33,114,125,122,11,108,111,97,100,101,114,61,123,33,114, + 125,122,11,111,114,105,103,105,110,61,123,33,114,125,122,29, + 115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104, + 95,108,111,99,97,116,105,111,110,115,61,123,125,122,6,123, + 125,40,123,125,41,122,2,44,32,41,9,114,46,0,0,0, + 114,17,0,0,0,114,110,0,0,0,114,114,0,0,0,218, + 6,97,112,112,101,110,100,114,117,0,0,0,218,9,95,95, + 99,108,97,115,115,95,95,114,1,0,0,0,218,4,106,111, + 105,110,41,2,114,30,0,0,0,114,56,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,49,0, + 0,0,107,1,0,0,115,20,0,0,0,0,1,10,1,10, + 255,4,2,10,1,18,1,10,1,8,1,4,255,6,2,122, + 19,77,111,100,117,108,101,83,112,101,99,46,95,95,114,101, + 112,114,95,95,99,2,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,8,0,0,0,67,0,0,0,115,106,0, + 0,0,124,0,106,0,125,2,122,72,124,0,106,1,124,1, + 106,1,107,2,111,76,124,0,106,2,124,1,106,2,107,2, + 111,76,124,0,106,3,124,1,106,3,107,2,111,76,124,2, + 124,1,106,0,107,2,111,76,124,0,106,4,124,1,106,4, + 107,2,111,76,124,0,106,5,124,1,106,5,107,2,87,0, + 83,0,4,0,116,6,121,100,1,0,1,0,1,0,116,7, + 6,0,89,0,83,0,48,0,100,0,83,0,114,13,0,0, + 0,41,8,114,117,0,0,0,114,17,0,0,0,114,110,0, + 0,0,114,114,0,0,0,218,6,99,97,99,104,101,100,218, + 12,104,97,115,95,108,111,99,97,116,105,111,110,114,107,0, + 0,0,218,14,78,111,116,73,109,112,108,101,109,101,110,116, + 101,100,41,3,114,30,0,0,0,90,5,111,116,104,101,114, + 90,4,115,109,115,108,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,6,95,95,101,113,95,95,117,1,0, + 0,115,30,0,0,0,0,1,6,1,2,1,12,1,10,255, + 2,2,10,254,2,3,8,253,2,4,10,252,2,5,10,251, + 4,6,12,1,122,17,77,111,100,117,108,101,83,112,101,99, + 46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,0, + 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, + 115,58,0,0,0,124,0,106,0,100,0,117,0,114,52,124, + 0,106,1,100,0,117,1,114,52,124,0,106,2,114,52,116, + 3,100,0,117,0,114,38,116,4,130,1,116,3,160,5,124, + 0,106,1,161,1,124,0,95,0,124,0,106,0,83,0,114, + 13,0,0,0,41,6,114,119,0,0,0,114,114,0,0,0, + 114,118,0,0,0,218,19,95,98,111,111,116,115,116,114,97, + 112,95,101,120,116,101,114,110,97,108,218,19,78,111,116,73, + 109,112,108,101,109,101,110,116,101,100,69,114,114,111,114,90, + 11,95,103,101,116,95,99,97,99,104,101,100,114,48,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,123,0,0,0,129,1,0,0,115,12,0,0,0,0,2, + 10,1,16,1,8,1,4,1,14,1,122,17,77,111,100,117, + 108,101,83,112,101,99,46,99,97,99,104,101,100,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, + 0,0,67,0,0,0,115,10,0,0,0,124,1,124,0,95, + 0,100,0,83,0,114,13,0,0,0,41,1,114,119,0,0, + 0,41,2,114,30,0,0,0,114,123,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,123,0,0, + 0,138,1,0,0,115,2,0,0,0,0,2,99,1,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,36,0,0,0,124,0,106,0,100,1, + 117,0,114,26,124,0,106,1,160,2,100,2,161,1,100,3, + 25,0,83,0,124,0,106,1,83,0,100,1,83,0,41,4, + 122,32,84,104,101,32,110,97,109,101,32,111,102,32,116,104, + 101,32,109,111,100,117,108,101,39,115,32,112,97,114,101,110, + 116,46,78,218,1,46,114,22,0,0,0,41,3,114,117,0, + 0,0,114,17,0,0,0,218,10,114,112,97,114,116,105,116, + 105,111,110,114,48,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,6,112,97,114,101,110,116,142, + 1,0,0,115,6,0,0,0,0,3,10,1,16,2,122,17, + 77,111,100,117,108,101,83,112,101,99,46,112,97,114,101,110, + 116,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, + 0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124, + 0,106,0,83,0,114,13,0,0,0,41,1,114,118,0,0, + 0,114,48,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,124,0,0,0,150,1,0,0,115,2, + 0,0,0,0,2,122,23,77,111,100,117,108,101,83,112,101, + 99,46,104,97,115,95,108,111,99,97,116,105,111,110,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2, + 0,0,0,67,0,0,0,115,14,0,0,0,116,0,124,1, + 131,1,124,0,95,1,100,0,83,0,114,13,0,0,0,41, + 2,218,4,98,111,111,108,114,118,0,0,0,41,2,114,30, + 0,0,0,218,5,118,97,108,117,101,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,124,0,0,0,154,1, + 0,0,115,2,0,0,0,0,2,41,12,114,1,0,0,0, + 114,0,0,0,0,114,2,0,0,0,114,3,0,0,0,114, + 31,0,0,0,114,49,0,0,0,114,126,0,0,0,218,8, + 112,114,111,112,101,114,116,121,114,123,0,0,0,218,6,115, + 101,116,116,101,114,114,131,0,0,0,114,124,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,113,0,0,0,58,1,0,0,115,32,0,0, + 0,8,1,4,36,4,1,2,255,12,12,8,10,8,12,2, + 1,10,8,4,1,10,3,2,1,10,7,2,1,10,3,4, + 1,114,113,0,0,0,169,2,114,114,0,0,0,114,116,0, + 0,0,99,2,0,0,0,0,0,0,0,2,0,0,0,6, + 0,0,0,8,0,0,0,67,0,0,0,115,152,0,0,0, + 116,0,124,1,100,1,131,2,114,74,116,1,100,2,117,0, + 114,22,116,2,130,1,116,1,106,3,125,4,124,3,100,2, + 117,0,114,48,124,4,124,0,124,1,100,3,141,2,83,0, + 124,3,114,56,103,0,110,2,100,2,125,5,124,4,124,0, + 124,1,124,5,100,4,141,3,83,0,124,3,100,2,117,0, + 114,136,116,0,124,1,100,5,131,2,114,132,122,14,124,1, + 160,4,124,0,161,1,125,3,87,0,113,136,4,0,116,5, + 121,128,1,0,1,0,1,0,100,2,125,3,89,0,113,136, + 48,0,110,4,100,6,125,3,116,6,124,0,124,1,124,2, + 124,3,100,7,141,4,83,0,41,8,122,53,82,101,116,117, + 114,110,32,97,32,109,111,100,117,108,101,32,115,112,101,99, + 32,98,97,115,101,100,32,111,110,32,118,97,114,105,111,117, + 115,32,108,111,97,100,101,114,32,109,101,116,104,111,100,115, + 46,90,12,103,101,116,95,102,105,108,101,110,97,109,101,78, + 41,1,114,110,0,0,0,41,2,114,110,0,0,0,114,117, + 0,0,0,114,116,0,0,0,70,114,136,0,0,0,41,7, + 114,4,0,0,0,114,127,0,0,0,114,128,0,0,0,218, + 23,115,112,101,99,95,102,114,111,109,95,102,105,108,101,95, + 108,111,99,97,116,105,111,110,114,116,0,0,0,114,80,0, + 0,0,114,113,0,0,0,41,6,114,17,0,0,0,114,110, + 0,0,0,114,114,0,0,0,114,116,0,0,0,114,137,0, + 0,0,90,6,115,101,97,114,99,104,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,92,0,0,0,159,1, + 0,0,115,36,0,0,0,0,2,10,1,8,1,4,1,6, + 2,8,1,12,1,12,1,6,1,2,255,6,3,8,1,10, + 1,2,1,14,1,12,1,12,3,4,2,114,92,0,0,0, + 99,3,0,0,0,0,0,0,0,0,0,0,0,8,0,0, + 0,8,0,0,0,67,0,0,0,115,42,1,0,0,122,10, + 124,0,106,0,125,3,87,0,110,18,4,0,116,1,121,28, + 1,0,1,0,1,0,89,0,110,14,48,0,124,3,100,0, + 117,1,114,42,124,3,83,0,124,0,106,2,125,4,124,1, + 100,0,117,0,114,86,122,10,124,0,106,3,125,1,87,0, + 110,18,4,0,116,1,121,84,1,0,1,0,1,0,89,0, + 110,2,48,0,122,10,124,0,106,4,125,5,87,0,110,22, + 4,0,116,1,121,118,1,0,1,0,1,0,100,0,125,5, + 89,0,110,2,48,0,124,2,100,0,117,0,114,176,124,5, + 100,0,117,0,114,172,122,10,124,1,106,5,125,2,87,0, + 113,176,4,0,116,1,121,168,1,0,1,0,1,0,100,0, + 125,2,89,0,113,176,48,0,110,4,124,5,125,2,122,10, + 124,0,106,6,125,6,87,0,110,22,4,0,116,1,121,208, + 1,0,1,0,1,0,100,0,125,6,89,0,110,2,48,0, + 122,14,116,7,124,0,106,8,131,1,125,7,87,0,110,22, + 4,0,116,1,121,246,1,0,1,0,1,0,100,0,125,7, + 89,0,110,2,48,0,116,9,124,4,124,1,124,2,100,1, + 141,3,125,3,124,5,100,0,117,0,144,1,114,20,100,2, + 110,2,100,3,124,3,95,10,124,6,124,3,95,11,124,7, + 124,3,95,12,124,3,83,0,41,4,78,169,1,114,114,0, + 0,0,70,84,41,13,114,106,0,0,0,114,107,0,0,0, + 114,1,0,0,0,114,99,0,0,0,114,109,0,0,0,218, + 7,95,79,82,73,71,73,78,218,10,95,95,99,97,99,104, + 101,100,95,95,218,4,108,105,115,116,218,8,95,95,112,97, + 116,104,95,95,114,113,0,0,0,114,118,0,0,0,114,123, + 0,0,0,114,117,0,0,0,41,8,114,97,0,0,0,114, + 110,0,0,0,114,114,0,0,0,114,96,0,0,0,114,17, + 0,0,0,90,8,108,111,99,97,116,105,111,110,114,123,0, + 0,0,114,117,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,17,95,115,112,101,99,95,102,114, + 111,109,95,109,111,100,117,108,101,185,1,0,0,115,72,0, + 0,0,0,2,2,1,10,1,12,1,6,2,8,1,4,2, + 6,1,8,1,2,1,10,1,12,2,6,1,2,1,10,1, + 12,1,10,1,8,1,8,1,2,1,10,1,12,1,12,2, + 4,1,2,1,10,1,12,1,10,1,2,1,14,1,12,1, + 10,2,14,1,20,1,6,1,6,1,114,143,0,0,0,70, + 169,1,218,8,111,118,101,114,114,105,100,101,99,2,0,0, + 0,0,0,0,0,1,0,0,0,5,0,0,0,8,0,0, + 0,67,0,0,0,115,210,1,0,0,124,2,115,20,116,0, + 124,1,100,1,100,0,131,3,100,0,117,0,114,52,122,12, + 124,0,106,1,124,1,95,2,87,0,110,18,4,0,116,3, + 121,50,1,0,1,0,1,0,89,0,110,2,48,0,124,2, + 115,72,116,0,124,1,100,2,100,0,131,3,100,0,117,0, + 114,174,124,0,106,4,125,3,124,3,100,0,117,0,114,144, + 124,0,106,5,100,0,117,1,114,144,116,6,100,0,117,0, + 114,108,116,7,130,1,116,6,106,8,125,4,124,4,160,9, + 124,4,161,1,125,3,124,0,106,5,124,3,95,10,124,3, + 124,0,95,4,100,0,124,1,95,11,122,10,124,3,124,1, + 95,12,87,0,110,18,4,0,116,3,121,172,1,0,1,0, + 1,0,89,0,110,2,48,0,124,2,115,194,116,0,124,1, + 100,3,100,0,131,3,100,0,117,0,114,226,122,12,124,0, + 106,13,124,1,95,14,87,0,110,18,4,0,116,3,121,224, + 1,0,1,0,1,0,89,0,110,2,48,0,122,10,124,0, + 124,1,95,15,87,0,110,18,4,0,116,3,121,254,1,0, + 1,0,1,0,89,0,110,2,48,0,124,2,144,1,115,24, + 116,0,124,1,100,4,100,0,131,3,100,0,117,0,144,1, + 114,70,124,0,106,5,100,0,117,1,144,1,114,70,122,12, + 124,0,106,5,124,1,95,16,87,0,110,20,4,0,116,3, + 144,1,121,68,1,0,1,0,1,0,89,0,110,2,48,0, + 124,0,106,17,144,1,114,206,124,2,144,1,115,102,116,0, + 124,1,100,5,100,0,131,3,100,0,117,0,144,1,114,136, + 122,12,124,0,106,18,124,1,95,11,87,0,110,20,4,0, + 116,3,144,1,121,134,1,0,1,0,1,0,89,0,110,2, + 48,0,124,2,144,1,115,160,116,0,124,1,100,6,100,0, + 131,3,100,0,117,0,144,1,114,206,124,0,106,19,100,0, + 117,1,144,1,114,206,122,12,124,0,106,19,124,1,95,20, + 87,0,110,20,4,0,116,3,144,1,121,204,1,0,1,0, + 1,0,89,0,110,2,48,0,124,1,83,0,41,7,78,114, + 1,0,0,0,114,99,0,0,0,218,11,95,95,112,97,99, + 107,97,103,101,95,95,114,142,0,0,0,114,109,0,0,0, + 114,140,0,0,0,41,21,114,6,0,0,0,114,17,0,0, + 0,114,1,0,0,0,114,107,0,0,0,114,110,0,0,0, + 114,117,0,0,0,114,127,0,0,0,114,128,0,0,0,218, + 16,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, + 114,218,7,95,95,110,101,119,95,95,90,5,95,112,97,116, + 104,114,109,0,0,0,114,99,0,0,0,114,131,0,0,0, + 114,146,0,0,0,114,106,0,0,0,114,142,0,0,0,114, + 124,0,0,0,114,114,0,0,0,114,123,0,0,0,114,140, + 0,0,0,41,5,114,96,0,0,0,114,97,0,0,0,114, + 145,0,0,0,114,110,0,0,0,114,147,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,18,95, + 105,110,105,116,95,109,111,100,117,108,101,95,97,116,116,114, + 115,230,1,0,0,115,96,0,0,0,0,4,20,1,2,1, + 12,1,12,1,6,2,20,1,6,1,8,2,10,1,8,1, + 4,1,6,2,10,1,8,1,6,11,6,1,2,1,10,1, + 12,1,6,2,20,1,2,1,12,1,12,1,6,2,2,1, + 10,1,12,1,6,2,24,1,12,1,2,1,12,1,14,1, + 6,2,8,1,24,1,2,1,12,1,14,1,6,2,24,1, + 12,1,2,1,12,1,14,1,6,1,114,149,0,0,0,99, + 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,82,0,0,0,100,1,125, + 1,116,0,124,0,106,1,100,2,131,2,114,30,124,0,106, + 1,160,2,124,0,161,1,125,1,110,20,116,0,124,0,106, + 1,100,3,131,2,114,50,116,3,100,4,131,1,130,1,124, + 1,100,1,117,0,114,68,116,4,124,0,106,5,131,1,125, + 1,116,6,124,0,124,1,131,2,1,0,124,1,83,0,41, + 5,122,43,67,114,101,97,116,101,32,97,32,109,111,100,117, + 108,101,32,98,97,115,101,100,32,111,110,32,116,104,101,32, + 112,114,111,118,105,100,101,100,32,115,112,101,99,46,78,218, + 13,99,114,101,97,116,101,95,109,111,100,117,108,101,218,11, + 101,120,101,99,95,109,111,100,117,108,101,122,66,108,111,97, + 100,101,114,115,32,116,104,97,116,32,100,101,102,105,110,101, + 32,101,120,101,99,95,109,111,100,117,108,101,40,41,32,109, + 117,115,116,32,97,108,115,111,32,100,101,102,105,110,101,32, + 99,114,101,97,116,101,95,109,111,100,117,108,101,40,41,41, + 7,114,4,0,0,0,114,110,0,0,0,114,150,0,0,0, + 114,80,0,0,0,114,18,0,0,0,114,17,0,0,0,114, + 149,0,0,0,169,2,114,96,0,0,0,114,97,0,0,0, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 8,95,105,110,115,116,97,108,108,152,4,0,0,115,6,0, - 0,0,0,2,10,2,12,1,114,230,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0, - 0,0,67,0,0,0,115,32,0,0,0,100,1,100,2,108, - 0,125,0,124,0,97,1,124,0,160,2,116,3,106,4,116, - 5,25,0,161,1,1,0,100,2,83,0,41,3,122,57,73, - 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, - 32,116,104,97,116,32,114,101,113,117,105,114,101,32,101,120, - 116,101,114,110,97,108,32,102,105,108,101,115,121,115,116,101, - 109,32,97,99,99,101,115,115,114,22,0,0,0,78,41,6, - 218,26,95,102,114,111,122,101,110,95,105,109,112,111,114,116, - 108,105,98,95,101,120,116,101,114,110,97,108,114,127,0,0, - 0,114,230,0,0,0,114,15,0,0,0,114,93,0,0,0, - 114,1,0,0,0,41,1,114,231,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,27,95,105,110, - 115,116,97,108,108,95,101,120,116,101,114,110,97,108,95,105, - 109,112,111,114,116,101,114,115,160,4,0,0,115,6,0,0, - 0,0,3,8,1,4,1,114,232,0,0,0,41,2,78,78, - 41,1,78,41,2,78,114,22,0,0,0,41,4,78,78,114, - 10,0,0,0,114,22,0,0,0,41,50,114,3,0,0,0, - 114,127,0,0,0,114,12,0,0,0,114,18,0,0,0,114, - 60,0,0,0,114,34,0,0,0,114,44,0,0,0,114,19, - 0,0,0,114,20,0,0,0,114,50,0,0,0,114,51,0, - 0,0,114,54,0,0,0,114,66,0,0,0,114,68,0,0, - 0,114,77,0,0,0,114,87,0,0,0,114,91,0,0,0, - 114,98,0,0,0,114,112,0,0,0,114,113,0,0,0,114, - 92,0,0,0,114,143,0,0,0,114,149,0,0,0,114,153, - 0,0,0,114,108,0,0,0,114,94,0,0,0,114,159,0, - 0,0,114,160,0,0,0,114,95,0,0,0,114,161,0,0, - 0,114,175,0,0,0,114,180,0,0,0,114,189,0,0,0, - 114,191,0,0,0,114,196,0,0,0,114,202,0,0,0,90, - 15,95,69,82,82,95,77,83,71,95,80,82,69,70,73,88, - 114,204,0,0,0,114,207,0,0,0,218,6,111,98,106,101, - 99,116,114,208,0,0,0,114,209,0,0,0,114,210,0,0, - 0,114,215,0,0,0,114,221,0,0,0,114,224,0,0,0, - 114,225,0,0,0,114,229,0,0,0,114,230,0,0,0,114, - 232,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,8,60,109,111,100,117,108, - 101,62,1,0,0,0,115,94,0,0,0,4,24,4,2,8, - 8,8,8,4,2,4,3,16,4,14,77,14,21,14,16,8, - 37,8,17,8,11,14,8,8,11,8,12,8,16,8,36,14, - 101,16,26,10,45,14,72,8,17,8,17,8,30,8,37,8, - 42,8,15,14,75,14,79,14,13,8,9,8,9,10,47,8, - 16,4,1,8,2,8,32,6,3,8,16,10,15,14,37,8, - 27,10,37,8,7,8,35,8,8, + 16,109,111,100,117,108,101,95,102,114,111,109,95,115,112,101, + 99,46,2,0,0,115,18,0,0,0,0,3,4,1,12,3, + 14,1,12,1,8,2,8,1,10,1,10,1,114,153,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,67,0,0,0,115,106,0,0,0,124, + 0,106,0,100,1,117,0,114,14,100,2,110,4,124,0,106, + 0,125,1,124,0,106,1,100,1,117,0,114,66,124,0,106, + 2,100,1,117,0,114,50,100,3,160,3,124,1,161,1,83, + 0,100,4,160,3,124,1,124,0,106,2,161,2,83,0,110, + 36,124,0,106,4,114,86,100,5,160,3,124,1,124,0,106, + 1,161,2,83,0,100,6,160,3,124,0,106,0,124,0,106, + 1,161,2,83,0,100,1,83,0,41,7,122,38,82,101,116, + 117,114,110,32,116,104,101,32,114,101,112,114,32,116,111,32, + 117,115,101,32,102,111,114,32,116,104,101,32,109,111,100,117, + 108,101,46,78,114,101,0,0,0,114,102,0,0,0,114,103, + 0,0,0,114,104,0,0,0,250,18,60,109,111,100,117,108, + 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,17, + 0,0,0,114,114,0,0,0,114,110,0,0,0,114,46,0, + 0,0,114,124,0,0,0,41,2,114,96,0,0,0,114,17, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,108,0,0,0,63,2,0,0,115,16,0,0,0, + 0,3,20,1,10,1,10,1,10,2,16,2,6,1,14,2, + 114,108,0,0,0,99,2,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,10,0,0,0,67,0,0,0,115,250, + 0,0,0,124,0,106,0,125,2,116,1,124,2,131,1,143, + 216,1,0,116,2,106,3,160,4,124,2,161,1,124,1,117, + 1,114,54,100,1,160,5,124,2,161,1,125,3,116,6,124, + 3,124,2,100,2,141,2,130,1,122,132,124,0,106,7,100, + 3,117,0,114,106,124,0,106,8,100,3,117,0,114,90,116, + 6,100,4,124,0,106,0,100,2,141,2,130,1,116,9,124, + 0,124,1,100,5,100,6,141,3,1,0,110,52,116,9,124, + 0,124,1,100,5,100,6,141,3,1,0,116,10,124,0,106, + 7,100,7,131,2,115,146,124,0,106,7,160,11,124,2,161, + 1,1,0,110,12,124,0,106,7,160,12,124,1,161,1,1, + 0,87,0,116,2,106,3,160,13,124,0,106,0,161,1,125, + 1,124,1,116,2,106,3,124,0,106,0,60,0,110,28,116, + 2,106,3,160,13,124,0,106,0,161,1,125,1,124,1,116, + 2,106,3,124,0,106,0,60,0,48,0,87,0,100,3,4, + 0,4,0,131,3,1,0,110,16,49,0,115,236,48,0,1, + 0,1,0,1,0,89,0,1,0,124,1,83,0,41,8,122, + 70,69,120,101,99,117,116,101,32,116,104,101,32,115,112,101, + 99,39,115,32,115,112,101,99,105,102,105,101,100,32,109,111, + 100,117,108,101,32,105,110,32,97,110,32,101,120,105,115,116, + 105,110,103,32,109,111,100,117,108,101,39,115,32,110,97,109, + 101,115,112,97,99,101,46,122,30,109,111,100,117,108,101,32, + 123,33,114,125,32,110,111,116,32,105,110,32,115,121,115,46, + 109,111,100,117,108,101,115,114,16,0,0,0,78,250,14,109, + 105,115,115,105,110,103,32,108,111,97,100,101,114,84,114,144, + 0,0,0,114,151,0,0,0,41,14,114,17,0,0,0,114, + 51,0,0,0,114,15,0,0,0,114,93,0,0,0,114,35, + 0,0,0,114,46,0,0,0,114,80,0,0,0,114,110,0, + 0,0,114,117,0,0,0,114,149,0,0,0,114,4,0,0, + 0,218,11,108,111,97,100,95,109,111,100,117,108,101,114,151, + 0,0,0,218,3,112,111,112,41,4,114,96,0,0,0,114, + 97,0,0,0,114,17,0,0,0,218,3,109,115,103,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,94,0, + 0,0,80,2,0,0,115,38,0,0,0,0,2,6,1,10, + 1,16,1,10,1,12,1,2,1,10,1,10,1,14,2,16, + 2,14,1,12,4,14,2,14,4,14,1,14,255,14,1,44, + 1,114,94,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, + 20,1,0,0,122,18,124,0,106,0,160,1,124,0,106,2, + 161,1,1,0,87,0,110,52,1,0,1,0,1,0,124,0, + 106,2,116,3,106,4,118,0,114,64,116,3,106,4,160,5, + 124,0,106,2,161,1,125,1,124,1,116,3,106,4,124,0, + 106,2,60,0,130,0,89,0,110,2,48,0,116,3,106,4, + 160,5,124,0,106,2,161,1,125,1,124,1,116,3,106,4, + 124,0,106,2,60,0,116,6,124,1,100,1,100,0,131,3, + 100,0,117,0,114,146,122,12,124,0,106,0,124,1,95,7, + 87,0,110,18,4,0,116,8,121,144,1,0,1,0,1,0, + 89,0,110,2,48,0,116,6,124,1,100,2,100,0,131,3, + 100,0,117,0,114,222,122,40,124,1,106,9,124,1,95,10, + 116,11,124,1,100,3,131,2,115,200,124,0,106,2,160,12, + 100,4,161,1,100,5,25,0,124,1,95,10,87,0,110,18, + 4,0,116,8,121,220,1,0,1,0,1,0,89,0,110,2, + 48,0,116,6,124,1,100,6,100,0,131,3,100,0,117,0, + 144,1,114,16,122,10,124,0,124,1,95,13,87,0,110,20, + 4,0,116,8,144,1,121,14,1,0,1,0,1,0,89,0, + 110,2,48,0,124,1,83,0,41,7,78,114,99,0,0,0, + 114,146,0,0,0,114,142,0,0,0,114,129,0,0,0,114, + 22,0,0,0,114,106,0,0,0,41,14,114,110,0,0,0, + 114,156,0,0,0,114,17,0,0,0,114,15,0,0,0,114, + 93,0,0,0,114,157,0,0,0,114,6,0,0,0,114,99, + 0,0,0,114,107,0,0,0,114,1,0,0,0,114,146,0, + 0,0,114,4,0,0,0,114,130,0,0,0,114,106,0,0, + 0,114,152,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,25,95,108,111,97,100,95,98,97,99, + 107,119,97,114,100,95,99,111,109,112,97,116,105,98,108,101, + 110,2,0,0,115,54,0,0,0,0,4,2,1,18,1,6, + 1,12,1,14,1,12,1,8,3,14,1,12,1,16,1,2, + 1,12,1,12,1,6,1,16,1,2,4,8,1,10,1,22, + 1,12,1,6,1,18,1,2,1,10,1,14,1,6,1,114, + 159,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,11,0,0,0,67,0,0,0,115,224,0, + 0,0,124,0,106,0,100,0,117,1,114,30,116,1,124,0, + 106,0,100,1,131,2,115,30,116,2,124,0,131,1,83,0, + 116,3,124,0,131,1,125,1,100,2,124,0,95,4,122,166, + 124,1,116,5,106,6,124,0,106,7,60,0,122,52,124,0, + 106,0,100,0,117,0,114,96,124,0,106,8,100,0,117,0, + 114,108,116,9,100,3,124,0,106,7,100,4,141,2,130,1, + 110,12,124,0,106,0,160,10,124,1,161,1,1,0,87,0, + 110,48,1,0,1,0,1,0,122,14,116,5,106,6,124,0, + 106,7,61,0,87,0,110,18,4,0,116,11,121,150,1,0, + 1,0,1,0,89,0,110,2,48,0,130,0,89,0,110,2, + 48,0,116,5,106,6,160,12,124,0,106,7,161,1,125,1, + 124,1,116,5,106,6,124,0,106,7,60,0,116,13,100,5, + 124,0,106,7,124,0,106,0,131,3,1,0,87,0,100,6, + 124,0,95,4,110,8,100,6,124,0,95,4,48,0,124,1, + 83,0,41,7,78,114,151,0,0,0,84,114,155,0,0,0, + 114,16,0,0,0,122,18,105,109,112,111,114,116,32,123,33, + 114,125,32,35,32,123,33,114,125,70,41,14,114,110,0,0, + 0,114,4,0,0,0,114,159,0,0,0,114,153,0,0,0, + 90,13,95,105,110,105,116,105,97,108,105,122,105,110,103,114, + 15,0,0,0,114,93,0,0,0,114,17,0,0,0,114,117, + 0,0,0,114,80,0,0,0,114,151,0,0,0,114,64,0, + 0,0,114,157,0,0,0,114,77,0,0,0,114,152,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,14,95,108,111,97,100,95,117,110,108,111,99,107,101,100, + 147,2,0,0,115,46,0,0,0,0,2,10,2,12,1,8, + 2,8,5,6,1,2,1,12,1,2,1,10,1,10,1,16, + 3,16,1,6,1,2,1,14,1,12,1,6,1,8,5,14, + 1,12,1,18,2,16,2,114,160,0,0,0,99,1,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0, + 0,67,0,0,0,115,54,0,0,0,116,0,124,0,106,1, + 131,1,143,24,1,0,116,2,124,0,131,1,87,0,2,0, + 100,1,4,0,4,0,131,3,1,0,83,0,49,0,115,40, + 48,0,1,0,1,0,1,0,89,0,1,0,100,1,83,0, + 41,2,122,191,82,101,116,117,114,110,32,97,32,110,101,119, + 32,109,111,100,117,108,101,32,111,98,106,101,99,116,44,32, + 108,111,97,100,101,100,32,98,121,32,116,104,101,32,115,112, + 101,99,39,115,32,108,111,97,100,101,114,46,10,10,32,32, + 32,32,84,104,101,32,109,111,100,117,108,101,32,105,115,32, + 110,111,116,32,97,100,100,101,100,32,116,111,32,105,116,115, + 32,112,97,114,101,110,116,46,10,10,32,32,32,32,73,102, + 32,97,32,109,111,100,117,108,101,32,105,115,32,97,108,114, + 101,97,100,121,32,105,110,32,115,121,115,46,109,111,100,117, + 108,101,115,44,32,116,104,97,116,32,101,120,105,115,116,105, + 110,103,32,109,111,100,117,108,101,32,103,101,116,115,10,32, + 32,32,32,99,108,111,98,98,101,114,101,100,46,10,10,32, + 32,32,32,78,41,3,114,51,0,0,0,114,17,0,0,0, + 114,160,0,0,0,41,1,114,96,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,95,0,0,0, + 189,2,0,0,115,4,0,0,0,0,9,12,1,114,95,0, + 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,4,0,0,0,64,0,0,0,115,140,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,100,2,90,4, + 101,5,100,3,100,4,132,0,131,1,90,6,101,7,100,20, + 100,6,100,7,132,1,131,1,90,8,101,7,100,21,100,8, + 100,9,132,1,131,1,90,9,101,7,100,10,100,11,132,0, + 131,1,90,10,101,7,100,12,100,13,132,0,131,1,90,11, + 101,7,101,12,100,14,100,15,132,0,131,1,131,1,90,13, + 101,7,101,12,100,16,100,17,132,0,131,1,131,1,90,14, + 101,7,101,12,100,18,100,19,132,0,131,1,131,1,90,15, + 101,7,101,16,131,1,90,17,100,5,83,0,41,22,218,15, + 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,122, + 144,77,101,116,97,32,112,97,116,104,32,105,109,112,111,114, + 116,32,102,111,114,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,115,46,10,10,32,32,32,32,65,108,108, + 32,109,101,116,104,111,100,115,32,97,114,101,32,101,105,116, + 104,101,114,32,99,108,97,115,115,32,111,114,32,115,116,97, + 116,105,99,32,109,101,116,104,111,100,115,32,116,111,32,97, + 118,111,105,100,32,116,104,101,32,110,101,101,100,32,116,111, + 10,32,32,32,32,105,110,115,116,97,110,116,105,97,116,101, + 32,116,104,101,32,99,108,97,115,115,46,10,10,32,32,32, + 32,122,8,98,117,105,108,116,45,105,110,99,1,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0, + 67,0,0,0,115,22,0,0,0,100,1,124,0,106,0,155, + 2,100,2,116,1,106,2,155,0,100,3,157,5,83,0,41, + 4,250,115,82,101,116,117,114,110,32,114,101,112,114,32,102, + 111,114,32,116,104,101,32,109,111,100,117,108,101,46,10,10, + 32,32,32,32,32,32,32,32,84,104,101,32,109,101,116,104, + 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 46,32,32,84,104,101,32,105,109,112,111,114,116,32,109,97, + 99,104,105,110,101,114,121,32,100,111,101,115,32,116,104,101, + 32,106,111,98,32,105,116,115,101,108,102,46,10,10,32,32, + 32,32,32,32,32,32,122,8,60,109,111,100,117,108,101,32, + 122,2,32,40,122,2,41,62,41,3,114,1,0,0,0,114, + 161,0,0,0,114,139,0,0,0,41,1,114,97,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 100,0,0,0,215,2,0,0,115,2,0,0,0,0,7,122, + 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, + 46,109,111,100,117,108,101,95,114,101,112,114,78,99,4,0, + 0,0,0,0,0,0,0,0,0,0,4,0,0,0,5,0, + 0,0,67,0,0,0,115,46,0,0,0,124,2,100,0,117, + 1,114,12,100,0,83,0,116,0,160,1,124,1,161,1,114, + 38,116,2,124,1,124,0,124,0,106,3,100,1,141,3,83, + 0,100,0,83,0,100,0,83,0,169,2,78,114,138,0,0, + 0,41,4,114,58,0,0,0,90,10,105,115,95,98,117,105, + 108,116,105,110,114,92,0,0,0,114,139,0,0,0,169,4, + 218,3,99,108,115,114,82,0,0,0,218,4,112,97,116,104, + 218,6,116,97,114,103,101,116,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,9,102,105,110,100,95,115,112, + 101,99,224,2,0,0,115,10,0,0,0,0,2,8,1,4, + 1,10,1,16,2,122,25,66,117,105,108,116,105,110,73,109, + 112,111,114,116,101,114,46,102,105,110,100,95,115,112,101,99, + 99,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + 0,4,0,0,0,67,0,0,0,115,30,0,0,0,124,0, + 160,0,124,1,124,2,161,2,125,3,124,3,100,1,117,1, + 114,26,124,3,106,1,83,0,100,1,83,0,41,2,122,175, + 70,105,110,100,32,116,104,101,32,98,117,105,108,116,45,105, + 110,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,73,102,32,39,112,97,116,104,39,32,105,115,32, + 101,118,101,114,32,115,112,101,99,105,102,105,101,100,32,116, + 104,101,110,32,116,104,101,32,115,101,97,114,99,104,32,105, + 115,32,99,111,110,115,105,100,101,114,101,100,32,97,32,102, + 97,105,108,117,114,101,46,10,10,32,32,32,32,32,32,32, + 32,84,104,105,115,32,109,101,116,104,111,100,32,105,115,32, + 100,101,112,114,101,99,97,116,101,100,46,32,32,85,115,101, + 32,102,105,110,100,95,115,112,101,99,40,41,32,105,110,115, + 116,101,97,100,46,10,10,32,32,32,32,32,32,32,32,78, + 41,2,114,168,0,0,0,114,110,0,0,0,41,4,114,165, + 0,0,0,114,82,0,0,0,114,166,0,0,0,114,96,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,11,102,105,110,100,95,109,111,100,117,108,101,233,2, + 0,0,115,4,0,0,0,0,9,12,1,122,27,66,117,105, + 108,116,105,110,73,109,112,111,114,116,101,114,46,102,105,110, + 100,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, + 0,115,46,0,0,0,124,1,106,0,116,1,106,2,118,1, + 114,34,116,3,100,1,160,4,124,1,106,0,161,1,124,1, + 106,0,100,2,141,2,130,1,116,5,116,6,106,7,124,1, + 131,2,83,0,41,3,122,24,67,114,101,97,116,101,32,97, + 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, + 114,78,0,0,0,114,16,0,0,0,41,8,114,17,0,0, + 0,114,15,0,0,0,114,79,0,0,0,114,80,0,0,0, + 114,46,0,0,0,114,68,0,0,0,114,58,0,0,0,90, + 14,99,114,101,97,116,101,95,98,117,105,108,116,105,110,41, + 2,114,30,0,0,0,114,96,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,150,0,0,0,245, + 2,0,0,115,10,0,0,0,0,3,12,1,12,1,4,255, + 6,2,122,29,66,117,105,108,116,105,110,73,109,112,111,114, + 116,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,116, + 0,116,1,106,2,124,1,131,2,1,0,100,1,83,0,41, + 2,122,22,69,120,101,99,32,97,32,98,117,105,108,116,45, + 105,110,32,109,111,100,117,108,101,78,41,3,114,68,0,0, + 0,114,58,0,0,0,90,12,101,120,101,99,95,98,117,105, + 108,116,105,110,41,2,114,30,0,0,0,114,97,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 151,0,0,0,253,2,0,0,115,2,0,0,0,0,3,122, + 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, + 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, + 122,57,82,101,116,117,114,110,32,78,111,110,101,32,97,115, + 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, + 115,32,100,111,32,110,111,116,32,104,97,118,101,32,99,111, + 100,101,32,111,98,106,101,99,116,115,46,78,114,10,0,0, + 0,169,2,114,165,0,0,0,114,82,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,8,103,101, + 116,95,99,111,100,101,2,3,0,0,115,2,0,0,0,0, + 4,122,24,66,117,105,108,116,105,110,73,109,112,111,114,116, + 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, + 56,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, + 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, + 32,100,111,32,110,111,116,32,104,97,118,101,32,115,111,117, + 114,99,101,32,99,111,100,101,46,78,114,10,0,0,0,114, + 170,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,8, + 3,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, + 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, + 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,41,2,122,52,82,101,116,117, + 114,110,32,70,97,108,115,101,32,97,115,32,98,117,105,108, + 116,45,105,110,32,109,111,100,117,108,101,115,32,97,114,101, + 32,110,101,118,101,114,32,112,97,99,107,97,103,101,115,46, + 70,114,10,0,0,0,114,170,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,116,0,0,0,14, + 3,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, + 116,105,110,73,109,112,111,114,116,101,114,46,105,115,95,112, + 97,99,107,97,103,101,41,2,78,78,41,1,78,41,18,114, + 1,0,0,0,114,0,0,0,0,114,2,0,0,0,114,3, + 0,0,0,114,139,0,0,0,218,12,115,116,97,116,105,99, + 109,101,116,104,111,100,114,100,0,0,0,218,11,99,108,97, + 115,115,109,101,116,104,111,100,114,168,0,0,0,114,169,0, + 0,0,114,150,0,0,0,114,151,0,0,0,114,87,0,0, + 0,114,171,0,0,0,114,172,0,0,0,114,116,0,0,0, + 114,98,0,0,0,114,156,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,161, + 0,0,0,204,2,0,0,115,44,0,0,0,8,2,4,7, + 4,2,2,1,10,8,2,1,12,8,2,1,12,11,2,1, + 10,7,2,1,10,4,2,1,2,1,12,4,2,1,2,1, + 12,4,2,1,2,1,12,4,114,161,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0, + 0,0,64,0,0,0,115,144,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,90,4,101,5,100,3,100, + 4,132,0,131,1,90,6,101,7,100,22,100,6,100,7,132, + 1,131,1,90,8,101,7,100,23,100,8,100,9,132,1,131, + 1,90,9,101,7,100,10,100,11,132,0,131,1,90,10,101, + 5,100,12,100,13,132,0,131,1,90,11,101,7,100,14,100, + 15,132,0,131,1,90,12,101,7,101,13,100,16,100,17,132, + 0,131,1,131,1,90,14,101,7,101,13,100,18,100,19,132, + 0,131,1,131,1,90,15,101,7,101,13,100,20,100,21,132, + 0,131,1,131,1,90,16,100,5,83,0,41,24,218,14,70, + 114,111,122,101,110,73,109,112,111,114,116,101,114,122,142,77, + 101,116,97,32,112,97,116,104,32,105,109,112,111,114,116,32, + 102,111,114,32,102,114,111,122,101,110,32,109,111,100,117,108, + 101,115,46,10,10,32,32,32,32,65,108,108,32,109,101,116, + 104,111,100,115,32,97,114,101,32,101,105,116,104,101,114,32, + 99,108,97,115,115,32,111,114,32,115,116,97,116,105,99,32, + 109,101,116,104,111,100,115,32,116,111,32,97,118,111,105,100, + 32,116,104,101,32,110,101,101,100,32,116,111,10,32,32,32, + 32,105,110,115,116,97,110,116,105,97,116,101,32,116,104,101, + 32,99,108,97,115,115,46,10,10,32,32,32,32,90,6,102, + 114,111,122,101,110,99,1,0,0,0,0,0,0,0,0,0, + 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,16, + 0,0,0,100,1,160,0,124,0,106,1,116,2,106,3,161, + 2,83,0,41,2,114,162,0,0,0,114,154,0,0,0,41, + 4,114,46,0,0,0,114,1,0,0,0,114,175,0,0,0, + 114,139,0,0,0,41,1,218,1,109,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,100,0,0,0,34,3, + 0,0,115,2,0,0,0,0,7,122,26,70,114,111,122,101, + 110,73,109,112,111,114,116,101,114,46,109,111,100,117,108,101, + 95,114,101,112,114,78,99,4,0,0,0,0,0,0,0,0, + 0,0,0,4,0,0,0,5,0,0,0,67,0,0,0,115, + 34,0,0,0,116,0,160,1,124,1,161,1,114,26,116,2, + 124,1,124,0,124,0,106,3,100,1,141,3,83,0,100,0, + 83,0,100,0,83,0,114,163,0,0,0,41,4,114,58,0, + 0,0,114,89,0,0,0,114,92,0,0,0,114,139,0,0, + 0,114,164,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,168,0,0,0,43,3,0,0,115,6, + 0,0,0,0,2,10,1,16,2,122,24,70,114,111,122,101, + 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,115, + 112,101,99,99,3,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, + 0,116,0,160,1,124,1,161,1,114,14,124,0,83,0,100, + 1,83,0,41,2,122,93,70,105,110,100,32,97,32,102,114, + 111,122,101,110,32,109,111,100,117,108,101,46,10,10,32,32, + 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, + 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, + 32,32,85,115,101,32,102,105,110,100,95,115,112,101,99,40, + 41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32, + 32,32,32,32,78,41,2,114,58,0,0,0,114,89,0,0, + 0,41,3,114,165,0,0,0,114,82,0,0,0,114,166,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,169,0,0,0,50,3,0,0,115,2,0,0,0,0, + 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,46,102,105,110,100,95,109,111,100,117,108,101,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, + 2,122,42,85,115,101,32,100,101,102,97,117,108,116,32,115, + 101,109,97,110,116,105,99,115,32,102,111,114,32,109,111,100, + 117,108,101,32,99,114,101,97,116,105,111,110,46,78,114,10, + 0,0,0,41,2,114,165,0,0,0,114,96,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,150, + 0,0,0,59,3,0,0,115,2,0,0,0,0,2,122,28, + 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,99, + 114,101,97,116,101,95,109,111,100,117,108,101,99,1,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0, + 0,67,0,0,0,115,64,0,0,0,124,0,106,0,106,1, + 125,1,116,2,160,3,124,1,161,1,115,36,116,4,100,1, + 160,5,124,1,161,1,124,1,100,2,141,2,130,1,116,6, + 116,2,106,7,124,1,131,2,125,2,116,8,124,2,124,0, + 106,9,131,2,1,0,100,0,83,0,114,88,0,0,0,41, + 10,114,106,0,0,0,114,17,0,0,0,114,58,0,0,0, + 114,89,0,0,0,114,80,0,0,0,114,46,0,0,0,114, + 68,0,0,0,218,17,103,101,116,95,102,114,111,122,101,110, + 95,111,98,106,101,99,116,218,4,101,120,101,99,114,7,0, + 0,0,41,3,114,97,0,0,0,114,17,0,0,0,218,4, + 99,111,100,101,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,151,0,0,0,63,3,0,0,115,14,0,0, + 0,0,2,8,1,10,1,10,1,2,255,6,2,12,1,122, + 26,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, + 101,120,101,99,95,109,111,100,117,108,101,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,10,0,0,0,116,0,124,0,124,1,131, + 2,83,0,41,1,122,95,76,111,97,100,32,97,32,102,114, + 111,122,101,110,32,109,111,100,117,108,101,46,10,10,32,32, + 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, + 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, + 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, + 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, + 32,32,32,32,32,32,41,1,114,98,0,0,0,114,170,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,156,0,0,0,72,3,0,0,115,2,0,0,0,0, + 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,10,0,0,0,116,0,160,1,124, + 1,161,1,83,0,41,1,122,45,82,101,116,117,114,110,32, + 116,104,101,32,99,111,100,101,32,111,98,106,101,99,116,32, + 102,111,114,32,116,104,101,32,102,114,111,122,101,110,32,109, + 111,100,117,108,101,46,41,2,114,58,0,0,0,114,177,0, + 0,0,114,170,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,171,0,0,0,81,3,0,0,115, + 2,0,0,0,0,4,122,23,70,114,111,122,101,110,73,109, + 112,111,114,116,101,114,46,103,101,116,95,99,111,100,101,99, + 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, + 0,41,2,122,54,82,101,116,117,114,110,32,78,111,110,101, + 32,97,115,32,102,114,111,122,101,110,32,109,111,100,117,108, + 101,115,32,100,111,32,110,111,116,32,104,97,118,101,32,115, + 111,117,114,99,101,32,99,111,100,101,46,78,114,10,0,0, + 0,114,170,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,172,0,0,0,87,3,0,0,115,2, + 0,0,0,0,4,122,25,70,114,111,122,101,110,73,109,112, + 111,114,116,101,114,46,103,101,116,95,115,111,117,114,99,101, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,67,0,0,0,115,10,0,0,0,116,0, + 160,1,124,1,161,1,83,0,41,1,122,46,82,101,116,117, + 114,110,32,84,114,117,101,32,105,102,32,116,104,101,32,102, + 114,111,122,101,110,32,109,111,100,117,108,101,32,105,115,32, + 97,32,112,97,99,107,97,103,101,46,41,2,114,58,0,0, + 0,90,17,105,115,95,102,114,111,122,101,110,95,112,97,99, + 107,97,103,101,114,170,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,116,0,0,0,93,3,0, + 0,115,2,0,0,0,0,4,122,25,70,114,111,122,101,110, + 73,109,112,111,114,116,101,114,46,105,115,95,112,97,99,107, + 97,103,101,41,2,78,78,41,1,78,41,17,114,1,0,0, + 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, + 114,139,0,0,0,114,173,0,0,0,114,100,0,0,0,114, + 174,0,0,0,114,168,0,0,0,114,169,0,0,0,114,150, + 0,0,0,114,151,0,0,0,114,156,0,0,0,114,91,0, + 0,0,114,171,0,0,0,114,172,0,0,0,114,116,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,175,0,0,0,23,3,0,0,115,46, + 0,0,0,8,2,4,7,4,2,2,1,10,8,2,1,12, + 6,2,1,12,8,2,1,10,3,2,1,10,8,2,1,10, + 8,2,1,2,1,12,4,2,1,2,1,12,4,2,1,2, + 1,114,175,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, + 32,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 100,6,83,0,41,7,218,18,95,73,109,112,111,114,116,76, + 111,99,107,67,111,110,116,101,120,116,122,36,67,111,110,116, + 101,120,116,32,109,97,110,97,103,101,114,32,102,111,114,32, + 116,104,101,32,105,109,112,111,114,116,32,108,111,99,107,46, + 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, + 0,2,0,0,0,67,0,0,0,115,12,0,0,0,116,0, + 160,1,161,0,1,0,100,1,83,0,41,2,122,24,65,99, + 113,117,105,114,101,32,116,104,101,32,105,109,112,111,114,116, + 32,108,111,99,107,46,78,41,2,114,58,0,0,0,114,59, + 0,0,0,114,48,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,55,0,0,0,106,3,0,0, + 115,2,0,0,0,0,2,122,28,95,73,109,112,111,114,116, + 76,111,99,107,67,111,110,116,101,120,116,46,95,95,101,110, + 116,101,114,95,95,99,4,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,2,0,0,0,67,0,0,0,115,12, + 0,0,0,116,0,160,1,161,0,1,0,100,1,83,0,41, + 2,122,60,82,101,108,101,97,115,101,32,116,104,101,32,105, + 109,112,111,114,116,32,108,111,99,107,32,114,101,103,97,114, + 100,108,101,115,115,32,111,102,32,97,110,121,32,114,97,105, + 115,101,100,32,101,120,99,101,112,116,105,111,110,115,46,78, + 41,2,114,58,0,0,0,114,61,0,0,0,41,4,114,30, + 0,0,0,218,8,101,120,99,95,116,121,112,101,218,9,101, + 120,99,95,118,97,108,117,101,218,13,101,120,99,95,116,114, + 97,99,101,98,97,99,107,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,57,0,0,0,110,3,0,0,115, + 2,0,0,0,0,2,122,27,95,73,109,112,111,114,116,76, + 111,99,107,67,111,110,116,101,120,116,46,95,95,101,120,105, + 116,95,95,78,41,6,114,1,0,0,0,114,0,0,0,0, + 114,2,0,0,0,114,3,0,0,0,114,55,0,0,0,114, + 57,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,180,0,0,0,102,3,0, + 0,115,6,0,0,0,8,2,4,2,8,4,114,180,0,0, + 0,99,3,0,0,0,0,0,0,0,0,0,0,0,5,0, + 0,0,5,0,0,0,67,0,0,0,115,64,0,0,0,124, + 1,160,0,100,1,124,2,100,2,24,0,161,2,125,3,116, + 1,124,3,131,1,124,2,107,0,114,36,116,2,100,3,131, + 1,130,1,124,3,100,4,25,0,125,4,124,0,114,60,100, + 5,160,3,124,4,124,0,161,2,83,0,124,4,83,0,41, + 6,122,50,82,101,115,111,108,118,101,32,97,32,114,101,108, + 97,116,105,118,101,32,109,111,100,117,108,101,32,110,97,109, + 101,32,116,111,32,97,110,32,97,98,115,111,108,117,116,101, + 32,111,110,101,46,114,129,0,0,0,114,39,0,0,0,122, + 50,97,116,116,101,109,112,116,101,100,32,114,101,108,97,116, + 105,118,101,32,105,109,112,111,114,116,32,98,101,121,111,110, + 100,32,116,111,112,45,108,101,118,101,108,32,112,97,99,107, + 97,103,101,114,22,0,0,0,250,5,123,125,46,123,125,41, + 4,218,6,114,115,112,108,105,116,218,3,108,101,110,114,80, + 0,0,0,114,46,0,0,0,41,5,114,17,0,0,0,218, + 7,112,97,99,107,97,103,101,218,5,108,101,118,101,108,90, + 4,98,105,116,115,90,4,98,97,115,101,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,13,95,114,101,115, + 111,108,118,101,95,110,97,109,101,115,3,0,0,115,10,0, + 0,0,0,2,16,1,12,1,8,1,8,1,114,189,0,0, + 0,99,3,0,0,0,0,0,0,0,0,0,0,0,4,0, + 0,0,4,0,0,0,67,0,0,0,115,34,0,0,0,124, + 0,160,0,124,1,124,2,161,2,125,3,124,3,100,0,117, + 0,114,24,100,0,83,0,116,1,124,1,124,3,131,2,83, + 0,114,13,0,0,0,41,2,114,169,0,0,0,114,92,0, + 0,0,41,4,218,6,102,105,110,100,101,114,114,17,0,0, + 0,114,166,0,0,0,114,110,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,17,95,102,105,110, + 100,95,115,112,101,99,95,108,101,103,97,99,121,124,3,0, + 0,115,8,0,0,0,0,3,12,1,8,1,4,1,114,191, + 0,0,0,99,3,0,0,0,0,0,0,0,0,0,0,0, + 10,0,0,0,10,0,0,0,67,0,0,0,115,32,1,0, + 0,116,0,106,1,125,3,124,3,100,1,117,0,114,22,116, + 2,100,2,131,1,130,1,124,3,115,38,116,3,160,4,100, + 3,116,5,161,2,1,0,124,0,116,0,106,6,118,0,125, + 4,124,3,68,0,93,230,125,5,116,7,131,0,143,94,1, + 0,122,10,124,5,106,8,125,6,87,0,110,54,4,0,116, + 9,121,128,1,0,1,0,1,0,116,10,124,5,124,0,124, + 1,131,3,125,7,124,7,100,1,117,0,114,124,89,0,87, + 0,100,1,4,0,4,0,131,3,1,0,113,52,89,0,110, + 14,48,0,124,6,124,0,124,1,124,2,131,3,125,7,87, + 0,100,1,4,0,4,0,131,3,1,0,110,16,49,0,115, + 162,48,0,1,0,1,0,1,0,89,0,1,0,124,7,100, + 1,117,1,114,52,124,4,144,1,115,18,124,0,116,0,106, + 6,118,0,144,1,114,18,116,0,106,6,124,0,25,0,125, + 8,122,10,124,8,106,11,125,9,87,0,110,26,4,0,116, + 9,121,244,1,0,1,0,1,0,124,7,6,0,89,0,2, + 0,1,0,83,0,48,0,124,9,100,1,117,0,144,1,114, + 8,124,7,2,0,1,0,83,0,124,9,2,0,1,0,83, + 0,113,52,124,7,2,0,1,0,83,0,113,52,100,1,83, + 0,41,4,122,21,70,105,110,100,32,97,32,109,111,100,117, + 108,101,39,115,32,115,112,101,99,46,78,122,53,115,121,115, + 46,109,101,116,97,95,112,97,116,104,32,105,115,32,78,111, + 110,101,44,32,80,121,116,104,111,110,32,105,115,32,108,105, + 107,101,108,121,32,115,104,117,116,116,105,110,103,32,100,111, + 119,110,122,22,115,121,115,46,109,101,116,97,95,112,97,116, + 104,32,105,115,32,101,109,112,116,121,41,12,114,15,0,0, + 0,218,9,109,101,116,97,95,112,97,116,104,114,80,0,0, + 0,218,9,95,119,97,114,110,105,110,103,115,218,4,119,97, + 114,110,218,13,73,109,112,111,114,116,87,97,114,110,105,110, + 103,114,93,0,0,0,114,180,0,0,0,114,168,0,0,0, + 114,107,0,0,0,114,191,0,0,0,114,106,0,0,0,41, + 10,114,17,0,0,0,114,166,0,0,0,114,167,0,0,0, + 114,192,0,0,0,90,9,105,115,95,114,101,108,111,97,100, + 114,190,0,0,0,114,168,0,0,0,114,96,0,0,0,114, + 97,0,0,0,114,106,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,10,95,102,105,110,100,95, + 115,112,101,99,133,3,0,0,115,54,0,0,0,0,2,6, + 1,8,2,8,3,4,1,12,5,10,1,8,1,8,1,2, + 1,10,1,12,1,12,1,8,1,22,2,42,1,8,2,18, + 1,10,1,2,1,10,1,12,4,14,2,10,1,8,2,10, + 2,10,2,114,196,0,0,0,99,3,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,5,0,0,0,67,0,0, + 0,115,108,0,0,0,116,0,124,0,116,1,131,2,115,28, + 116,2,100,1,160,3,116,4,124,0,131,1,161,1,131,1, + 130,1,124,2,100,2,107,0,114,44,116,5,100,3,131,1, + 130,1,124,2,100,2,107,4,114,84,116,0,124,1,116,1, + 131,2,115,72,116,2,100,4,131,1,130,1,110,12,124,1, + 115,84,116,6,100,5,131,1,130,1,124,0,115,104,124,2, + 100,2,107,2,114,104,116,5,100,6,131,1,130,1,100,7, + 83,0,41,8,122,28,86,101,114,105,102,121,32,97,114,103, + 117,109,101,110,116,115,32,97,114,101,32,34,115,97,110,101, + 34,46,122,31,109,111,100,117,108,101,32,110,97,109,101,32, + 109,117,115,116,32,98,101,32,115,116,114,44,32,110,111,116, + 32,123,125,114,22,0,0,0,122,18,108,101,118,101,108,32, + 109,117,115,116,32,98,101,32,62,61,32,48,122,31,95,95, + 112,97,99,107,97,103,101,95,95,32,110,111,116,32,115,101, + 116,32,116,111,32,97,32,115,116,114,105,110,103,122,54,97, + 116,116,101,109,112,116,101,100,32,114,101,108,97,116,105,118, + 101,32,105,109,112,111,114,116,32,119,105,116,104,32,110,111, + 32,107,110,111,119,110,32,112,97,114,101,110,116,32,112,97, + 99,107,97,103,101,122,17,69,109,112,116,121,32,109,111,100, + 117,108,101,32,110,97,109,101,78,41,7,218,10,105,115,105, + 110,115,116,97,110,99,101,218,3,115,116,114,218,9,84,121, + 112,101,69,114,114,111,114,114,46,0,0,0,114,14,0,0, + 0,218,10,86,97,108,117,101,69,114,114,111,114,114,80,0, + 0,0,169,3,114,17,0,0,0,114,187,0,0,0,114,188, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,13,95,115,97,110,105,116,121,95,99,104,101,99, + 107,180,3,0,0,115,22,0,0,0,0,2,10,1,18,1, + 8,1,8,1,8,1,10,1,10,1,4,1,8,2,12,1, + 114,202,0,0,0,122,16,78,111,32,109,111,100,117,108,101, + 32,110,97,109,101,100,32,122,4,123,33,114,125,99,2,0, + 0,0,0,0,0,0,0,0,0,0,9,0,0,0,8,0, + 0,0,67,0,0,0,115,22,1,0,0,100,0,125,2,124, + 0,160,0,100,1,161,1,100,2,25,0,125,3,124,3,114, + 132,124,3,116,1,106,2,118,1,114,42,116,3,124,1,124, + 3,131,2,1,0,124,0,116,1,106,2,118,0,114,62,116, + 1,106,2,124,0,25,0,83,0,116,1,106,2,124,3,25, + 0,125,4,122,10,124,4,106,4,125,2,87,0,110,48,4, + 0,116,5,121,130,1,0,1,0,1,0,116,6,100,3,23, + 0,160,7,124,0,124,3,161,2,125,5,116,8,124,5,124, + 0,100,4,141,2,100,0,130,2,89,0,110,2,48,0,116, + 9,124,0,124,2,131,2,125,6,124,6,100,0,117,0,114, + 170,116,8,116,6,160,7,124,0,161,1,124,0,100,4,141, + 2,130,1,110,8,116,10,124,6,131,1,125,7,124,3,144, + 1,114,18,116,1,106,2,124,3,25,0,125,4,124,0,160, + 0,100,1,161,1,100,5,25,0,125,8,122,16,116,11,124, + 4,124,8,124,7,131,3,1,0,87,0,110,48,4,0,116, + 5,144,1,121,16,1,0,1,0,1,0,100,6,124,3,155, + 2,100,7,124,8,155,2,157,4,125,5,116,12,160,13,124, + 5,116,14,161,2,1,0,89,0,110,2,48,0,124,7,83, + 0,41,8,78,114,129,0,0,0,114,22,0,0,0,122,23, + 59,32,123,33,114,125,32,105,115,32,110,111,116,32,97,32, + 112,97,99,107,97,103,101,114,16,0,0,0,233,2,0,0, + 0,122,27,67,97,110,110,111,116,32,115,101,116,32,97,110, + 32,97,116,116,114,105,98,117,116,101,32,111,110,32,122,18, + 32,102,111,114,32,99,104,105,108,100,32,109,111,100,117,108, + 101,32,41,15,114,130,0,0,0,114,15,0,0,0,114,93, + 0,0,0,114,68,0,0,0,114,142,0,0,0,114,107,0, + 0,0,218,8,95,69,82,82,95,77,83,71,114,46,0,0, + 0,218,19,77,111,100,117,108,101,78,111,116,70,111,117,110, + 100,69,114,114,111,114,114,196,0,0,0,114,160,0,0,0, + 114,5,0,0,0,114,193,0,0,0,114,194,0,0,0,114, + 195,0,0,0,41,9,114,17,0,0,0,218,7,105,109,112, + 111,114,116,95,114,166,0,0,0,114,131,0,0,0,90,13, + 112,97,114,101,110,116,95,109,111,100,117,108,101,114,158,0, + 0,0,114,96,0,0,0,114,97,0,0,0,90,5,99,104, + 105,108,100,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,23,95,102,105,110,100,95,97,110,100,95,108,111, + 97,100,95,117,110,108,111,99,107,101,100,199,3,0,0,115, + 52,0,0,0,0,1,4,1,14,1,4,1,10,1,10,2, + 10,1,10,1,10,1,2,1,10,1,12,1,16,1,20,1, + 10,1,8,1,20,2,8,1,6,2,10,1,14,1,2,1, + 16,1,14,1,16,1,18,1,114,207,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,4,0,0,0,8,0, + 0,0,67,0,0,0,115,128,0,0,0,116,0,124,0,131, + 1,143,62,1,0,116,1,106,2,160,3,124,0,116,4,161, + 2,125,2,124,2,116,4,117,0,114,56,116,5,124,0,124, + 1,131,2,87,0,2,0,100,1,4,0,4,0,131,3,1, + 0,83,0,87,0,100,1,4,0,4,0,131,3,1,0,110, + 16,49,0,115,76,48,0,1,0,1,0,1,0,89,0,1, + 0,124,2,100,1,117,0,114,116,100,2,160,6,124,0,161, + 1,125,3,116,7,124,3,124,0,100,3,141,2,130,1,116, + 8,124,0,131,1,1,0,124,2,83,0,41,4,122,25,70, + 105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,101, + 32,109,111,100,117,108,101,46,78,122,40,105,109,112,111,114, + 116,32,111,102,32,123,125,32,104,97,108,116,101,100,59,32, + 78,111,110,101,32,105,110,32,115,121,115,46,109,111,100,117, + 108,101,115,114,16,0,0,0,41,9,114,51,0,0,0,114, + 15,0,0,0,114,93,0,0,0,114,35,0,0,0,218,14, + 95,78,69,69,68,83,95,76,79,65,68,73,78,71,114,207, + 0,0,0,114,46,0,0,0,114,205,0,0,0,114,66,0, + 0,0,41,4,114,17,0,0,0,114,206,0,0,0,114,97, + 0,0,0,114,76,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,14,95,102,105,110,100,95,97, + 110,100,95,108,111,97,100,234,3,0,0,115,22,0,0,0, + 0,2,10,1,14,1,8,1,54,2,8,1,4,1,2,255, + 4,2,12,2,8,1,114,209,0,0,0,114,22,0,0,0, + 99,3,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,4,0,0,0,67,0,0,0,115,42,0,0,0,116,0, + 124,0,124,1,124,2,131,3,1,0,124,2,100,1,107,4, + 114,32,116,1,124,0,124,1,124,2,131,3,125,0,116,2, + 124,0,116,3,131,2,83,0,41,2,97,50,1,0,0,73, + 109,112,111,114,116,32,97,110,100,32,114,101,116,117,114,110, + 32,116,104,101,32,109,111,100,117,108,101,32,98,97,115,101, + 100,32,111,110,32,105,116,115,32,110,97,109,101,44,32,116, + 104,101,32,112,97,99,107,97,103,101,32,116,104,101,32,99, + 97,108,108,32,105,115,10,32,32,32,32,98,101,105,110,103, + 32,109,97,100,101,32,102,114,111,109,44,32,97,110,100,32, + 116,104,101,32,108,101,118,101,108,32,97,100,106,117,115,116, + 109,101,110,116,46,10,10,32,32,32,32,84,104,105,115,32, + 102,117,110,99,116,105,111,110,32,114,101,112,114,101,115,101, + 110,116,115,32,116,104,101,32,103,114,101,97,116,101,115,116, + 32,99,111,109,109,111,110,32,100,101,110,111,109,105,110,97, + 116,111,114,32,111,102,32,102,117,110,99,116,105,111,110,97, + 108,105,116,121,10,32,32,32,32,98,101,116,119,101,101,110, + 32,105,109,112,111,114,116,95,109,111,100,117,108,101,32,97, + 110,100,32,95,95,105,109,112,111,114,116,95,95,46,32,84, + 104,105,115,32,105,110,99,108,117,100,101,115,32,115,101,116, + 116,105,110,103,32,95,95,112,97,99,107,97,103,101,95,95, + 32,105,102,10,32,32,32,32,116,104,101,32,108,111,97,100, + 101,114,32,100,105,100,32,110,111,116,46,10,10,32,32,32, + 32,114,22,0,0,0,41,4,114,202,0,0,0,114,189,0, + 0,0,114,209,0,0,0,218,11,95,103,99,100,95,105,109, + 112,111,114,116,114,201,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,210,0,0,0,250,3,0, + 0,115,8,0,0,0,0,9,12,1,8,1,12,1,114,210, + 0,0,0,169,1,218,9,114,101,99,117,114,115,105,118,101, + 99,3,0,0,0,0,0,0,0,1,0,0,0,8,0,0, + 0,11,0,0,0,67,0,0,0,115,232,0,0,0,124,1, + 68,0,93,222,125,4,116,0,124,4,116,1,131,2,115,66, + 124,3,114,34,124,0,106,2,100,1,23,0,125,5,110,4, + 100,2,125,5,116,3,100,3,124,5,155,0,100,4,116,4, + 124,4,131,1,106,2,155,0,157,4,131,1,130,1,113,4, + 124,4,100,5,107,2,114,108,124,3,115,226,116,5,124,0, + 100,6,131,2,114,226,116,6,124,0,124,0,106,7,124,2, + 100,7,100,8,141,4,1,0,113,4,116,5,124,0,124,4, + 131,2,115,4,100,9,160,8,124,0,106,2,124,4,161,2, + 125,6,122,14,116,9,124,2,124,6,131,2,1,0,87,0, + 113,4,4,0,116,10,121,224,1,0,125,7,1,0,122,54, + 124,7,106,11,124,6,107,2,114,202,116,12,106,13,160,14, + 124,6,116,15,161,2,100,10,117,1,114,202,87,0,89,0, + 100,10,125,7,126,7,113,4,130,0,87,0,89,0,100,10, + 125,7,126,7,113,4,100,10,125,7,126,7,48,0,48,0, + 113,4,124,0,83,0,41,11,122,238,70,105,103,117,114,101, + 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111, + 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117, + 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112, + 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105, + 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105, + 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109, + 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32, + 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115, + 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99, + 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105, + 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103, + 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32, + 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101, + 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108, + 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, + 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, + 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, + 1,42,218,7,95,95,97,108,108,95,95,84,114,211,0,0, + 0,114,184,0,0,0,78,41,16,114,197,0,0,0,114,198, + 0,0,0,114,1,0,0,0,114,199,0,0,0,114,14,0, + 0,0,114,4,0,0,0,218,16,95,104,97,110,100,108,101, + 95,102,114,111,109,108,105,115,116,114,214,0,0,0,114,46, + 0,0,0,114,68,0,0,0,114,205,0,0,0,114,17,0, + 0,0,114,15,0,0,0,114,93,0,0,0,114,35,0,0, + 0,114,208,0,0,0,41,8,114,97,0,0,0,218,8,102, + 114,111,109,108,105,115,116,114,206,0,0,0,114,212,0,0, + 0,218,1,120,90,5,119,104,101,114,101,90,9,102,114,111, + 109,95,110,97,109,101,90,3,101,120,99,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,215,0,0,0,9, + 4,0,0,115,48,0,0,0,0,10,8,1,10,1,4,1, + 12,2,4,1,10,1,8,255,10,2,8,1,14,1,10,1, + 2,255,8,2,10,1,14,1,2,1,14,1,14,4,10,1, + 16,255,2,2,12,1,26,1,114,215,0,0,0,99,1,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,6,0, + 0,0,67,0,0,0,115,146,0,0,0,124,0,160,0,100, + 1,161,1,125,1,124,0,160,0,100,2,161,1,125,2,124, + 1,100,3,117,1,114,82,124,2,100,3,117,1,114,78,124, + 1,124,2,106,1,107,3,114,78,116,2,106,3,100,4,124, + 1,155,2,100,5,124,2,106,1,155,2,100,6,157,5,116, + 4,100,7,100,8,141,3,1,0,124,1,83,0,124,2,100, + 3,117,1,114,96,124,2,106,1,83,0,116,2,106,3,100, + 9,116,4,100,7,100,8,141,3,1,0,124,0,100,10,25, + 0,125,1,100,11,124,0,118,1,114,142,124,1,160,5,100, + 12,161,1,100,13,25,0,125,1,124,1,83,0,41,14,122, + 167,67,97,108,99,117,108,97,116,101,32,119,104,97,116,32, + 95,95,112,97,99,107,97,103,101,95,95,32,115,104,111,117, + 108,100,32,98,101,46,10,10,32,32,32,32,95,95,112,97, + 99,107,97,103,101,95,95,32,105,115,32,110,111,116,32,103, + 117,97,114,97,110,116,101,101,100,32,116,111,32,98,101,32, + 100,101,102,105,110,101,100,32,111,114,32,99,111,117,108,100, + 32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,10, + 32,32,32,32,116,111,32,114,101,112,114,101,115,101,110,116, + 32,116,104,97,116,32,105,116,115,32,112,114,111,112,101,114, + 32,118,97,108,117,101,32,105,115,32,117,110,107,110,111,119, + 110,46,10,10,32,32,32,32,114,146,0,0,0,114,106,0, + 0,0,78,122,32,95,95,112,97,99,107,97,103,101,95,95, + 32,33,61,32,95,95,115,112,101,99,95,95,46,112,97,114, + 101,110,116,32,40,122,4,32,33,61,32,250,1,41,233,3, + 0,0,0,41,1,90,10,115,116,97,99,107,108,101,118,101, + 108,122,89,99,97,110,39,116,32,114,101,115,111,108,118,101, + 32,112,97,99,107,97,103,101,32,102,114,111,109,32,95,95, + 115,112,101,99,95,95,32,111,114,32,95,95,112,97,99,107, + 97,103,101,95,95,44,32,102,97,108,108,105,110,103,32,98, + 97,99,107,32,111,110,32,95,95,110,97,109,101,95,95,32, + 97,110,100,32,95,95,112,97,116,104,95,95,114,1,0,0, + 0,114,142,0,0,0,114,129,0,0,0,114,22,0,0,0, + 41,6,114,35,0,0,0,114,131,0,0,0,114,193,0,0, + 0,114,194,0,0,0,114,195,0,0,0,114,130,0,0,0, + 41,3,218,7,103,108,111,98,97,108,115,114,187,0,0,0, + 114,96,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,17,95,99,97,108,99,95,95,95,112,97, + 99,107,97,103,101,95,95,46,4,0,0,115,42,0,0,0, + 0,7,10,1,10,1,8,1,18,1,6,1,2,255,4,1, + 4,255,6,2,4,254,6,3,4,1,8,1,6,2,6,2, + 4,254,6,3,8,1,8,1,14,1,114,221,0,0,0,114, + 10,0,0,0,99,5,0,0,0,0,0,0,0,0,0,0, + 0,9,0,0,0,5,0,0,0,67,0,0,0,115,180,0, + 0,0,124,4,100,1,107,2,114,18,116,0,124,0,131,1, + 125,5,110,36,124,1,100,2,117,1,114,30,124,1,110,2, + 105,0,125,6,116,1,124,6,131,1,125,7,116,0,124,0, + 124,7,124,4,131,3,125,5,124,3,115,150,124,4,100,1, + 107,2,114,84,116,0,124,0,160,2,100,3,161,1,100,1, + 25,0,131,1,83,0,124,0,115,92,124,5,83,0,116,3, + 124,0,131,1,116,3,124,0,160,2,100,3,161,1,100,1, + 25,0,131,1,24,0,125,8,116,4,106,5,124,5,106,6, + 100,2,116,3,124,5,106,6,131,1,124,8,24,0,133,2, + 25,0,25,0,83,0,110,26,116,7,124,5,100,4,131,2, + 114,172,116,8,124,5,124,3,116,0,131,3,83,0,124,5, + 83,0,100,2,83,0,41,5,97,215,1,0,0,73,109,112, + 111,114,116,32,97,32,109,111,100,117,108,101,46,10,10,32, + 32,32,32,84,104,101,32,39,103,108,111,98,97,108,115,39, + 32,97,114,103,117,109,101,110,116,32,105,115,32,117,115,101, + 100,32,116,111,32,105,110,102,101,114,32,119,104,101,114,101, + 32,116,104,101,32,105,109,112,111,114,116,32,105,115,32,111, + 99,99,117,114,114,105,110,103,32,102,114,111,109,10,32,32, + 32,32,116,111,32,104,97,110,100,108,101,32,114,101,108,97, + 116,105,118,101,32,105,109,112,111,114,116,115,46,32,84,104, + 101,32,39,108,111,99,97,108,115,39,32,97,114,103,117,109, + 101,110,116,32,105,115,32,105,103,110,111,114,101,100,46,32, + 84,104,101,10,32,32,32,32,39,102,114,111,109,108,105,115, + 116,39,32,97,114,103,117,109,101,110,116,32,115,112,101,99, + 105,102,105,101,115,32,119,104,97,116,32,115,104,111,117,108, + 100,32,101,120,105,115,116,32,97,115,32,97,116,116,114,105, + 98,117,116,101,115,32,111,110,32,116,104,101,32,109,111,100, + 117,108,101,10,32,32,32,32,98,101,105,110,103,32,105,109, + 112,111,114,116,101,100,32,40,101,46,103,46,32,96,96,102, + 114,111,109,32,109,111,100,117,108,101,32,105,109,112,111,114, + 116,32,60,102,114,111,109,108,105,115,116,62,96,96,41,46, + 32,32,84,104,101,32,39,108,101,118,101,108,39,10,32,32, + 32,32,97,114,103,117,109,101,110,116,32,114,101,112,114,101, + 115,101,110,116,115,32,116,104,101,32,112,97,99,107,97,103, + 101,32,108,111,99,97,116,105,111,110,32,116,111,32,105,109, + 112,111,114,116,32,102,114,111,109,32,105,110,32,97,32,114, + 101,108,97,116,105,118,101,10,32,32,32,32,105,109,112,111, + 114,116,32,40,101,46,103,46,32,96,96,102,114,111,109,32, + 46,46,112,107,103,32,105,109,112,111,114,116,32,109,111,100, + 96,96,32,119,111,117,108,100,32,104,97,118,101,32,97,32, + 39,108,101,118,101,108,39,32,111,102,32,50,41,46,10,10, + 32,32,32,32,114,22,0,0,0,78,114,129,0,0,0,114, + 142,0,0,0,41,9,114,210,0,0,0,114,221,0,0,0, + 218,9,112,97,114,116,105,116,105,111,110,114,186,0,0,0, + 114,15,0,0,0,114,93,0,0,0,114,1,0,0,0,114, + 4,0,0,0,114,215,0,0,0,41,9,114,17,0,0,0, + 114,220,0,0,0,218,6,108,111,99,97,108,115,114,216,0, + 0,0,114,188,0,0,0,114,97,0,0,0,90,8,103,108, + 111,98,97,108,115,95,114,187,0,0,0,90,7,99,117,116, + 95,111,102,102,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,10,95,95,105,109,112,111,114,116,95,95,73, + 4,0,0,115,30,0,0,0,0,11,8,1,10,2,16,1, + 8,1,12,1,4,3,8,1,18,1,4,1,4,4,26,3, + 32,1,10,1,12,2,114,224,0,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,38,0,0,0,116,0,160,1,124,0,161, + 1,125,1,124,1,100,0,117,0,114,30,116,2,100,1,124, + 0,23,0,131,1,130,1,116,3,124,1,131,1,83,0,41, + 2,78,122,25,110,111,32,98,117,105,108,116,45,105,110,32, + 109,111,100,117,108,101,32,110,97,109,101,100,32,41,4,114, + 161,0,0,0,114,168,0,0,0,114,80,0,0,0,114,160, + 0,0,0,41,2,114,17,0,0,0,114,96,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,18, + 95,98,117,105,108,116,105,110,95,102,114,111,109,95,110,97, + 109,101,110,4,0,0,115,8,0,0,0,0,1,10,1,8, + 1,12,1,114,225,0,0,0,99,2,0,0,0,0,0,0, + 0,0,0,0,0,10,0,0,0,5,0,0,0,67,0,0, + 0,115,166,0,0,0,124,1,97,0,124,0,97,1,116,2, + 116,1,131,1,125,2,116,1,106,3,160,4,161,0,68,0, + 93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2, + 114,26,124,3,116,1,106,6,118,0,114,60,116,7,125,5, + 110,18,116,0,160,8,124,3,161,1,114,26,116,9,125,5, + 110,2,113,26,116,10,124,4,124,5,131,2,125,6,116,11, + 124,6,124,4,131,2,1,0,113,26,116,1,106,3,116,12, + 25,0,125,7,100,1,68,0,93,46,125,8,124,8,116,1, + 106,3,118,1,114,138,116,13,124,8,131,1,125,9,110,10, + 116,1,106,3,124,8,25,0,125,9,116,14,124,7,124,8, + 124,9,131,3,1,0,113,114,100,2,83,0,41,3,122,250, + 83,101,116,117,112,32,105,109,112,111,114,116,108,105,98,32, + 98,121,32,105,109,112,111,114,116,105,110,103,32,110,101,101, + 100,101,100,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, + 110,103,32,116,104,101,109,10,32,32,32,32,105,110,116,111, + 32,116,104,101,32,103,108,111,98,97,108,32,110,97,109,101, + 115,112,97,99,101,46,10,10,32,32,32,32,65,115,32,115, + 121,115,32,105,115,32,110,101,101,100,101,100,32,102,111,114, + 32,115,121,115,46,109,111,100,117,108,101,115,32,97,99,99, + 101,115,115,32,97,110,100,32,95,105,109,112,32,105,115,32, + 110,101,101,100,101,100,32,116,111,32,108,111,97,100,32,98, + 117,105,108,116,45,105,110,10,32,32,32,32,109,111,100,117, + 108,101,115,44,32,116,104,111,115,101,32,116,119,111,32,109, + 111,100,117,108,101,115,32,109,117,115,116,32,98,101,32,101, + 120,112,108,105,99,105,116,108,121,32,112,97,115,115,101,100, + 32,105,110,46,10,10,32,32,32,32,41,3,114,23,0,0, + 0,114,193,0,0,0,114,65,0,0,0,78,41,15,114,58, + 0,0,0,114,15,0,0,0,114,14,0,0,0,114,93,0, + 0,0,218,5,105,116,101,109,115,114,197,0,0,0,114,79, + 0,0,0,114,161,0,0,0,114,89,0,0,0,114,175,0, + 0,0,114,143,0,0,0,114,149,0,0,0,114,1,0,0, + 0,114,225,0,0,0,114,5,0,0,0,41,10,218,10,115, + 121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,95, + 109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,116, + 121,112,101,114,17,0,0,0,114,97,0,0,0,114,110,0, + 0,0,114,96,0,0,0,90,11,115,101,108,102,95,109,111, + 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, + 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, + 108,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,6,95,115,101,116,117,112,117,4,0,0,115,36,0, + 0,0,0,9,4,1,4,3,8,1,18,1,10,1,10,1, + 6,1,10,1,6,2,2,1,10,1,12,3,10,1,8,1, + 10,1,10,2,10,1,114,229,0,0,0,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131, + 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116, + 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41, + 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114, + 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110, + 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117, + 108,101,115,78,41,6,114,229,0,0,0,114,15,0,0,0, + 114,192,0,0,0,114,120,0,0,0,114,161,0,0,0,114, + 175,0,0,0,41,2,114,227,0,0,0,114,228,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 8,95,105,110,115,116,97,108,108,152,4,0,0,115,6,0, + 0,0,0,2,10,2,12,1,114,230,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0, + 0,0,67,0,0,0,115,32,0,0,0,100,1,100,2,108, + 0,125,0,124,0,97,1,124,0,160,2,116,3,106,4,116, + 5,25,0,161,1,1,0,100,2,83,0,41,3,122,57,73, + 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, + 32,116,104,97,116,32,114,101,113,117,105,114,101,32,101,120, + 116,101,114,110,97,108,32,102,105,108,101,115,121,115,116,101, + 109,32,97,99,99,101,115,115,114,22,0,0,0,78,41,6, + 218,26,95,102,114,111,122,101,110,95,105,109,112,111,114,116, + 108,105,98,95,101,120,116,101,114,110,97,108,114,127,0,0, + 0,114,230,0,0,0,114,15,0,0,0,114,93,0,0,0, + 114,1,0,0,0,41,1,114,231,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,27,95,105,110, + 115,116,97,108,108,95,101,120,116,101,114,110,97,108,95,105, + 109,112,111,114,116,101,114,115,160,4,0,0,115,6,0,0, + 0,0,3,8,1,4,1,114,232,0,0,0,41,2,78,78, + 41,1,78,41,2,78,114,22,0,0,0,41,4,78,78,114, + 10,0,0,0,114,22,0,0,0,41,50,114,3,0,0,0, + 114,127,0,0,0,114,12,0,0,0,114,18,0,0,0,114, + 60,0,0,0,114,34,0,0,0,114,44,0,0,0,114,19, + 0,0,0,114,20,0,0,0,114,50,0,0,0,114,51,0, + 0,0,114,54,0,0,0,114,66,0,0,0,114,68,0,0, + 0,114,77,0,0,0,114,87,0,0,0,114,91,0,0,0, + 114,98,0,0,0,114,112,0,0,0,114,113,0,0,0,114, + 92,0,0,0,114,143,0,0,0,114,149,0,0,0,114,153, + 0,0,0,114,108,0,0,0,114,94,0,0,0,114,159,0, + 0,0,114,160,0,0,0,114,95,0,0,0,114,161,0,0, + 0,114,175,0,0,0,114,180,0,0,0,114,189,0,0,0, + 114,191,0,0,0,114,196,0,0,0,114,202,0,0,0,90, + 15,95,69,82,82,95,77,83,71,95,80,82,69,70,73,88, + 114,204,0,0,0,114,207,0,0,0,218,6,111,98,106,101, + 99,116,114,208,0,0,0,114,209,0,0,0,114,210,0,0, + 0,114,215,0,0,0,114,221,0,0,0,114,224,0,0,0, + 114,225,0,0,0,114,229,0,0,0,114,230,0,0,0,114, + 232,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,8,60,109,111,100,117,108, + 101,62,1,0,0,0,115,94,0,0,0,4,24,4,2,8, + 8,8,8,4,2,4,3,16,4,14,77,14,21,14,16,8, + 37,8,17,8,11,14,8,8,11,8,12,8,16,8,36,14, + 101,16,26,10,45,14,72,8,17,8,17,8,30,8,37,8, + 42,8,15,14,75,14,79,14,13,8,9,8,9,10,47,8, + 16,4,1,8,2,8,32,6,3,8,16,10,15,14,37,8, + 27,10,37,8,7,8,35,8,8, }; diff --git a/contrib/tools/python3/src/Python/importlib_external.h b/contrib/tools/python3/src/Python/importlib_external.h index aa473900a7..6d40249e9c 100644 --- a/contrib/tools/python3/src/Python/importlib_external.h +++ b/contrib/tools/python3/src/Python/importlib_external.h @@ -1,2825 +1,2825 @@ /* Auto-generated by Programs/_freeze_importlib.c */ -const unsigned char _Py_M__importlib_bootstrap_external[] = { - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,5,0,0,0,64,0,0,0,115,224,2,0,0,100,0, - 90,0,100,1,100,2,108,1,97,1,100,1,100,2,108,2, - 90,2,100,1,100,2,108,3,97,3,100,1,100,2,108,4, - 90,4,100,1,100,2,108,5,90,5,116,3,106,6,100,3, - 107,2,90,7,101,7,114,76,100,1,100,2,108,8,90,9, - 100,1,100,2,108,10,90,10,110,8,100,1,100,2,108,11, - 90,9,101,7,114,98,100,4,100,5,103,2,90,12,110,6, - 100,5,103,1,90,12,101,13,100,6,100,7,132,0,101,12, - 68,0,131,1,131,1,115,126,74,0,130,1,101,12,100,1, - 25,0,90,14,101,15,101,12,131,1,90,16,100,8,160,17, - 101,12,161,1,90,12,100,9,100,10,132,0,101,12,68,0, - 131,1,90,18,100,11,90,19,100,12,90,20,101,20,101,19, - 23,0,90,21,100,13,100,14,132,0,90,22,100,15,100,16, - 132,0,90,23,100,17,100,18,132,0,90,24,100,19,100,20, - 132,0,90,25,101,7,114,228,100,21,100,22,132,0,90,26, - 110,8,100,23,100,22,132,0,90,26,100,24,100,25,132,0, - 90,27,100,26,100,27,132,0,90,28,100,28,100,29,132,0, - 90,29,100,30,100,31,132,0,90,30,100,32,100,33,132,0, - 90,31,101,7,144,1,114,36,100,34,100,35,132,0,90,32, - 110,8,100,36,100,35,132,0,90,32,100,111,100,38,100,39, - 132,1,90,33,101,34,101,33,106,35,131,1,90,36,100,40, - 160,37,100,41,100,42,161,2,100,43,23,0,90,38,101,39, - 160,40,101,38,100,42,161,2,90,41,100,44,90,42,100,45, - 90,43,100,46,103,1,90,44,100,47,103,1,90,45,101,45, - 4,0,90,46,90,47,100,112,100,2,100,48,156,1,100,49, - 100,50,132,3,90,48,100,51,100,52,132,0,90,49,100,53, - 100,54,132,0,90,50,100,55,100,56,132,0,90,51,100,57, - 100,58,132,0,90,52,100,59,100,60,132,0,90,53,100,61, - 100,62,132,0,90,54,100,63,100,64,132,0,90,55,100,65, - 100,66,132,0,90,56,100,67,100,68,132,0,90,57,100,113, - 100,69,100,70,132,1,90,58,100,114,100,71,100,72,132,1, - 90,59,100,115,100,74,100,75,132,1,90,60,100,76,100,77, - 132,0,90,61,101,62,131,0,90,63,100,116,100,2,101,63, - 100,78,156,2,100,79,100,80,132,3,90,64,71,0,100,81, - 100,82,132,0,100,82,131,2,90,65,71,0,100,83,100,84, - 132,0,100,84,131,2,90,66,71,0,100,85,100,86,132,0, - 100,86,101,66,131,3,90,67,71,0,100,87,100,88,132,0, - 100,88,131,2,90,68,71,0,100,89,100,90,132,0,100,90, - 101,68,101,67,131,4,90,69,71,0,100,91,100,92,132,0, - 100,92,101,68,101,66,131,4,90,70,103,0,90,71,71,0, - 100,93,100,94,132,0,100,94,101,68,101,66,131,4,90,72, - 71,0,100,95,100,96,132,0,100,96,131,2,90,73,71,0, - 100,97,100,98,132,0,100,98,131,2,90,74,71,0,100,99, - 100,100,132,0,100,100,131,2,90,75,71,0,100,101,100,102, - 132,0,100,102,131,2,90,76,100,117,100,103,100,104,132,1, - 90,77,100,105,100,106,132,0,90,78,100,107,100,108,132,0, - 90,79,100,109,100,110,132,0,90,80,100,2,83,0,41,118, - 97,94,1,0,0,67,111,114,101,32,105,109,112,108,101,109, - 101,110,116,97,116,105,111,110,32,111,102,32,112,97,116,104, - 45,98,97,115,101,100,32,105,109,112,111,114,116,46,10,10, - 84,104,105,115,32,109,111,100,117,108,101,32,105,115,32,78, - 79,84,32,109,101,97,110,116,32,116,111,32,98,101,32,100, - 105,114,101,99,116,108,121,32,105,109,112,111,114,116,101,100, - 33,32,73,116,32,104,97,115,32,98,101,101,110,32,100,101, - 115,105,103,110,101,100,32,115,117,99,104,10,116,104,97,116, - 32,105,116,32,99,97,110,32,98,101,32,98,111,111,116,115, - 116,114,97,112,112,101,100,32,105,110,116,111,32,80,121,116, - 104,111,110,32,97,115,32,116,104,101,32,105,109,112,108,101, - 109,101,110,116,97,116,105,111,110,32,111,102,32,105,109,112, - 111,114,116,46,32,65,115,10,115,117,99,104,32,105,116,32, - 114,101,113,117,105,114,101,115,32,116,104,101,32,105,110,106, - 101,99,116,105,111,110,32,111,102,32,115,112,101,99,105,102, - 105,99,32,109,111,100,117,108,101,115,32,97,110,100,32,97, - 116,116,114,105,98,117,116,101,115,32,105,110,32,111,114,100, - 101,114,32,116,111,10,119,111,114,107,46,32,79,110,101,32, - 115,104,111,117,108,100,32,117,115,101,32,105,109,112,111,114, - 116,108,105,98,32,97,115,32,116,104,101,32,112,117,98,108, - 105,99,45,102,97,99,105,110,103,32,118,101,114,115,105,111, - 110,32,111,102,32,116,104,105,115,32,109,111,100,117,108,101, - 46,10,10,233,0,0,0,0,78,90,5,119,105,110,51,50, - 250,1,92,250,1,47,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,99,0,0,0,115, - 26,0,0,0,124,0,93,18,125,1,116,0,124,1,131,1, - 100,0,107,2,86,0,1,0,113,2,100,1,83,0,169,2, - 233,1,0,0,0,78,169,1,218,3,108,101,110,169,2,218, - 2,46,48,218,3,115,101,112,169,0,114,10,0,0,0,250, - 38,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108, - 105,98,46,95,98,111,111,116,115,116,114,97,112,95,101,120, - 116,101,114,110,97,108,62,218,9,60,103,101,110,101,120,112, - 114,62,43,0,0,0,243,0,0,0,0,114,12,0,0,0, - 218,0,99,1,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,22,0,0,0, - 104,0,124,0,93,14,125,1,100,0,124,1,155,0,157,2, - 146,2,113,4,83,0,169,1,250,1,58,114,10,0,0,0, - 169,2,114,8,0,0,0,218,1,115,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,9,60,115,101,116,99, - 111,109,112,62,47,0,0,0,114,13,0,0,0,114,19,0, - 0,0,41,1,218,3,119,105,110,41,2,90,6,99,121,103, - 119,105,110,90,6,100,97,114,119,105,110,99,0,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, - 3,0,0,0,115,60,0,0,0,116,0,106,1,160,2,116, - 3,161,1,114,48,116,0,106,1,160,2,116,4,161,1,114, - 30,100,1,137,0,110,4,100,2,137,0,135,0,102,1,100, - 3,100,4,132,8,125,0,110,8,100,5,100,4,132,0,125, - 0,124,0,83,0,41,6,78,90,12,80,89,84,72,79,78, - 67,65,83,69,79,75,115,12,0,0,0,80,89,84,72,79, - 78,67,65,83,69,79,75,99,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,19,0,0,0, - 115,20,0,0,0,116,0,106,1,106,2,12,0,111,18,136, - 0,116,3,106,4,118,0,83,0,41,1,122,94,84,114,117, - 101,32,105,102,32,102,105,108,101,110,97,109,101,115,32,109, - 117,115,116,32,98,101,32,99,104,101,99,107,101,100,32,99, - 97,115,101,45,105,110,115,101,110,115,105,116,105,118,101,108, - 121,32,97,110,100,32,105,103,110,111,114,101,32,101,110,118, - 105,114,111,110,109,101,110,116,32,102,108,97,103,115,32,97, - 114,101,32,110,111,116,32,115,101,116,46,41,5,218,3,115, - 121,115,218,5,102,108,97,103,115,218,18,105,103,110,111,114, - 101,95,101,110,118,105,114,111,110,109,101,110,116,218,3,95, - 111,115,90,7,101,110,118,105,114,111,110,114,10,0,0,0, - 169,1,218,3,107,101,121,114,10,0,0,0,114,11,0,0, - 0,218,11,95,114,101,108,97,120,95,99,97,115,101,64,0, - 0,0,115,2,0,0,0,0,2,122,37,95,109,97,107,101, - 95,114,101,108,97,120,95,99,97,115,101,46,60,108,111,99, - 97,108,115,62,46,95,114,101,108,97,120,95,99,97,115,101, - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,1,0,0,0,83,0,0,0,115,4,0,0,0,100,1, - 83,0,41,2,122,53,84,114,117,101,32,105,102,32,102,105, - 108,101,110,97,109,101,115,32,109,117,115,116,32,98,101,32, - 99,104,101,99,107,101,100,32,99,97,115,101,45,105,110,115, - 101,110,115,105,116,105,118,101,108,121,46,70,114,10,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,27,0,0,0,68,0,0,0,115,2, - 0,0,0,0,2,41,5,114,21,0,0,0,218,8,112,108, - 97,116,102,111,114,109,218,10,115,116,97,114,116,115,119,105, - 116,104,218,27,95,67,65,83,69,95,73,78,83,69,78,83, - 73,84,73,86,69,95,80,76,65,84,70,79,82,77,83,218, - 35,95,67,65,83,69,95,73,78,83,69,78,83,73,84,73, - 86,69,95,80,76,65,84,70,79,82,77,83,95,83,84,82, - 95,75,69,89,41,1,114,27,0,0,0,114,10,0,0,0, - 114,25,0,0,0,114,11,0,0,0,218,16,95,109,97,107, - 101,95,114,101,108,97,120,95,99,97,115,101,57,0,0,0, - 115,14,0,0,0,0,1,12,1,12,1,6,2,4,2,14, - 4,8,3,114,32,0,0,0,99,1,0,0,0,0,0,0, - 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, - 0,115,20,0,0,0,116,0,124,0,131,1,100,1,64,0, - 160,1,100,2,100,3,161,2,83,0,41,4,122,42,67,111, - 110,118,101,114,116,32,97,32,51,50,45,98,105,116,32,105, - 110,116,101,103,101,114,32,116,111,32,108,105,116,116,108,101, - 45,101,110,100,105,97,110,46,236,3,0,0,0,255,127,255, - 127,3,0,233,4,0,0,0,218,6,108,105,116,116,108,101, - 41,2,218,3,105,110,116,218,8,116,111,95,98,121,116,101, - 115,41,1,218,1,120,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,12,95,112,97,99,107,95,117,105,110, - 116,51,50,74,0,0,0,115,2,0,0,0,0,2,114,39, - 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 1,0,0,0,4,0,0,0,67,0,0,0,115,28,0,0, - 0,116,0,124,0,131,1,100,1,107,2,115,16,74,0,130, - 1,116,1,160,2,124,0,100,2,161,2,83,0,41,3,122, - 47,67,111,110,118,101,114,116,32,52,32,98,121,116,101,115, - 32,105,110,32,108,105,116,116,108,101,45,101,110,100,105,97, - 110,32,116,111,32,97,110,32,105,110,116,101,103,101,114,46, - 114,34,0,0,0,114,35,0,0,0,169,3,114,6,0,0, - 0,114,36,0,0,0,218,10,102,114,111,109,95,98,121,116, - 101,115,169,1,218,4,100,97,116,97,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,14,95,117,110,112,97, - 99,107,95,117,105,110,116,51,50,79,0,0,0,115,4,0, - 0,0,0,2,16,1,114,44,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0, - 67,0,0,0,115,28,0,0,0,116,0,124,0,131,1,100, - 1,107,2,115,16,74,0,130,1,116,1,160,2,124,0,100, - 2,161,2,83,0,41,3,122,47,67,111,110,118,101,114,116, - 32,50,32,98,121,116,101,115,32,105,110,32,108,105,116,116, - 108,101,45,101,110,100,105,97,110,32,116,111,32,97,110,32, - 105,110,116,101,103,101,114,46,233,2,0,0,0,114,35,0, - 0,0,114,40,0,0,0,114,42,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,14,95,117,110, - 112,97,99,107,95,117,105,110,116,49,54,84,0,0,0,115, - 4,0,0,0,0,2,16,1,114,46,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0, - 0,0,71,0,0,0,115,228,0,0,0,124,0,115,8,100, - 1,83,0,116,0,124,0,131,1,100,2,107,2,114,28,124, - 0,100,3,25,0,83,0,100,1,125,1,103,0,125,2,116, - 1,116,2,106,3,124,0,131,2,68,0,93,122,92,2,125, - 3,125,4,124,3,160,4,116,5,161,1,115,76,124,3,160, - 6,116,5,161,1,114,102,124,3,160,7,116,8,161,1,112, - 88,124,1,125,1,116,9,124,4,23,0,103,1,125,2,113, - 48,124,3,160,6,100,4,161,1,114,152,124,1,160,10,161, - 0,124,3,160,10,161,0,107,3,114,140,124,3,125,1,124, - 4,103,1,125,2,113,170,124,2,160,11,124,4,161,1,1, - 0,113,48,124,3,112,158,124,1,125,1,124,2,160,11,124, - 4,161,1,1,0,113,48,100,5,100,6,132,0,124,2,68, - 0,131,1,125,2,116,0,124,2,131,1,100,2,107,2,114, - 214,124,2,100,3,25,0,115,214,124,1,116,9,23,0,83, - 0,124,1,116,9,160,12,124,2,161,1,23,0,83,0,41, - 7,250,31,82,101,112,108,97,99,101,109,101,110,116,32,102, - 111,114,32,111,115,46,112,97,116,104,46,106,111,105,110,40, - 41,46,114,14,0,0,0,114,4,0,0,0,114,0,0,0, - 0,114,16,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,5,0,0,0,83,0,0,0,115, - 26,0,0,0,103,0,124,0,93,18,125,1,124,1,114,4, - 124,1,160,0,116,1,161,1,145,2,113,4,83,0,114,10, - 0,0,0,169,2,218,6,114,115,116,114,105,112,218,15,112, - 97,116,104,95,115,101,112,97,114,97,116,111,114,115,169,2, - 114,8,0,0,0,218,1,112,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,10,60,108,105,115,116,99,111, - 109,112,62,114,0,0,0,114,13,0,0,0,250,30,95,112, - 97,116,104,95,106,111,105,110,46,60,108,111,99,97,108,115, - 62,46,60,108,105,115,116,99,111,109,112,62,41,13,114,6, - 0,0,0,218,3,109,97,112,114,24,0,0,0,218,15,95, - 112,97,116,104,95,115,112,108,105,116,114,111,111,116,114,29, - 0,0,0,218,14,112,97,116,104,95,115,101,112,95,116,117, - 112,108,101,218,8,101,110,100,115,119,105,116,104,114,49,0, - 0,0,114,50,0,0,0,218,8,112,97,116,104,95,115,101, - 112,218,8,99,97,115,101,102,111,108,100,218,6,97,112,112, - 101,110,100,218,4,106,111,105,110,41,5,218,10,112,97,116, - 104,95,112,97,114,116,115,218,4,114,111,111,116,218,4,112, - 97,116,104,90,8,110,101,119,95,114,111,111,116,218,4,116, - 97,105,108,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,10,95,112,97,116,104,95,106,111,105,110,91,0, - 0,0,115,42,0,0,0,0,2,4,1,4,1,12,1,8, - 1,4,1,4,1,20,1,20,1,14,1,12,1,10,1,16, - 3,4,1,8,2,12,2,8,1,12,1,14,1,20,2,8, - 1,114,67,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,4,0,0,0,71,0,0,0,115, - 20,0,0,0,116,0,160,1,100,1,100,2,132,0,124,0, - 68,0,131,1,161,1,83,0,41,3,114,47,0,0,0,99, - 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 5,0,0,0,83,0,0,0,115,26,0,0,0,103,0,124, - 0,93,18,125,1,124,1,114,4,124,1,160,0,116,1,161, - 1,145,2,113,4,83,0,114,10,0,0,0,114,48,0,0, - 0,41,2,114,8,0,0,0,218,4,112,97,114,116,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,53,0, - 0,0,123,0,0,0,115,4,0,0,0,6,1,6,255,114, - 54,0,0,0,41,2,114,59,0,0,0,114,62,0,0,0, - 41,1,114,63,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,67,0,0,0,121,0,0,0,115, - 6,0,0,0,0,2,10,1,2,255,99,1,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,3, - 0,0,0,115,66,0,0,0,116,0,135,0,102,1,100,1, - 100,2,132,8,116,1,68,0,131,1,131,1,125,1,124,1, - 100,3,107,0,114,38,100,4,136,0,102,2,83,0,136,0, - 100,5,124,1,133,2,25,0,136,0,124,1,100,6,23,0, - 100,5,133,2,25,0,102,2,83,0,41,7,122,32,82,101, - 112,108,97,99,101,109,101,110,116,32,102,111,114,32,111,115, - 46,112,97,116,104,46,115,112,108,105,116,40,41,46,99,1, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,51,0,0,0,115,24,0,0,0,124,0,93,16, - 125,1,136,0,160,0,124,1,161,1,86,0,1,0,113,2, - 100,0,83,0,169,1,78,41,1,218,5,114,102,105,110,100, - 114,51,0,0,0,169,1,114,65,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,12,0,0,0,129,0,0,0,114, - 13,0,0,0,122,30,95,112,97,116,104,95,115,112,108,105, - 116,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101, - 120,112,114,62,114,0,0,0,0,114,14,0,0,0,78,114, - 4,0,0,0,41,2,218,3,109,97,120,114,50,0,0,0, - 41,2,114,65,0,0,0,218,1,105,114,10,0,0,0,114, - 71,0,0,0,114,11,0,0,0,218,11,95,112,97,116,104, - 95,115,112,108,105,116,127,0,0,0,115,8,0,0,0,0, - 2,22,1,8,1,8,1,114,74,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,10,0,0,0,116,0,160,1,124,0, - 161,1,83,0,41,1,122,126,83,116,97,116,32,116,104,101, - 32,112,97,116,104,46,10,10,32,32,32,32,77,97,100,101, - 32,97,32,115,101,112,97,114,97,116,101,32,102,117,110,99, - 116,105,111,110,32,116,111,32,109,97,107,101,32,105,116,32, - 101,97,115,105,101,114,32,116,111,32,111,118,101,114,114,105, - 100,101,32,105,110,32,101,120,112,101,114,105,109,101,110,116, - 115,10,32,32,32,32,40,101,46,103,46,32,99,97,99,104, - 101,32,115,116,97,116,32,114,101,115,117,108,116,115,41,46, - 10,10,32,32,32,32,41,2,114,24,0,0,0,90,4,115, - 116,97,116,114,71,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,10,95,112,97,116,104,95,115, - 116,97,116,135,0,0,0,115,2,0,0,0,0,7,114,75, - 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,8,0,0,0,67,0,0,0,115,48,0,0, - 0,122,12,116,0,124,0,131,1,125,2,87,0,110,20,4, - 0,116,1,121,32,1,0,1,0,1,0,89,0,100,1,83, - 0,48,0,124,2,106,2,100,2,64,0,124,1,107,2,83, - 0,41,3,122,49,84,101,115,116,32,119,104,101,116,104,101, - 114,32,116,104,101,32,112,97,116,104,32,105,115,32,116,104, - 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,101, - 32,116,121,112,101,46,70,105,0,240,0,0,41,3,114,75, - 0,0,0,218,7,79,83,69,114,114,111,114,218,7,115,116, - 95,109,111,100,101,41,3,114,65,0,0,0,218,4,109,111, - 100,101,90,9,115,116,97,116,95,105,110,102,111,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,18,95,112, - 97,116,104,95,105,115,95,109,111,100,101,95,116,121,112,101, - 145,0,0,0,115,10,0,0,0,0,2,2,1,12,1,12, - 1,8,1,114,79,0,0,0,99,1,0,0,0,0,0,0, - 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, - 0,115,10,0,0,0,116,0,124,0,100,1,131,2,83,0, - 41,2,122,31,82,101,112,108,97,99,101,109,101,110,116,32, - 102,111,114,32,111,115,46,112,97,116,104,46,105,115,102,105, - 108,101,46,105,0,128,0,0,41,1,114,79,0,0,0,114, - 71,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,12,95,112,97,116,104,95,105,115,102,105,108, - 101,154,0,0,0,115,2,0,0,0,0,2,114,80,0,0, - 0,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, - 0,0,3,0,0,0,67,0,0,0,115,22,0,0,0,124, - 0,115,12,116,0,160,1,161,0,125,0,116,2,124,0,100, - 1,131,2,83,0,41,2,122,30,82,101,112,108,97,99,101, - 109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,104, - 46,105,115,100,105,114,46,105,0,64,0,0,41,3,114,24, - 0,0,0,218,6,103,101,116,99,119,100,114,79,0,0,0, - 114,71,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,11,95,112,97,116,104,95,105,115,100,105, - 114,159,0,0,0,115,6,0,0,0,0,2,4,1,8,1, - 114,82,0,0,0,99,1,0,0,0,0,0,0,0,0,0, - 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,62, - 0,0,0,124,0,115,8,100,1,83,0,116,0,160,1,124, - 0,161,1,100,2,25,0,160,2,100,3,100,4,161,2,125, - 1,116,3,124,1,131,1,100,5,107,4,111,60,124,1,160, - 4,100,6,161,1,112,60,124,1,160,5,100,4,161,1,83, - 0,41,7,250,30,82,101,112,108,97,99,101,109,101,110,116, - 32,102,111,114,32,111,115,46,112,97,116,104,46,105,115,97, - 98,115,46,70,114,0,0,0,0,114,2,0,0,0,114,1, - 0,0,0,114,4,0,0,0,122,2,92,92,41,6,114,24, - 0,0,0,114,56,0,0,0,218,7,114,101,112,108,97,99, - 101,114,6,0,0,0,114,29,0,0,0,114,58,0,0,0, - 41,2,114,65,0,0,0,114,64,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,11,95,112,97, - 116,104,95,105,115,97,98,115,167,0,0,0,115,8,0,0, - 0,0,2,4,1,4,1,22,1,114,85,0,0,0,99,1, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,10,0,0,0,124,0,160,0, - 116,1,161,1,83,0,41,1,114,83,0,0,0,41,2,114, - 29,0,0,0,114,50,0,0,0,114,71,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,85,0, - 0,0,175,0,0,0,115,2,0,0,0,0,2,233,182,1, - 0,0,99,3,0,0,0,0,0,0,0,0,0,0,0,6, - 0,0,0,11,0,0,0,67,0,0,0,115,178,0,0,0, - 100,1,160,0,124,0,116,1,124,0,131,1,161,2,125,3, - 116,2,160,3,124,3,116,2,106,4,116,2,106,5,66,0, - 116,2,106,6,66,0,124,2,100,2,64,0,161,3,125,4, - 122,70,116,7,160,8,124,4,100,3,161,2,143,26,125,5, - 124,5,160,9,124,1,161,1,1,0,87,0,100,4,4,0, - 4,0,131,3,1,0,110,16,49,0,115,94,48,0,1,0, - 1,0,1,0,89,0,1,0,116,2,160,10,124,3,124,0, - 161,2,1,0,87,0,110,54,4,0,116,11,121,172,1,0, - 1,0,1,0,122,14,116,2,160,12,124,3,161,1,1,0, - 87,0,110,18,4,0,116,11,121,164,1,0,1,0,1,0, - 89,0,110,2,48,0,130,0,89,0,110,2,48,0,100,4, - 83,0,41,5,122,162,66,101,115,116,45,101,102,102,111,114, - 116,32,102,117,110,99,116,105,111,110,32,116,111,32,119,114, - 105,116,101,32,100,97,116,97,32,116,111,32,97,32,112,97, - 116,104,32,97,116,111,109,105,99,97,108,108,121,46,10,32, - 32,32,32,66,101,32,112,114,101,112,97,114,101,100,32,116, - 111,32,104,97,110,100,108,101,32,97,32,70,105,108,101,69, - 120,105,115,116,115,69,114,114,111,114,32,105,102,32,99,111, - 110,99,117,114,114,101,110,116,32,119,114,105,116,105,110,103, - 32,111,102,32,116,104,101,10,32,32,32,32,116,101,109,112, - 111,114,97,114,121,32,102,105,108,101,32,105,115,32,97,116, - 116,101,109,112,116,101,100,46,250,5,123,125,46,123,125,114, - 86,0,0,0,90,2,119,98,78,41,13,218,6,102,111,114, - 109,97,116,218,2,105,100,114,24,0,0,0,90,4,111,112, - 101,110,90,6,79,95,69,88,67,76,90,7,79,95,67,82, - 69,65,84,90,8,79,95,87,82,79,78,76,89,218,3,95, - 105,111,218,6,70,105,108,101,73,79,218,5,119,114,105,116, - 101,114,84,0,0,0,114,76,0,0,0,90,6,117,110,108, - 105,110,107,41,6,114,65,0,0,0,114,43,0,0,0,114, - 78,0,0,0,90,8,112,97,116,104,95,116,109,112,90,2, - 102,100,218,4,102,105,108,101,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,13,95,119,114,105,116,101,95, - 97,116,111,109,105,99,180,0,0,0,115,28,0,0,0,0, - 5,16,1,6,1,22,255,4,2,2,3,14,1,40,1,16, - 1,12,1,2,1,14,1,12,1,6,1,114,94,0,0,0, - 105,97,13,0,0,114,45,0,0,0,114,35,0,0,0,115, - 2,0,0,0,13,10,90,11,95,95,112,121,99,97,99,104, - 101,95,95,122,4,111,112,116,45,122,3,46,112,121,122,4, - 46,112,121,99,41,1,218,12,111,112,116,105,109,105,122,97, - 116,105,111,110,99,2,0,0,0,0,0,0,0,1,0,0, - 0,12,0,0,0,5,0,0,0,67,0,0,0,115,88,1, - 0,0,124,1,100,1,117,1,114,52,116,0,160,1,100,2, - 116,2,161,2,1,0,124,2,100,1,117,1,114,40,100,3, - 125,3,116,3,124,3,131,1,130,1,124,1,114,48,100,4, - 110,2,100,5,125,2,116,4,160,5,124,0,161,1,125,0, - 116,6,124,0,131,1,92,2,125,4,125,5,124,5,160,7, - 100,6,161,1,92,3,125,6,125,7,125,8,116,8,106,9, - 106,10,125,9,124,9,100,1,117,0,114,114,116,11,100,7, - 131,1,130,1,100,4,160,12,124,6,114,126,124,6,110,2, - 124,8,124,7,124,9,103,3,161,1,125,10,124,2,100,1, - 117,0,114,172,116,8,106,13,106,14,100,8,107,2,114,164, - 100,4,125,2,110,8,116,8,106,13,106,14,125,2,116,15, - 124,2,131,1,125,2,124,2,100,4,107,3,114,224,124,2, - 160,16,161,0,115,210,116,17,100,9,160,18,124,2,161,1, - 131,1,130,1,100,10,160,18,124,10,116,19,124,2,161,3, - 125,10,124,10,116,20,100,8,25,0,23,0,125,11,116,8, - 106,21,100,1,117,1,144,1,114,76,116,22,124,4,131,1, - 144,1,115,16,116,23,116,4,160,24,161,0,124,4,131,2, - 125,4,124,4,100,5,25,0,100,11,107,2,144,1,114,56, - 124,4,100,8,25,0,116,25,118,1,144,1,114,56,124,4, - 100,12,100,1,133,2,25,0,125,4,116,23,116,8,106,21, - 124,4,160,26,116,25,161,1,124,11,131,3,83,0,116,23, - 124,4,116,27,124,11,131,3,83,0,41,13,97,254,2,0, - 0,71,105,118,101,110,32,116,104,101,32,112,97,116,104,32, - 116,111,32,97,32,46,112,121,32,102,105,108,101,44,32,114, - 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, - 111,32,105,116,115,32,46,112,121,99,32,102,105,108,101,46, - 10,10,32,32,32,32,84,104,101,32,46,112,121,32,102,105, - 108,101,32,100,111,101,115,32,110,111,116,32,110,101,101,100, - 32,116,111,32,101,120,105,115,116,59,32,116,104,105,115,32, - 115,105,109,112,108,121,32,114,101,116,117,114,110,115,32,116, - 104,101,32,112,97,116,104,32,116,111,32,116,104,101,10,32, - 32,32,32,46,112,121,99,32,102,105,108,101,32,99,97,108, - 99,117,108,97,116,101,100,32,97,115,32,105,102,32,116,104, - 101,32,46,112,121,32,102,105,108,101,32,119,101,114,101,32, - 105,109,112,111,114,116,101,100,46,10,10,32,32,32,32,84, - 104,101,32,39,111,112,116,105,109,105,122,97,116,105,111,110, - 39,32,112,97,114,97,109,101,116,101,114,32,99,111,110,116, - 114,111,108,115,32,116,104,101,32,112,114,101,115,117,109,101, - 100,32,111,112,116,105,109,105,122,97,116,105,111,110,32,108, - 101,118,101,108,32,111,102,10,32,32,32,32,116,104,101,32, - 98,121,116,101,99,111,100,101,32,102,105,108,101,46,32,73, - 102,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, - 32,105,115,32,110,111,116,32,78,111,110,101,44,32,116,104, - 101,32,115,116,114,105,110,103,32,114,101,112,114,101,115,101, - 110,116,97,116,105,111,110,10,32,32,32,32,111,102,32,116, - 104,101,32,97,114,103,117,109,101,110,116,32,105,115,32,116, - 97,107,101,110,32,97,110,100,32,118,101,114,105,102,105,101, - 100,32,116,111,32,98,101,32,97,108,112,104,97,110,117,109, - 101,114,105,99,32,40,101,108,115,101,32,86,97,108,117,101, - 69,114,114,111,114,10,32,32,32,32,105,115,32,114,97,105, - 115,101,100,41,46,10,10,32,32,32,32,84,104,101,32,100, - 101,98,117,103,95,111,118,101,114,114,105,100,101,32,112,97, - 114,97,109,101,116,101,114,32,105,115,32,100,101,112,114,101, - 99,97,116,101,100,46,32,73,102,32,100,101,98,117,103,95, - 111,118,101,114,114,105,100,101,32,105,115,32,110,111,116,32, - 78,111,110,101,44,10,32,32,32,32,97,32,84,114,117,101, - 32,118,97,108,117,101,32,105,115,32,116,104,101,32,115,97, - 109,101,32,97,115,32,115,101,116,116,105,110,103,32,39,111, - 112,116,105,109,105,122,97,116,105,111,110,39,32,116,111,32, - 116,104,101,32,101,109,112,116,121,32,115,116,114,105,110,103, - 10,32,32,32,32,119,104,105,108,101,32,97,32,70,97,108, - 115,101,32,118,97,108,117,101,32,105,115,32,101,113,117,105, - 118,97,108,101,110,116,32,116,111,32,115,101,116,116,105,110, - 103,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, - 32,116,111,32,39,49,39,46,10,10,32,32,32,32,73,102, - 32,115,121,115,46,105,109,112,108,101,109,101,110,116,97,116, - 105,111,110,46,99,97,99,104,101,95,116,97,103,32,105,115, - 32,78,111,110,101,32,116,104,101,110,32,78,111,116,73,109, - 112,108,101,109,101,110,116,101,100,69,114,114,111,114,32,105, - 115,32,114,97,105,115,101,100,46,10,10,32,32,32,32,78, - 122,70,116,104,101,32,100,101,98,117,103,95,111,118,101,114, - 114,105,100,101,32,112,97,114,97,109,101,116,101,114,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,59,32,117,115, - 101,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, - 32,105,110,115,116,101,97,100,122,50,100,101,98,117,103,95, - 111,118,101,114,114,105,100,101,32,111,114,32,111,112,116,105, - 109,105,122,97,116,105,111,110,32,109,117,115,116,32,98,101, - 32,115,101,116,32,116,111,32,78,111,110,101,114,14,0,0, - 0,114,4,0,0,0,218,1,46,250,36,115,121,115,46,105, - 109,112,108,101,109,101,110,116,97,116,105,111,110,46,99,97, - 99,104,101,95,116,97,103,32,105,115,32,78,111,110,101,114, - 0,0,0,0,122,24,123,33,114,125,32,105,115,32,110,111, - 116,32,97,108,112,104,97,110,117,109,101,114,105,99,122,7, - 123,125,46,123,125,123,125,114,16,0,0,0,114,45,0,0, - 0,41,28,218,9,95,119,97,114,110,105,110,103,115,218,4, - 119,97,114,110,218,18,68,101,112,114,101,99,97,116,105,111, - 110,87,97,114,110,105,110,103,218,9,84,121,112,101,69,114, - 114,111,114,114,24,0,0,0,218,6,102,115,112,97,116,104, - 114,74,0,0,0,218,10,114,112,97,114,116,105,116,105,111, - 110,114,21,0,0,0,218,14,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,218,9,99,97,99,104,101,95,116,97, - 103,218,19,78,111,116,73,109,112,108,101,109,101,110,116,101, - 100,69,114,114,111,114,114,62,0,0,0,114,22,0,0,0, - 218,8,111,112,116,105,109,105,122,101,218,3,115,116,114,218, - 7,105,115,97,108,110,117,109,218,10,86,97,108,117,101,69, - 114,114,111,114,114,88,0,0,0,218,4,95,79,80,84,218, - 17,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, - 69,83,218,14,112,121,99,97,99,104,101,95,112,114,101,102, - 105,120,114,85,0,0,0,114,67,0,0,0,114,81,0,0, - 0,114,50,0,0,0,218,6,108,115,116,114,105,112,218,8, - 95,80,89,67,65,67,72,69,41,12,114,65,0,0,0,90, - 14,100,101,98,117,103,95,111,118,101,114,114,105,100,101,114, - 95,0,0,0,218,7,109,101,115,115,97,103,101,218,4,104, - 101,97,100,114,66,0,0,0,90,4,98,97,115,101,114,9, - 0,0,0,218,4,114,101,115,116,90,3,116,97,103,90,15, - 97,108,109,111,115,116,95,102,105,108,101,110,97,109,101,218, - 8,102,105,108,101,110,97,109,101,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,17,99,97,99,104,101,95, - 102,114,111,109,95,115,111,117,114,99,101,105,1,0,0,115, - 72,0,0,0,0,18,8,1,6,1,2,255,4,2,8,1, - 4,1,8,1,12,1,10,1,12,1,16,1,8,1,8,1, - 8,1,24,1,8,1,12,1,6,2,8,1,8,1,8,1, - 8,1,14,1,14,1,12,1,12,9,10,1,14,5,28,1, - 12,4,2,1,4,1,8,1,2,253,4,5,114,120,0,0, - 0,99,1,0,0,0,0,0,0,0,0,0,0,0,10,0, - 0,0,5,0,0,0,67,0,0,0,115,46,1,0,0,116, - 0,106,1,106,2,100,1,117,0,114,20,116,3,100,2,131, - 1,130,1,116,4,160,5,124,0,161,1,125,0,116,6,124, - 0,131,1,92,2,125,1,125,2,100,3,125,3,116,0,106, - 7,100,1,117,1,114,102,116,0,106,7,160,8,116,9,161, - 1,125,4,124,1,160,10,124,4,116,11,23,0,161,1,114, - 102,124,1,116,12,124,4,131,1,100,1,133,2,25,0,125, - 1,100,4,125,3,124,3,115,144,116,6,124,1,131,1,92, - 2,125,1,125,5,124,5,116,13,107,3,114,144,116,14,116, - 13,155,0,100,5,124,0,155,2,157,3,131,1,130,1,124, - 2,160,15,100,6,161,1,125,6,124,6,100,7,118,1,114, - 178,116,14,100,8,124,2,155,2,157,2,131,1,130,1,110, - 92,124,6,100,9,107,2,144,1,114,14,124,2,160,16,100, - 6,100,10,161,2,100,11,25,0,125,7,124,7,160,10,116, - 17,161,1,115,228,116,14,100,12,116,17,155,2,157,2,131, - 1,130,1,124,7,116,12,116,17,131,1,100,1,133,2,25, - 0,125,8,124,8,160,18,161,0,144,1,115,14,116,14,100, - 13,124,7,155,2,100,14,157,3,131,1,130,1,124,2,160, - 19,100,6,161,1,100,15,25,0,125,9,116,20,124,1,124, - 9,116,21,100,15,25,0,23,0,131,2,83,0,41,16,97, - 110,1,0,0,71,105,118,101,110,32,116,104,101,32,112,97, - 116,104,32,116,111,32,97,32,46,112,121,99,46,32,102,105, - 108,101,44,32,114,101,116,117,114,110,32,116,104,101,32,112, - 97,116,104,32,116,111,32,105,116,115,32,46,112,121,32,102, - 105,108,101,46,10,10,32,32,32,32,84,104,101,32,46,112, - 121,99,32,102,105,108,101,32,100,111,101,115,32,110,111,116, - 32,110,101,101,100,32,116,111,32,101,120,105,115,116,59,32, - 116,104,105,115,32,115,105,109,112,108,121,32,114,101,116,117, - 114,110,115,32,116,104,101,32,112,97,116,104,32,116,111,10, - 32,32,32,32,116,104,101,32,46,112,121,32,102,105,108,101, - 32,99,97,108,99,117,108,97,116,101,100,32,116,111,32,99, - 111,114,114,101,115,112,111,110,100,32,116,111,32,116,104,101, - 32,46,112,121,99,32,102,105,108,101,46,32,32,73,102,32, - 112,97,116,104,32,100,111,101,115,10,32,32,32,32,110,111, - 116,32,99,111,110,102,111,114,109,32,116,111,32,80,69,80, - 32,51,49,52,55,47,52,56,56,32,102,111,114,109,97,116, - 44,32,86,97,108,117,101,69,114,114,111,114,32,119,105,108, - 108,32,98,101,32,114,97,105,115,101,100,46,32,73,102,10, - 32,32,32,32,115,121,115,46,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,46,99,97,99,104,101,95,116,97,103, - 32,105,115,32,78,111,110,101,32,116,104,101,110,32,78,111, - 116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111, - 114,32,105,115,32,114,97,105,115,101,100,46,10,10,32,32, - 32,32,78,114,97,0,0,0,70,84,122,31,32,110,111,116, - 32,98,111,116,116,111,109,45,108,101,118,101,108,32,100,105, - 114,101,99,116,111,114,121,32,105,110,32,114,96,0,0,0, - 62,2,0,0,0,114,45,0,0,0,233,3,0,0,0,122, - 29,101,120,112,101,99,116,101,100,32,111,110,108,121,32,50, - 32,111,114,32,51,32,100,111,116,115,32,105,110,32,114,121, - 0,0,0,114,45,0,0,0,233,254,255,255,255,122,53,111, - 112,116,105,109,105,122,97,116,105,111,110,32,112,111,114,116, - 105,111,110,32,111,102,32,102,105,108,101,110,97,109,101,32, - 100,111,101,115,32,110,111,116,32,115,116,97,114,116,32,119, - 105,116,104,32,122,19,111,112,116,105,109,105,122,97,116,105, - 111,110,32,108,101,118,101,108,32,122,29,32,105,115,32,110, - 111,116,32,97,110,32,97,108,112,104,97,110,117,109,101,114, - 105,99,32,118,97,108,117,101,114,0,0,0,0,41,22,114, - 21,0,0,0,114,104,0,0,0,114,105,0,0,0,114,106, - 0,0,0,114,24,0,0,0,114,102,0,0,0,114,74,0, - 0,0,114,113,0,0,0,114,49,0,0,0,114,50,0,0, - 0,114,29,0,0,0,114,59,0,0,0,114,6,0,0,0, - 114,115,0,0,0,114,110,0,0,0,218,5,99,111,117,110, - 116,218,6,114,115,112,108,105,116,114,111,0,0,0,114,109, - 0,0,0,218,9,112,97,114,116,105,116,105,111,110,114,67, - 0,0,0,218,15,83,79,85,82,67,69,95,83,85,70,70, - 73,88,69,83,41,10,114,65,0,0,0,114,117,0,0,0, - 90,16,112,121,99,97,99,104,101,95,102,105,108,101,110,97, - 109,101,90,23,102,111,117,110,100,95,105,110,95,112,121,99, - 97,99,104,101,95,112,114,101,102,105,120,90,13,115,116,114, - 105,112,112,101,100,95,112,97,116,104,90,7,112,121,99,97, - 99,104,101,90,9,100,111,116,95,99,111,117,110,116,114,95, - 0,0,0,90,9,111,112,116,95,108,101,118,101,108,90,13, - 98,97,115,101,95,102,105,108,101,110,97,109,101,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,17,115,111, - 117,114,99,101,95,102,114,111,109,95,99,97,99,104,101,176, - 1,0,0,115,60,0,0,0,0,9,12,1,8,1,10,1, - 12,1,4,1,10,1,12,1,14,1,16,1,4,1,4,1, - 12,1,8,1,8,1,2,255,8,2,10,1,8,1,16,1, - 10,1,16,1,10,1,4,1,2,255,8,2,16,1,10,1, - 16,2,14,1,114,127,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,5,0,0,0,9,0,0,0,67,0, - 0,0,115,124,0,0,0,116,0,124,0,131,1,100,1,107, - 2,114,16,100,2,83,0,124,0,160,1,100,3,161,1,92, - 3,125,1,125,2,125,3,124,1,114,56,124,3,160,2,161, - 0,100,4,100,5,133,2,25,0,100,6,107,3,114,60,124, - 0,83,0,122,12,116,3,124,0,131,1,125,4,87,0,110, - 34,4,0,116,4,116,5,102,2,121,106,1,0,1,0,1, - 0,124,0,100,2,100,5,133,2,25,0,125,4,89,0,110, - 2,48,0,116,6,124,4,131,1,114,120,124,4,83,0,124, - 0,83,0,41,7,122,188,67,111,110,118,101,114,116,32,97, - 32,98,121,116,101,99,111,100,101,32,102,105,108,101,32,112, - 97,116,104,32,116,111,32,97,32,115,111,117,114,99,101,32, - 112,97,116,104,32,40,105,102,32,112,111,115,115,105,98,108, - 101,41,46,10,10,32,32,32,32,84,104,105,115,32,102,117, - 110,99,116,105,111,110,32,101,120,105,115,116,115,32,112,117, - 114,101,108,121,32,102,111,114,32,98,97,99,107,119,97,114, - 100,115,45,99,111,109,112,97,116,105,98,105,108,105,116,121, - 32,102,111,114,10,32,32,32,32,80,121,73,109,112,111,114, - 116,95,69,120,101,99,67,111,100,101,77,111,100,117,108,101, - 87,105,116,104,70,105,108,101,110,97,109,101,115,40,41,32, - 105,110,32,116,104,101,32,67,32,65,80,73,46,10,10,32, - 32,32,32,114,0,0,0,0,78,114,96,0,0,0,233,253, - 255,255,255,233,255,255,255,255,90,2,112,121,41,7,114,6, - 0,0,0,114,103,0,0,0,218,5,108,111,119,101,114,114, - 127,0,0,0,114,106,0,0,0,114,110,0,0,0,114,80, - 0,0,0,41,5,218,13,98,121,116,101,99,111,100,101,95, - 112,97,116,104,114,118,0,0,0,218,1,95,90,9,101,120, - 116,101,110,115,105,111,110,218,11,115,111,117,114,99,101,95, - 112,97,116,104,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,15,95,103,101,116,95,115,111,117,114,99,101, - 102,105,108,101,216,1,0,0,115,20,0,0,0,0,7,12, - 1,4,1,16,1,24,1,4,1,2,1,12,1,16,1,18, - 1,114,134,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,8,0,0,0,67,0,0,0,115, - 72,0,0,0,124,0,160,0,116,1,116,2,131,1,161,1, - 114,46,122,10,116,3,124,0,131,1,87,0,83,0,4,0, - 116,4,121,42,1,0,1,0,1,0,89,0,113,68,48,0, - 110,22,124,0,160,0,116,1,116,5,131,1,161,1,114,64, - 124,0,83,0,100,0,83,0,100,0,83,0,114,69,0,0, - 0,41,6,114,58,0,0,0,218,5,116,117,112,108,101,114, - 126,0,0,0,114,120,0,0,0,114,106,0,0,0,114,112, - 0,0,0,41,1,114,119,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,11,95,103,101,116,95, - 99,97,99,104,101,100,235,1,0,0,115,16,0,0,0,0, - 1,14,1,2,1,10,1,12,1,8,1,14,1,4,2,114, - 136,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,8,0,0,0,67,0,0,0,115,50,0, - 0,0,122,14,116,0,124,0,131,1,106,1,125,1,87,0, - 110,22,4,0,116,2,121,36,1,0,1,0,1,0,100,1, - 125,1,89,0,110,2,48,0,124,1,100,2,79,0,125,1, - 124,1,83,0,41,3,122,51,67,97,108,99,117,108,97,116, - 101,32,116,104,101,32,109,111,100,101,32,112,101,114,109,105, - 115,115,105,111,110,115,32,102,111,114,32,97,32,98,121,116, - 101,99,111,100,101,32,102,105,108,101,46,114,86,0,0,0, - 233,128,0,0,0,41,3,114,75,0,0,0,114,77,0,0, - 0,114,76,0,0,0,41,2,114,65,0,0,0,114,78,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,10,95,99,97,108,99,95,109,111,100,101,247,1,0, - 0,115,12,0,0,0,0,2,2,1,14,1,12,1,10,3, - 8,1,114,138,0,0,0,99,1,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,8,0,0,0,3,0,0,0, - 115,66,0,0,0,100,6,135,0,102,1,100,2,100,3,132, - 9,125,1,122,10,116,0,106,1,125,2,87,0,110,26,4, - 0,116,2,121,50,1,0,1,0,1,0,100,4,100,5,132, - 0,125,2,89,0,110,2,48,0,124,2,124,1,136,0,131, - 2,1,0,124,1,83,0,41,7,122,252,68,101,99,111,114, - 97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,116, - 104,97,116,32,116,104,101,32,109,111,100,117,108,101,32,98, - 101,105,110,103,32,114,101,113,117,101,115,116,101,100,32,109, - 97,116,99,104,101,115,32,116,104,101,32,111,110,101,32,116, - 104,101,10,32,32,32,32,108,111,97,100,101,114,32,99,97, - 110,32,104,97,110,100,108,101,46,10,10,32,32,32,32,84, - 104,101,32,102,105,114,115,116,32,97,114,103,117,109,101,110, - 116,32,40,115,101,108,102,41,32,109,117,115,116,32,100,101, - 102,105,110,101,32,95,110,97,109,101,32,119,104,105,99,104, - 32,116,104,101,32,115,101,99,111,110,100,32,97,114,103,117, - 109,101,110,116,32,105,115,10,32,32,32,32,99,111,109,112, - 97,114,101,100,32,97,103,97,105,110,115,116,46,32,73,102, - 32,116,104,101,32,99,111,109,112,97,114,105,115,111,110,32, - 102,97,105,108,115,32,116,104,101,110,32,73,109,112,111,114, - 116,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, - 46,10,10,32,32,32,32,78,99,2,0,0,0,0,0,0, - 0,0,0,0,0,4,0,0,0,4,0,0,0,31,0,0, - 0,115,72,0,0,0,124,1,100,0,117,0,114,16,124,0, - 106,0,125,1,110,32,124,0,106,0,124,1,107,3,114,48, - 116,1,100,1,124,0,106,0,124,1,102,2,22,0,124,1, - 100,2,141,2,130,1,136,0,124,0,124,1,103,2,124,2, - 162,1,82,0,105,0,124,3,164,1,142,1,83,0,41,3, - 78,122,30,108,111,97,100,101,114,32,102,111,114,32,37,115, - 32,99,97,110,110,111,116,32,104,97,110,100,108,101,32,37, - 115,169,1,218,4,110,97,109,101,41,2,114,140,0,0,0, - 218,11,73,109,112,111,114,116,69,114,114,111,114,41,4,218, - 4,115,101,108,102,114,140,0,0,0,218,4,97,114,103,115, - 218,6,107,119,97,114,103,115,169,1,218,6,109,101,116,104, - 111,100,114,10,0,0,0,114,11,0,0,0,218,19,95,99, - 104,101,99,107,95,110,97,109,101,95,119,114,97,112,112,101, - 114,11,2,0,0,115,18,0,0,0,0,1,8,1,8,1, - 10,1,4,1,8,255,2,1,2,255,6,2,122,40,95,99, - 104,101,99,107,95,110,97,109,101,46,60,108,111,99,97,108, - 115,62,46,95,99,104,101,99,107,95,110,97,109,101,95,119, - 114,97,112,112,101,114,99,2,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,7,0,0,0,83,0,0,0,115, - 56,0,0,0,100,1,68,0,93,32,125,2,116,0,124,1, - 124,2,131,2,114,4,116,1,124,0,124,2,116,2,124,1, - 124,2,131,2,131,3,1,0,113,4,124,0,106,3,160,4, - 124,1,106,3,161,1,1,0,100,0,83,0,41,2,78,41, - 4,218,10,95,95,109,111,100,117,108,101,95,95,218,8,95, - 95,110,97,109,101,95,95,218,12,95,95,113,117,97,108,110, - 97,109,101,95,95,218,7,95,95,100,111,99,95,95,41,5, - 218,7,104,97,115,97,116,116,114,218,7,115,101,116,97,116, - 116,114,218,7,103,101,116,97,116,116,114,218,8,95,95,100, - 105,99,116,95,95,218,6,117,112,100,97,116,101,41,3,90, - 3,110,101,119,90,3,111,108,100,114,84,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,5,95, - 119,114,97,112,22,2,0,0,115,8,0,0,0,0,1,8, - 1,10,1,20,1,122,26,95,99,104,101,99,107,95,110,97, - 109,101,46,60,108,111,99,97,108,115,62,46,95,119,114,97, - 112,41,1,78,41,3,218,10,95,98,111,111,116,115,116,114, - 97,112,114,157,0,0,0,218,9,78,97,109,101,69,114,114, - 111,114,41,3,114,146,0,0,0,114,147,0,0,0,114,157, - 0,0,0,114,10,0,0,0,114,145,0,0,0,114,11,0, - 0,0,218,11,95,99,104,101,99,107,95,110,97,109,101,3, - 2,0,0,115,14,0,0,0,0,8,14,7,2,1,10,1, - 12,2,14,5,10,1,114,160,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,5,0,0,0,6,0,0,0, - 67,0,0,0,115,60,0,0,0,124,0,160,0,124,1,161, - 1,92,2,125,2,125,3,124,2,100,1,117,0,114,56,116, - 1,124,3,131,1,114,56,100,2,125,4,116,2,160,3,124, - 4,160,4,124,3,100,3,25,0,161,1,116,5,161,2,1, - 0,124,2,83,0,41,4,122,155,84,114,121,32,116,111,32, - 102,105,110,100,32,97,32,108,111,97,100,101,114,32,102,111, - 114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,32, - 109,111,100,117,108,101,32,98,121,32,100,101,108,101,103,97, - 116,105,110,103,32,116,111,10,32,32,32,32,115,101,108,102, - 46,102,105,110,100,95,108,111,97,100,101,114,40,41,46,10, - 10,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100, - 32,105,115,32,100,101,112,114,101,99,97,116,101,100,32,105, - 110,32,102,97,118,111,114,32,111,102,32,102,105,110,100,101, - 114,46,102,105,110,100,95,115,112,101,99,40,41,46,10,10, - 32,32,32,32,78,122,44,78,111,116,32,105,109,112,111,114, - 116,105,110,103,32,100,105,114,101,99,116,111,114,121,32,123, - 125,58,32,109,105,115,115,105,110,103,32,95,95,105,110,105, - 116,95,95,114,0,0,0,0,41,6,218,11,102,105,110,100, - 95,108,111,97,100,101,114,114,6,0,0,0,114,98,0,0, - 0,114,99,0,0,0,114,88,0,0,0,218,13,73,109,112, - 111,114,116,87,97,114,110,105,110,103,41,5,114,142,0,0, - 0,218,8,102,117,108,108,110,97,109,101,218,6,108,111,97, - 100,101,114,218,8,112,111,114,116,105,111,110,115,218,3,109, - 115,103,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,17,95,102,105,110,100,95,109,111,100,117,108,101,95, - 115,104,105,109,31,2,0,0,115,10,0,0,0,0,10,14, - 1,16,1,4,1,22,1,114,167,0,0,0,99,3,0,0, - 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, - 0,67,0,0,0,115,166,0,0,0,124,0,100,1,100,2, - 133,2,25,0,125,3,124,3,116,0,107,3,114,64,100,3, - 124,1,155,2,100,4,124,3,155,2,157,4,125,4,116,1, - 160,2,100,5,124,4,161,2,1,0,116,3,124,4,102,1, - 105,0,124,2,164,1,142,1,130,1,116,4,124,0,131,1, - 100,6,107,0,114,106,100,7,124,1,155,2,157,2,125,4, - 116,1,160,2,100,5,124,4,161,2,1,0,116,5,124,4, - 131,1,130,1,116,6,124,0,100,2,100,8,133,2,25,0, - 131,1,125,5,124,5,100,9,64,0,114,162,100,10,124,5, - 155,2,100,11,124,1,155,2,157,4,125,4,116,3,124,4, - 102,1,105,0,124,2,164,1,142,1,130,1,124,5,83,0, - 41,12,97,84,2,0,0,80,101,114,102,111,114,109,32,98, - 97,115,105,99,32,118,97,108,105,100,105,116,121,32,99,104, - 101,99,107,105,110,103,32,111,102,32,97,32,112,121,99,32, - 104,101,97,100,101,114,32,97,110,100,32,114,101,116,117,114, - 110,32,116,104,101,32,102,108,97,103,115,32,102,105,101,108, - 100,44,10,32,32,32,32,119,104,105,99,104,32,100,101,116, - 101,114,109,105,110,101,115,32,104,111,119,32,116,104,101,32, - 112,121,99,32,115,104,111,117,108,100,32,98,101,32,102,117, - 114,116,104,101,114,32,118,97,108,105,100,97,116,101,100,32, - 97,103,97,105,110,115,116,32,116,104,101,32,115,111,117,114, - 99,101,46,10,10,32,32,32,32,42,100,97,116,97,42,32, - 105,115,32,116,104,101,32,99,111,110,116,101,110,116,115,32, - 111,102,32,116,104,101,32,112,121,99,32,102,105,108,101,46, - 32,40,79,110,108,121,32,116,104,101,32,102,105,114,115,116, - 32,49,54,32,98,121,116,101,115,32,97,114,101,10,32,32, - 32,32,114,101,113,117,105,114,101,100,44,32,116,104,111,117, - 103,104,46,41,10,10,32,32,32,32,42,110,97,109,101,42, - 32,105,115,32,116,104,101,32,110,97,109,101,32,111,102,32, - 116,104,101,32,109,111,100,117,108,101,32,98,101,105,110,103, - 32,105,109,112,111,114,116,101,100,46,32,73,116,32,105,115, - 32,117,115,101,100,32,102,111,114,32,108,111,103,103,105,110, - 103,46,10,10,32,32,32,32,42,101,120,99,95,100,101,116, - 97,105,108,115,42,32,105,115,32,97,32,100,105,99,116,105, - 111,110,97,114,121,32,112,97,115,115,101,100,32,116,111,32, - 73,109,112,111,114,116,69,114,114,111,114,32,105,102,32,105, - 116,32,114,97,105,115,101,100,32,102,111,114,10,32,32,32, - 32,105,109,112,114,111,118,101,100,32,100,101,98,117,103,103, - 105,110,103,46,10,10,32,32,32,32,73,109,112,111,114,116, - 69,114,114,111,114,32,105,115,32,114,97,105,115,101,100,32, - 119,104,101,110,32,116,104,101,32,109,97,103,105,99,32,110, - 117,109,98,101,114,32,105,115,32,105,110,99,111,114,114,101, - 99,116,32,111,114,32,119,104,101,110,32,116,104,101,32,102, - 108,97,103,115,10,32,32,32,32,102,105,101,108,100,32,105, - 115,32,105,110,118,97,108,105,100,46,32,69,79,70,69,114, - 114,111,114,32,105,115,32,114,97,105,115,101,100,32,119,104, - 101,110,32,116,104,101,32,100,97,116,97,32,105,115,32,102, - 111,117,110,100,32,116,111,32,98,101,32,116,114,117,110,99, - 97,116,101,100,46,10,10,32,32,32,32,78,114,34,0,0, - 0,122,20,98,97,100,32,109,97,103,105,99,32,110,117,109, - 98,101,114,32,105,110,32,122,2,58,32,250,2,123,125,233, - 16,0,0,0,122,40,114,101,97,99,104,101,100,32,69,79, - 70,32,119,104,105,108,101,32,114,101,97,100,105,110,103,32, - 112,121,99,32,104,101,97,100,101,114,32,111,102,32,233,8, - 0,0,0,233,252,255,255,255,122,14,105,110,118,97,108,105, - 100,32,102,108,97,103,115,32,122,4,32,105,110,32,41,7, - 218,12,77,65,71,73,67,95,78,85,77,66,69,82,114,158, - 0,0,0,218,16,95,118,101,114,98,111,115,101,95,109,101, - 115,115,97,103,101,114,141,0,0,0,114,6,0,0,0,218, - 8,69,79,70,69,114,114,111,114,114,44,0,0,0,41,6, - 114,43,0,0,0,114,140,0,0,0,218,11,101,120,99,95, - 100,101,116,97,105,108,115,90,5,109,97,103,105,99,114,116, - 0,0,0,114,22,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,13,95,99,108,97,115,115,105, - 102,121,95,112,121,99,48,2,0,0,115,28,0,0,0,0, - 16,12,1,8,1,16,1,12,1,16,1,12,1,10,1,12, - 1,8,1,16,2,8,1,16,1,16,1,114,176,0,0,0, - 99,5,0,0,0,0,0,0,0,0,0,0,0,6,0,0, - 0,4,0,0,0,67,0,0,0,115,120,0,0,0,116,0, - 124,0,100,1,100,2,133,2,25,0,131,1,124,1,100,3, - 64,0,107,3,114,62,100,4,124,3,155,2,157,2,125,5, - 116,1,160,2,100,5,124,5,161,2,1,0,116,3,124,5, - 102,1,105,0,124,4,164,1,142,1,130,1,124,2,100,6, - 117,1,114,116,116,0,124,0,100,2,100,7,133,2,25,0, - 131,1,124,2,100,3,64,0,107,3,114,116,116,3,100,4, - 124,3,155,2,157,2,102,1,105,0,124,4,164,1,142,1, - 130,1,100,6,83,0,41,8,97,7,2,0,0,86,97,108, - 105,100,97,116,101,32,97,32,112,121,99,32,97,103,97,105, - 110,115,116,32,116,104,101,32,115,111,117,114,99,101,32,108, - 97,115,116,45,109,111,100,105,102,105,101,100,32,116,105,109, - 101,46,10,10,32,32,32,32,42,100,97,116,97,42,32,105, - 115,32,116,104,101,32,99,111,110,116,101,110,116,115,32,111, - 102,32,116,104,101,32,112,121,99,32,102,105,108,101,46,32, - 40,79,110,108,121,32,116,104,101,32,102,105,114,115,116,32, - 49,54,32,98,121,116,101,115,32,97,114,101,10,32,32,32, - 32,114,101,113,117,105,114,101,100,46,41,10,10,32,32,32, - 32,42,115,111,117,114,99,101,95,109,116,105,109,101,42,32, - 105,115,32,116,104,101,32,108,97,115,116,32,109,111,100,105, - 102,105,101,100,32,116,105,109,101,115,116,97,109,112,32,111, - 102,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, - 101,46,10,10,32,32,32,32,42,115,111,117,114,99,101,95, - 115,105,122,101,42,32,105,115,32,78,111,110,101,32,111,114, - 32,116,104,101,32,115,105,122,101,32,111,102,32,116,104,101, - 32,115,111,117,114,99,101,32,102,105,108,101,32,105,110,32, - 98,121,116,101,115,46,10,10,32,32,32,32,42,110,97,109, - 101,42,32,105,115,32,116,104,101,32,110,97,109,101,32,111, - 102,32,116,104,101,32,109,111,100,117,108,101,32,98,101,105, - 110,103,32,105,109,112,111,114,116,101,100,46,32,73,116,32, - 105,115,32,117,115,101,100,32,102,111,114,32,108,111,103,103, - 105,110,103,46,10,10,32,32,32,32,42,101,120,99,95,100, - 101,116,97,105,108,115,42,32,105,115,32,97,32,100,105,99, - 116,105,111,110,97,114,121,32,112,97,115,115,101,100,32,116, - 111,32,73,109,112,111,114,116,69,114,114,111,114,32,105,102, - 32,105,116,32,114,97,105,115,101,100,32,102,111,114,10,32, - 32,32,32,105,109,112,114,111,118,101,100,32,100,101,98,117, - 103,103,105,110,103,46,10,10,32,32,32,32,65,110,32,73, - 109,112,111,114,116,69,114,114,111,114,32,105,115,32,114,97, - 105,115,101,100,32,105,102,32,116,104,101,32,98,121,116,101, - 99,111,100,101,32,105,115,32,115,116,97,108,101,46,10,10, - 32,32,32,32,114,170,0,0,0,233,12,0,0,0,114,33, - 0,0,0,122,22,98,121,116,101,99,111,100,101,32,105,115, - 32,115,116,97,108,101,32,102,111,114,32,114,168,0,0,0, - 78,114,169,0,0,0,41,4,114,44,0,0,0,114,158,0, - 0,0,114,173,0,0,0,114,141,0,0,0,41,6,114,43, - 0,0,0,218,12,115,111,117,114,99,101,95,109,116,105,109, - 101,218,11,115,111,117,114,99,101,95,115,105,122,101,114,140, - 0,0,0,114,175,0,0,0,114,116,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,23,95,118, - 97,108,105,100,97,116,101,95,116,105,109,101,115,116,97,109, - 112,95,112,121,99,81,2,0,0,115,16,0,0,0,0,19, - 24,1,10,1,12,1,16,1,8,1,22,255,2,2,114,180, - 0,0,0,99,4,0,0,0,0,0,0,0,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,42,0,0, - 0,124,0,100,1,100,2,133,2,25,0,124,1,107,3,114, - 38,116,0,100,3,124,2,155,2,157,2,102,1,105,0,124, - 3,164,1,142,1,130,1,100,4,83,0,41,5,97,243,1, - 0,0,86,97,108,105,100,97,116,101,32,97,32,104,97,115, - 104,45,98,97,115,101,100,32,112,121,99,32,98,121,32,99, - 104,101,99,107,105,110,103,32,116,104,101,32,114,101,97,108, - 32,115,111,117,114,99,101,32,104,97,115,104,32,97,103,97, - 105,110,115,116,32,116,104,101,32,111,110,101,32,105,110,10, - 32,32,32,32,116,104,101,32,112,121,99,32,104,101,97,100, - 101,114,46,10,10,32,32,32,32,42,100,97,116,97,42,32, - 105,115,32,116,104,101,32,99,111,110,116,101,110,116,115,32, - 111,102,32,116,104,101,32,112,121,99,32,102,105,108,101,46, - 32,40,79,110,108,121,32,116,104,101,32,102,105,114,115,116, - 32,49,54,32,98,121,116,101,115,32,97,114,101,10,32,32, - 32,32,114,101,113,117,105,114,101,100,46,41,10,10,32,32, - 32,32,42,115,111,117,114,99,101,95,104,97,115,104,42,32, - 105,115,32,116,104,101,32,105,109,112,111,114,116,108,105,98, - 46,117,116,105,108,46,115,111,117,114,99,101,95,104,97,115, - 104,40,41,32,111,102,32,116,104,101,32,115,111,117,114,99, - 101,32,102,105,108,101,46,10,10,32,32,32,32,42,110,97, - 109,101,42,32,105,115,32,116,104,101,32,110,97,109,101,32, - 111,102,32,116,104,101,32,109,111,100,117,108,101,32,98,101, - 105,110,103,32,105,109,112,111,114,116,101,100,46,32,73,116, - 32,105,115,32,117,115,101,100,32,102,111,114,32,108,111,103, - 103,105,110,103,46,10,10,32,32,32,32,42,101,120,99,95, - 100,101,116,97,105,108,115,42,32,105,115,32,97,32,100,105, - 99,116,105,111,110,97,114,121,32,112,97,115,115,101,100,32, - 116,111,32,73,109,112,111,114,116,69,114,114,111,114,32,105, - 102,32,105,116,32,114,97,105,115,101,100,32,102,111,114,10, - 32,32,32,32,105,109,112,114,111,118,101,100,32,100,101,98, - 117,103,103,105,110,103,46,10,10,32,32,32,32,65,110,32, - 73,109,112,111,114,116,69,114,114,111,114,32,105,115,32,114, - 97,105,115,101,100,32,105,102,32,116,104,101,32,98,121,116, - 101,99,111,100,101,32,105,115,32,115,116,97,108,101,46,10, - 10,32,32,32,32,114,170,0,0,0,114,169,0,0,0,122, - 46,104,97,115,104,32,105,110,32,98,121,116,101,99,111,100, - 101,32,100,111,101,115,110,39,116,32,109,97,116,99,104,32, - 104,97,115,104,32,111,102,32,115,111,117,114,99,101,32,78, - 41,1,114,141,0,0,0,41,4,114,43,0,0,0,218,11, - 115,111,117,114,99,101,95,104,97,115,104,114,140,0,0,0, - 114,175,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,18,95,118,97,108,105,100,97,116,101,95, - 104,97,115,104,95,112,121,99,109,2,0,0,115,12,0,0, - 0,0,17,16,1,2,1,8,255,4,2,2,254,114,182,0, - 0,0,99,4,0,0,0,0,0,0,0,0,0,0,0,5, - 0,0,0,5,0,0,0,67,0,0,0,115,80,0,0,0, - 116,0,160,1,124,0,161,1,125,4,116,2,124,4,116,3, - 131,2,114,56,116,4,160,5,100,1,124,2,161,2,1,0, - 124,3,100,2,117,1,114,52,116,6,160,7,124,4,124,3, - 161,2,1,0,124,4,83,0,116,8,100,3,160,9,124,2, - 161,1,124,1,124,2,100,4,141,3,130,1,100,2,83,0, - 41,5,122,35,67,111,109,112,105,108,101,32,98,121,116,101, - 99,111,100,101,32,97,115,32,102,111,117,110,100,32,105,110, - 32,97,32,112,121,99,46,122,21,99,111,100,101,32,111,98, - 106,101,99,116,32,102,114,111,109,32,123,33,114,125,78,122, - 23,78,111,110,45,99,111,100,101,32,111,98,106,101,99,116, - 32,105,110,32,123,33,114,125,169,2,114,140,0,0,0,114, - 65,0,0,0,41,10,218,7,109,97,114,115,104,97,108,90, - 5,108,111,97,100,115,218,10,105,115,105,110,115,116,97,110, - 99,101,218,10,95,99,111,100,101,95,116,121,112,101,114,158, - 0,0,0,114,173,0,0,0,218,4,95,105,109,112,90,16, - 95,102,105,120,95,99,111,95,102,105,108,101,110,97,109,101, - 114,141,0,0,0,114,88,0,0,0,41,5,114,43,0,0, - 0,114,140,0,0,0,114,131,0,0,0,114,133,0,0,0, - 218,4,99,111,100,101,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,17,95,99,111,109,112,105,108,101,95, - 98,121,116,101,99,111,100,101,133,2,0,0,115,18,0,0, - 0,0,2,10,1,10,1,12,1,8,1,12,1,4,2,10, - 1,4,255,114,189,0,0,0,99,3,0,0,0,0,0,0, - 0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,0, - 0,115,70,0,0,0,116,0,116,1,131,1,125,3,124,3, - 160,2,116,3,100,1,131,1,161,1,1,0,124,3,160,2, - 116,3,124,1,131,1,161,1,1,0,124,3,160,2,116,3, - 124,2,131,1,161,1,1,0,124,3,160,2,116,4,160,5, - 124,0,161,1,161,1,1,0,124,3,83,0,41,2,122,43, - 80,114,111,100,117,99,101,32,116,104,101,32,100,97,116,97, - 32,102,111,114,32,97,32,116,105,109,101,115,116,97,109,112, - 45,98,97,115,101,100,32,112,121,99,46,114,0,0,0,0, - 41,6,218,9,98,121,116,101,97,114,114,97,121,114,172,0, - 0,0,218,6,101,120,116,101,110,100,114,39,0,0,0,114, - 184,0,0,0,218,5,100,117,109,112,115,41,4,114,188,0, - 0,0,218,5,109,116,105,109,101,114,179,0,0,0,114,43, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,22,95,99,111,100,101,95,116,111,95,116,105,109, - 101,115,116,97,109,112,95,112,121,99,146,2,0,0,115,12, - 0,0,0,0,2,8,1,14,1,14,1,14,1,16,1,114, - 194,0,0,0,84,99,3,0,0,0,0,0,0,0,0,0, - 0,0,5,0,0,0,5,0,0,0,67,0,0,0,115,80, - 0,0,0,116,0,116,1,131,1,125,3,100,1,124,2,100, - 1,62,0,66,0,125,4,124,3,160,2,116,3,124,4,131, - 1,161,1,1,0,116,4,124,1,131,1,100,2,107,2,115, - 50,74,0,130,1,124,3,160,2,124,1,161,1,1,0,124, - 3,160,2,116,5,160,6,124,0,161,1,161,1,1,0,124, - 3,83,0,41,3,122,38,80,114,111,100,117,99,101,32,116, - 104,101,32,100,97,116,97,32,102,111,114,32,97,32,104,97, - 115,104,45,98,97,115,101,100,32,112,121,99,46,114,4,0, - 0,0,114,170,0,0,0,41,7,114,190,0,0,0,114,172, - 0,0,0,114,191,0,0,0,114,39,0,0,0,114,6,0, - 0,0,114,184,0,0,0,114,192,0,0,0,41,5,114,188, - 0,0,0,114,181,0,0,0,90,7,99,104,101,99,107,101, - 100,114,43,0,0,0,114,22,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,17,95,99,111,100, - 101,95,116,111,95,104,97,115,104,95,112,121,99,156,2,0, - 0,115,14,0,0,0,0,2,8,1,12,1,14,1,16,1, - 10,1,16,1,114,195,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,5,0,0,0,6,0,0,0,67,0, - 0,0,115,62,0,0,0,100,1,100,2,108,0,125,1,116, - 1,160,2,124,0,161,1,106,3,125,2,124,1,160,4,124, - 2,161,1,125,3,116,1,160,5,100,2,100,3,161,2,125, - 4,124,4,160,6,124,0,160,6,124,3,100,1,25,0,161, - 1,161,1,83,0,41,4,122,121,68,101,99,111,100,101,32, - 98,121,116,101,115,32,114,101,112,114,101,115,101,110,116,105, - 110,103,32,115,111,117,114,99,101,32,99,111,100,101,32,97, - 110,100,32,114,101,116,117,114,110,32,116,104,101,32,115,116, - 114,105,110,103,46,10,10,32,32,32,32,85,110,105,118,101, - 114,115,97,108,32,110,101,119,108,105,110,101,32,115,117,112, - 112,111,114,116,32,105,115,32,117,115,101,100,32,105,110,32, - 116,104,101,32,100,101,99,111,100,105,110,103,46,10,32,32, - 32,32,114,0,0,0,0,78,84,41,7,218,8,116,111,107, - 101,110,105,122,101,114,90,0,0,0,90,7,66,121,116,101, - 115,73,79,90,8,114,101,97,100,108,105,110,101,90,15,100, - 101,116,101,99,116,95,101,110,99,111,100,105,110,103,90,25, - 73,110,99,114,101,109,101,110,116,97,108,78,101,119,108,105, - 110,101,68,101,99,111,100,101,114,218,6,100,101,99,111,100, - 101,41,5,218,12,115,111,117,114,99,101,95,98,121,116,101, - 115,114,196,0,0,0,90,21,115,111,117,114,99,101,95,98, - 121,116,101,115,95,114,101,97,100,108,105,110,101,218,8,101, - 110,99,111,100,105,110,103,90,15,110,101,119,108,105,110,101, - 95,100,101,99,111,100,101,114,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,13,100,101,99,111,100,101,95, - 115,111,117,114,99,101,167,2,0,0,115,10,0,0,0,0, - 5,8,1,12,1,10,1,12,1,114,200,0,0,0,169,2, - 114,164,0,0,0,218,26,115,117,98,109,111,100,117,108,101, - 95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,110, - 115,99,2,0,0,0,0,0,0,0,2,0,0,0,9,0, - 0,0,8,0,0,0,67,0,0,0,115,12,1,0,0,124, - 1,100,1,117,0,114,58,100,2,125,1,116,0,124,2,100, - 3,131,2,114,68,122,14,124,2,160,1,124,0,161,1,125, - 1,87,0,113,68,4,0,116,2,121,54,1,0,1,0,1, - 0,89,0,113,68,48,0,110,10,116,3,160,4,124,1,161, - 1,125,1,116,5,106,6,124,0,124,2,124,1,100,4,141, - 3,125,4,100,5,124,4,95,7,124,2,100,1,117,0,114, - 152,116,8,131,0,68,0,93,42,92,2,125,5,125,6,124, - 1,160,9,116,10,124,6,131,1,161,1,114,104,124,5,124, - 0,124,1,131,2,125,2,124,2,124,4,95,11,1,0,113, - 152,113,104,100,1,83,0,124,3,116,12,117,0,114,216,116, - 0,124,2,100,6,131,2,114,222,122,14,124,2,160,13,124, - 0,161,1,125,7,87,0,110,18,4,0,116,2,121,202,1, - 0,1,0,1,0,89,0,113,222,48,0,124,7,114,222,103, - 0,124,4,95,14,110,6,124,3,124,4,95,14,124,4,106, - 14,103,0,107,2,144,1,114,8,124,1,144,1,114,8,116, - 15,124,1,131,1,100,7,25,0,125,8,124,4,106,14,160, - 16,124,8,161,1,1,0,124,4,83,0,41,8,97,61,1, - 0,0,82,101,116,117,114,110,32,97,32,109,111,100,117,108, - 101,32,115,112,101,99,32,98,97,115,101,100,32,111,110,32, - 97,32,102,105,108,101,32,108,111,99,97,116,105,111,110,46, - 10,10,32,32,32,32,84,111,32,105,110,100,105,99,97,116, - 101,32,116,104,97,116,32,116,104,101,32,109,111,100,117,108, - 101,32,105,115,32,97,32,112,97,99,107,97,103,101,44,32, - 115,101,116,10,32,32,32,32,115,117,98,109,111,100,117,108, - 101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111, - 110,115,32,116,111,32,97,32,108,105,115,116,32,111,102,32, - 100,105,114,101,99,116,111,114,121,32,112,97,116,104,115,46, - 32,32,65,110,10,32,32,32,32,101,109,112,116,121,32,108, - 105,115,116,32,105,115,32,115,117,102,102,105,99,105,101,110, - 116,44,32,116,104,111,117,103,104,32,105,116,115,32,110,111, - 116,32,111,116,104,101,114,119,105,115,101,32,117,115,101,102, - 117,108,32,116,111,32,116,104,101,10,32,32,32,32,105,109, - 112,111,114,116,32,115,121,115,116,101,109,46,10,10,32,32, - 32,32,84,104,101,32,108,111,97,100,101,114,32,109,117,115, - 116,32,116,97,107,101,32,97,32,115,112,101,99,32,97,115, - 32,105,116,115,32,111,110,108,121,32,95,95,105,110,105,116, - 95,95,40,41,32,97,114,103,46,10,10,32,32,32,32,78, - 122,9,60,117,110,107,110,111,119,110,62,218,12,103,101,116, - 95,102,105,108,101,110,97,109,101,169,1,218,6,111,114,105, - 103,105,110,84,218,10,105,115,95,112,97,99,107,97,103,101, - 114,0,0,0,0,41,17,114,152,0,0,0,114,203,0,0, - 0,114,141,0,0,0,114,24,0,0,0,114,102,0,0,0, - 114,158,0,0,0,218,10,77,111,100,117,108,101,83,112,101, - 99,90,13,95,115,101,116,95,102,105,108,101,97,116,116,114, - 218,27,95,103,101,116,95,115,117,112,112,111,114,116,101,100, - 95,102,105,108,101,95,108,111,97,100,101,114,115,114,58,0, - 0,0,114,135,0,0,0,114,164,0,0,0,218,9,95,80, - 79,80,85,76,65,84,69,114,206,0,0,0,114,202,0,0, - 0,114,74,0,0,0,114,61,0,0,0,41,9,114,140,0, - 0,0,90,8,108,111,99,97,116,105,111,110,114,164,0,0, - 0,114,202,0,0,0,218,4,115,112,101,99,218,12,108,111, - 97,100,101,114,95,99,108,97,115,115,218,8,115,117,102,102, - 105,120,101,115,114,206,0,0,0,90,7,100,105,114,110,97, - 109,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,23,115,112,101,99,95,102,114,111,109,95,102,105,108, - 101,95,108,111,99,97,116,105,111,110,184,2,0,0,115,62, - 0,0,0,0,12,8,4,4,1,10,2,2,1,14,1,12, - 1,8,2,10,8,16,1,6,3,8,1,14,1,14,1,10, - 1,6,1,6,2,4,3,8,2,10,1,2,1,14,1,12, - 1,6,2,4,1,8,2,6,1,12,1,6,1,12,1,12, - 2,114,213,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,4,0,0,0,64,0,0,0,115, - 80,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,90,4,100,3,90,5,100,4,90,6,101,7,100,5, - 100,6,132,0,131,1,90,8,101,7,100,7,100,8,132,0, - 131,1,90,9,101,7,100,14,100,10,100,11,132,1,131,1, - 90,10,101,7,100,15,100,12,100,13,132,1,131,1,90,11, - 100,9,83,0,41,16,218,21,87,105,110,100,111,119,115,82, - 101,103,105,115,116,114,121,70,105,110,100,101,114,122,62,77, - 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, - 102,111,114,32,109,111,100,117,108,101,115,32,100,101,99,108, - 97,114,101,100,32,105,110,32,116,104,101,32,87,105,110,100, - 111,119,115,32,114,101,103,105,115,116,114,121,46,122,59,83, - 111,102,116,119,97,114,101,92,80,121,116,104,111,110,92,80, - 121,116,104,111,110,67,111,114,101,92,123,115,121,115,95,118, - 101,114,115,105,111,110,125,92,77,111,100,117,108,101,115,92, - 123,102,117,108,108,110,97,109,101,125,122,65,83,111,102,116, - 119,97,114,101,92,80,121,116,104,111,110,92,80,121,116,104, - 111,110,67,111,114,101,92,123,115,121,115,95,118,101,114,115, - 105,111,110,125,92,77,111,100,117,108,101,115,92,123,102,117, - 108,108,110,97,109,101,125,92,68,101,98,117,103,70,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8, - 0,0,0,67,0,0,0,115,54,0,0,0,122,16,116,0, - 160,1,116,0,106,2,124,1,161,2,87,0,83,0,4,0, - 116,3,121,48,1,0,1,0,1,0,116,0,160,1,116,0, - 106,4,124,1,161,2,6,0,89,0,83,0,48,0,100,0, - 83,0,114,69,0,0,0,41,5,218,6,119,105,110,114,101, - 103,90,7,79,112,101,110,75,101,121,90,17,72,75,69,89, - 95,67,85,82,82,69,78,84,95,85,83,69,82,114,76,0, - 0,0,90,18,72,75,69,89,95,76,79,67,65,76,95,77, - 65,67,72,73,78,69,41,2,218,3,99,108,115,114,26,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,14,95,111,112,101,110,95,114,101,103,105,115,116,114, - 121,8,3,0,0,115,8,0,0,0,0,2,2,1,16,1, - 12,1,122,36,87,105,110,100,111,119,115,82,101,103,105,115, - 116,114,121,70,105,110,100,101,114,46,95,111,112,101,110,95, - 114,101,103,105,115,116,114,121,99,2,0,0,0,0,0,0, - 0,0,0,0,0,6,0,0,0,8,0,0,0,67,0,0, - 0,115,132,0,0,0,124,0,106,0,114,14,124,0,106,1, - 125,2,110,6,124,0,106,2,125,2,124,2,106,3,124,1, - 100,1,116,4,106,5,100,0,100,2,133,2,25,0,22,0, - 100,3,141,2,125,3,122,58,124,0,160,6,124,3,161,1, - 143,28,125,4,116,7,160,8,124,4,100,4,161,2,125,5, - 87,0,100,0,4,0,4,0,131,3,1,0,110,16,49,0, - 115,94,48,0,1,0,1,0,1,0,89,0,1,0,87,0, - 110,20,4,0,116,9,121,126,1,0,1,0,1,0,89,0, - 100,0,83,0,48,0,124,5,83,0,41,5,78,122,5,37, - 100,46,37,100,114,45,0,0,0,41,2,114,163,0,0,0, - 90,11,115,121,115,95,118,101,114,115,105,111,110,114,14,0, - 0,0,41,10,218,11,68,69,66,85,71,95,66,85,73,76, - 68,218,18,82,69,71,73,83,84,82,89,95,75,69,89,95, - 68,69,66,85,71,218,12,82,69,71,73,83,84,82,89,95, - 75,69,89,114,88,0,0,0,114,21,0,0,0,218,12,118, - 101,114,115,105,111,110,95,105,110,102,111,114,217,0,0,0, - 114,215,0,0,0,90,10,81,117,101,114,121,86,97,108,117, - 101,114,76,0,0,0,41,6,114,216,0,0,0,114,163,0, - 0,0,90,12,114,101,103,105,115,116,114,121,95,107,101,121, - 114,26,0,0,0,90,4,104,107,101,121,218,8,102,105,108, - 101,112,97,116,104,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,16,95,115,101,97,114,99,104,95,114,101, - 103,105,115,116,114,121,15,3,0,0,115,24,0,0,0,0, - 2,6,1,8,2,6,1,6,1,16,255,6,2,2,1,12, - 1,46,1,12,1,8,1,122,38,87,105,110,100,111,119,115, - 82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,95, - 115,101,97,114,99,104,95,114,101,103,105,115,116,114,121,78, - 99,4,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,8,0,0,0,67,0,0,0,115,120,0,0,0,124,0, - 160,0,124,1,161,1,125,4,124,4,100,0,117,0,114,22, - 100,0,83,0,122,12,116,1,124,4,131,1,1,0,87,0, - 110,20,4,0,116,2,121,54,1,0,1,0,1,0,89,0, - 100,0,83,0,48,0,116,3,131,0,68,0,93,52,92,2, - 125,5,125,6,124,4,160,4,116,5,124,6,131,1,161,1, - 114,62,116,6,106,7,124,1,124,5,124,1,124,4,131,2, - 124,4,100,1,141,3,125,7,124,7,2,0,1,0,83,0, - 113,62,100,0,83,0,41,2,78,114,204,0,0,0,41,8, - 114,223,0,0,0,114,75,0,0,0,114,76,0,0,0,114, - 208,0,0,0,114,58,0,0,0,114,135,0,0,0,114,158, - 0,0,0,218,16,115,112,101,99,95,102,114,111,109,95,108, - 111,97,100,101,114,41,8,114,216,0,0,0,114,163,0,0, - 0,114,65,0,0,0,218,6,116,97,114,103,101,116,114,222, - 0,0,0,114,164,0,0,0,114,212,0,0,0,114,210,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,9,102,105,110,100,95,115,112,101,99,30,3,0,0, - 115,28,0,0,0,0,2,10,1,8,1,4,1,2,1,12, - 1,12,1,8,1,14,1,14,1,6,1,8,1,2,254,6, - 3,122,31,87,105,110,100,111,119,115,82,101,103,105,115,116, - 114,121,70,105,110,100,101,114,46,102,105,110,100,95,115,112, - 101,99,99,3,0,0,0,0,0,0,0,0,0,0,0,4, - 0,0,0,4,0,0,0,67,0,0,0,115,34,0,0,0, - 124,0,160,0,124,1,124,2,161,2,125,3,124,3,100,1, - 117,1,114,26,124,3,106,1,83,0,100,1,83,0,100,1, - 83,0,41,2,122,108,70,105,110,100,32,109,111,100,117,108, - 101,32,110,97,109,101,100,32,105,110,32,116,104,101,32,114, - 101,103,105,115,116,114,121,46,10,10,32,32,32,32,32,32, - 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, - 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, - 101,32,101,120,101,99,95,109,111,100,117,108,101,40,41,32, - 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, - 32,32,78,169,2,114,226,0,0,0,114,164,0,0,0,169, - 4,114,216,0,0,0,114,163,0,0,0,114,65,0,0,0, - 114,210,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,11,102,105,110,100,95,109,111,100,117,108, - 101,46,3,0,0,115,8,0,0,0,0,7,12,1,8,1, - 6,2,122,33,87,105,110,100,111,119,115,82,101,103,105,115, - 116,114,121,70,105,110,100,101,114,46,102,105,110,100,95,109, - 111,100,117,108,101,41,2,78,78,41,1,78,41,12,114,149, - 0,0,0,114,148,0,0,0,114,150,0,0,0,114,151,0, - 0,0,114,220,0,0,0,114,219,0,0,0,114,218,0,0, - 0,218,11,99,108,97,115,115,109,101,116,104,111,100,114,217, - 0,0,0,114,223,0,0,0,114,226,0,0,0,114,229,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,214,0,0,0,252,2,0,0,115, - 28,0,0,0,8,2,4,3,2,255,2,4,2,255,2,3, - 4,2,2,1,10,6,2,1,10,14,2,1,12,15,2,1, - 114,214,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,48, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, - 6,100,7,132,0,90,6,100,8,100,9,132,0,90,7,100, - 10,83,0,41,11,218,13,95,76,111,97,100,101,114,66,97, - 115,105,99,115,122,83,66,97,115,101,32,99,108,97,115,115, - 32,111,102,32,99,111,109,109,111,110,32,99,111,100,101,32, - 110,101,101,100,101,100,32,98,121,32,98,111,116,104,32,83, - 111,117,114,99,101,76,111,97,100,101,114,32,97,110,100,10, - 32,32,32,32,83,111,117,114,99,101,108,101,115,115,70,105, - 108,101,76,111,97,100,101,114,46,99,2,0,0,0,0,0, - 0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,0, - 0,0,115,64,0,0,0,116,0,124,0,160,1,124,1,161, - 1,131,1,100,1,25,0,125,2,124,2,160,2,100,2,100, - 1,161,2,100,3,25,0,125,3,124,1,160,3,100,2,161, - 1,100,4,25,0,125,4,124,3,100,5,107,2,111,62,124, - 4,100,5,107,3,83,0,41,6,122,141,67,111,110,99,114, - 101,116,101,32,105,109,112,108,101,109,101,110,116,97,116,105, - 111,110,32,111,102,32,73,110,115,112,101,99,116,76,111,97, - 100,101,114,46,105,115,95,112,97,99,107,97,103,101,32,98, - 121,32,99,104,101,99,107,105,110,103,32,105,102,10,32,32, - 32,32,32,32,32,32,116,104,101,32,112,97,116,104,32,114, - 101,116,117,114,110,101,100,32,98,121,32,103,101,116,95,102, - 105,108,101,110,97,109,101,32,104,97,115,32,97,32,102,105, - 108,101,110,97,109,101,32,111,102,32,39,95,95,105,110,105, - 116,95,95,46,112,121,39,46,114,4,0,0,0,114,96,0, - 0,0,114,0,0,0,0,114,45,0,0,0,218,8,95,95, - 105,110,105,116,95,95,41,4,114,74,0,0,0,114,203,0, - 0,0,114,124,0,0,0,114,103,0,0,0,41,5,114,142, - 0,0,0,114,163,0,0,0,114,119,0,0,0,90,13,102, - 105,108,101,110,97,109,101,95,98,97,115,101,90,9,116,97, - 105,108,95,110,97,109,101,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,206,0,0,0,65,3,0,0,115, - 8,0,0,0,0,3,18,1,16,1,14,1,122,24,95,76, - 111,97,100,101,114,66,97,115,105,99,115,46,105,115,95,112, - 97,99,107,97,103,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 4,0,0,0,100,1,83,0,169,2,122,42,85,115,101,32, - 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, - 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, - 97,116,105,111,110,46,78,114,10,0,0,0,169,2,114,142, - 0,0,0,114,210,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,13,99,114,101,97,116,101,95, - 109,111,100,117,108,101,73,3,0,0,115,2,0,0,0,0, - 1,122,27,95,76,111,97,100,101,114,66,97,115,105,99,115, - 46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,5, - 0,0,0,67,0,0,0,115,56,0,0,0,124,0,160,0, - 124,1,106,1,161,1,125,2,124,2,100,1,117,0,114,36, - 116,2,100,2,160,3,124,1,106,1,161,1,131,1,130,1, - 116,4,160,5,116,6,124,2,124,1,106,7,161,3,1,0, - 100,1,83,0,41,3,122,19,69,120,101,99,117,116,101,32, - 116,104,101,32,109,111,100,117,108,101,46,78,122,52,99,97, - 110,110,111,116,32,108,111,97,100,32,109,111,100,117,108,101, - 32,123,33,114,125,32,119,104,101,110,32,103,101,116,95,99, - 111,100,101,40,41,32,114,101,116,117,114,110,115,32,78,111, - 110,101,41,8,218,8,103,101,116,95,99,111,100,101,114,149, - 0,0,0,114,141,0,0,0,114,88,0,0,0,114,158,0, - 0,0,218,25,95,99,97,108,108,95,119,105,116,104,95,102, - 114,97,109,101,115,95,114,101,109,111,118,101,100,218,4,101, - 120,101,99,114,155,0,0,0,41,3,114,142,0,0,0,218, - 6,109,111,100,117,108,101,114,188,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,11,101,120,101, - 99,95,109,111,100,117,108,101,76,3,0,0,115,12,0,0, - 0,0,2,12,1,8,1,6,1,4,255,6,2,122,25,95, - 76,111,97,100,101,114,66,97,115,105,99,115,46,101,120,101, - 99,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, - 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, - 0,115,12,0,0,0,116,0,160,1,124,0,124,1,161,2, - 83,0,41,1,122,26,84,104,105,115,32,109,111,100,117,108, - 101,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 41,2,114,158,0,0,0,218,17,95,108,111,97,100,95,109, - 111,100,117,108,101,95,115,104,105,109,169,2,114,142,0,0, - 0,114,163,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,11,108,111,97,100,95,109,111,100,117, - 108,101,84,3,0,0,115,2,0,0,0,0,2,122,25,95, - 76,111,97,100,101,114,66,97,115,105,99,115,46,108,111,97, - 100,95,109,111,100,117,108,101,78,41,8,114,149,0,0,0, - 114,148,0,0,0,114,150,0,0,0,114,151,0,0,0,114, - 206,0,0,0,114,235,0,0,0,114,240,0,0,0,114,243, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,231,0,0,0,60,3,0,0, - 115,10,0,0,0,8,2,4,3,8,8,8,3,8,8,114, - 231,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,64,0,0,0,115,74,0, - 0,0,101,0,90,1,100,0,90,2,100,1,100,2,132,0, - 90,3,100,3,100,4,132,0,90,4,100,5,100,6,132,0, - 90,5,100,7,100,8,132,0,90,6,100,9,100,10,132,0, - 90,7,100,11,100,12,156,1,100,13,100,14,132,2,90,8, - 100,15,100,16,132,0,90,9,100,17,83,0,41,18,218,12, - 83,111,117,114,99,101,76,111,97,100,101,114,99,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,8,0,0,0,116,0,130,1,100,1, - 83,0,41,2,122,165,79,112,116,105,111,110,97,108,32,109, - 101,116,104,111,100,32,116,104,97,116,32,114,101,116,117,114, - 110,115,32,116,104,101,32,109,111,100,105,102,105,99,97,116, - 105,111,110,32,116,105,109,101,32,40,97,110,32,105,110,116, - 41,32,102,111,114,32,116,104,101,10,32,32,32,32,32,32, - 32,32,115,112,101,99,105,102,105,101,100,32,112,97,116,104, - 32,40,97,32,115,116,114,41,46,10,10,32,32,32,32,32, - 32,32,32,82,97,105,115,101,115,32,79,83,69,114,114,111, - 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, - 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, - 100,46,10,32,32,32,32,32,32,32,32,78,41,1,114,76, - 0,0,0,169,2,114,142,0,0,0,114,65,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,10, - 112,97,116,104,95,109,116,105,109,101,91,3,0,0,115,2, - 0,0,0,0,6,122,23,83,111,117,114,99,101,76,111,97, - 100,101,114,46,112,97,116,104,95,109,116,105,109,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,67,0,0,0,115,14,0,0,0,100,1,124,0, - 160,0,124,1,161,1,105,1,83,0,41,2,97,158,1,0, - 0,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, - 32,114,101,116,117,114,110,105,110,103,32,97,32,109,101,116, - 97,100,97,116,97,32,100,105,99,116,32,102,111,114,32,116, - 104,101,32,115,112,101,99,105,102,105,101,100,10,32,32,32, - 32,32,32,32,32,112,97,116,104,32,40,97,32,115,116,114, - 41,46,10,10,32,32,32,32,32,32,32,32,80,111,115,115, - 105,98,108,101,32,107,101,121,115,58,10,32,32,32,32,32, - 32,32,32,45,32,39,109,116,105,109,101,39,32,40,109,97, - 110,100,97,116,111,114,121,41,32,105,115,32,116,104,101,32, - 110,117,109,101,114,105,99,32,116,105,109,101,115,116,97,109, - 112,32,111,102,32,108,97,115,116,32,115,111,117,114,99,101, - 10,32,32,32,32,32,32,32,32,32,32,99,111,100,101,32, - 109,111,100,105,102,105,99,97,116,105,111,110,59,10,32,32, - 32,32,32,32,32,32,45,32,39,115,105,122,101,39,32,40, - 111,112,116,105,111,110,97,108,41,32,105,115,32,116,104,101, - 32,115,105,122,101,32,105,110,32,98,121,116,101,115,32,111, - 102,32,116,104,101,32,115,111,117,114,99,101,32,99,111,100, - 101,46,10,10,32,32,32,32,32,32,32,32,73,109,112,108, - 101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,101, - 116,104,111,100,32,97,108,108,111,119,115,32,116,104,101,32, - 108,111,97,100,101,114,32,116,111,32,114,101,97,100,32,98, - 121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,32, - 32,32,32,32,32,32,32,82,97,105,115,101,115,32,79,83, - 69,114,114,111,114,32,119,104,101,110,32,116,104,101,32,112, - 97,116,104,32,99,97,110,110,111,116,32,98,101,32,104,97, - 110,100,108,101,100,46,10,32,32,32,32,32,32,32,32,114, - 193,0,0,0,41,1,114,246,0,0,0,114,245,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 10,112,97,116,104,95,115,116,97,116,115,99,3,0,0,115, - 2,0,0,0,0,12,122,23,83,111,117,114,99,101,76,111, - 97,100,101,114,46,112,97,116,104,95,115,116,97,116,115,99, - 4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 4,0,0,0,67,0,0,0,115,12,0,0,0,124,0,160, - 0,124,2,124,3,161,2,83,0,41,1,122,228,79,112,116, - 105,111,110,97,108,32,109,101,116,104,111,100,32,119,104,105, - 99,104,32,119,114,105,116,101,115,32,100,97,116,97,32,40, - 98,121,116,101,115,41,32,116,111,32,97,32,102,105,108,101, - 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, - 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, - 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, - 32,97,108,108,111,119,115,32,102,111,114,32,116,104,101,32, - 119,114,105,116,105,110,103,32,111,102,32,98,121,116,101,99, - 111,100,101,32,102,105,108,101,115,46,10,10,32,32,32,32, - 32,32,32,32,84,104,101,32,115,111,117,114,99,101,32,112, - 97,116,104,32,105,115,32,110,101,101,100,101,100,32,105,110, - 32,111,114,100,101,114,32,116,111,32,99,111,114,114,101,99, - 116,108,121,32,116,114,97,110,115,102,101,114,32,112,101,114, - 109,105,115,115,105,111,110,115,10,32,32,32,32,32,32,32, - 32,41,1,218,8,115,101,116,95,100,97,116,97,41,4,114, - 142,0,0,0,114,133,0,0,0,90,10,99,97,99,104,101, - 95,112,97,116,104,114,43,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,15,95,99,97,99,104, - 101,95,98,121,116,101,99,111,100,101,113,3,0,0,115,2, - 0,0,0,0,8,122,28,83,111,117,114,99,101,76,111,97, - 100,101,114,46,95,99,97,99,104,101,95,98,121,116,101,99, - 111,100,101,99,3,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,83,0,41,2,122,150,79,112,116,105,111,110,97, - 108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119, - 114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101, - 115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116, - 104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32, - 32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103, - 32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108, - 111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116, - 105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32, - 102,105,108,101,115,46,10,32,32,32,32,32,32,32,32,78, - 114,10,0,0,0,41,3,114,142,0,0,0,114,65,0,0, - 0,114,43,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,248,0,0,0,123,3,0,0,115,2, - 0,0,0,0,1,122,21,83,111,117,114,99,101,76,111,97, - 100,101,114,46,115,101,116,95,100,97,116,97,99,2,0,0, - 0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0, - 0,67,0,0,0,115,84,0,0,0,124,0,160,0,124,1, - 161,1,125,2,122,14,124,0,160,1,124,2,161,1,125,3, - 87,0,110,50,4,0,116,2,121,74,1,0,125,4,1,0, - 122,26,116,3,100,1,124,1,100,2,141,2,124,4,130,2, - 87,0,89,0,100,3,125,4,126,4,110,10,100,3,125,4, - 126,4,48,0,48,0,116,4,124,3,131,1,83,0,41,4, - 122,52,67,111,110,99,114,101,116,101,32,105,109,112,108,101, - 109,101,110,116,97,116,105,111,110,32,111,102,32,73,110,115, - 112,101,99,116,76,111,97,100,101,114,46,103,101,116,95,115, - 111,117,114,99,101,46,122,39,115,111,117,114,99,101,32,110, - 111,116,32,97,118,97,105,108,97,98,108,101,32,116,104,114, - 111,117,103,104,32,103,101,116,95,100,97,116,97,40,41,114, - 139,0,0,0,78,41,5,114,203,0,0,0,218,8,103,101, - 116,95,100,97,116,97,114,76,0,0,0,114,141,0,0,0, - 114,200,0,0,0,41,5,114,142,0,0,0,114,163,0,0, - 0,114,65,0,0,0,114,198,0,0,0,218,3,101,120,99, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 10,103,101,116,95,115,111,117,114,99,101,130,3,0,0,115, - 20,0,0,0,0,2,10,1,2,1,14,1,14,1,4,1, - 2,255,4,1,2,255,24,2,122,23,83,111,117,114,99,101, - 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, - 101,114,129,0,0,0,41,1,218,9,95,111,112,116,105,109, - 105,122,101,99,3,0,0,0,0,0,0,0,1,0,0,0, - 4,0,0,0,8,0,0,0,67,0,0,0,115,22,0,0, - 0,116,0,106,1,116,2,124,1,124,2,100,1,100,2,124, - 3,100,3,141,6,83,0,41,4,122,130,82,101,116,117,114, - 110,32,116,104,101,32,99,111,100,101,32,111,98,106,101,99, - 116,32,99,111,109,112,105,108,101,100,32,102,114,111,109,32, - 115,111,117,114,99,101,46,10,10,32,32,32,32,32,32,32, - 32,84,104,101,32,39,100,97,116,97,39,32,97,114,103,117, - 109,101,110,116,32,99,97,110,32,98,101,32,97,110,121,32, - 111,98,106,101,99,116,32,116,121,112,101,32,116,104,97,116, - 32,99,111,109,112,105,108,101,40,41,32,115,117,112,112,111, - 114,116,115,46,10,32,32,32,32,32,32,32,32,114,238,0, - 0,0,84,41,2,218,12,100,111,110,116,95,105,110,104,101, - 114,105,116,114,107,0,0,0,41,3,114,158,0,0,0,114, - 237,0,0,0,218,7,99,111,109,112,105,108,101,41,4,114, - 142,0,0,0,114,43,0,0,0,114,65,0,0,0,114,253, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,14,115,111,117,114,99,101,95,116,111,95,99,111, - 100,101,140,3,0,0,115,6,0,0,0,0,5,12,1,4, - 255,122,27,83,111,117,114,99,101,76,111,97,100,101,114,46, - 115,111,117,114,99,101,95,116,111,95,99,111,100,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,9, - 0,0,0,67,0,0,0,115,24,2,0,0,124,0,160,0, - 124,1,161,1,125,2,100,1,125,3,100,1,125,4,100,1, - 125,5,100,2,125,6,100,3,125,7,122,12,116,1,124,2, - 131,1,125,8,87,0,110,24,4,0,116,2,121,66,1,0, - 1,0,1,0,100,1,125,8,89,0,144,1,110,42,48,0, - 122,14,124,0,160,3,124,2,161,1,125,9,87,0,110,20, - 4,0,116,4,121,102,1,0,1,0,1,0,89,0,144,1, - 110,6,48,0,116,5,124,9,100,4,25,0,131,1,125,3, - 122,14,124,0,160,6,124,8,161,1,125,10,87,0,110,18, - 4,0,116,4,121,148,1,0,1,0,1,0,89,0,110,216, - 48,0,124,1,124,8,100,5,156,2,125,11,122,148,116,7, - 124,10,124,1,124,11,131,3,125,12,116,8,124,10,131,1, - 100,6,100,1,133,2,25,0,125,13,124,12,100,7,64,0, - 100,8,107,3,125,6,124,6,144,1,114,30,124,12,100,9, - 64,0,100,8,107,3,125,7,116,9,106,10,100,10,107,3, - 144,1,114,50,124,7,115,248,116,9,106,10,100,11,107,2, - 144,1,114,50,124,0,160,6,124,2,161,1,125,4,116,9, - 160,11,116,12,124,4,161,2,125,5,116,13,124,10,124,5, - 124,1,124,11,131,4,1,0,110,20,116,14,124,10,124,3, - 124,9,100,12,25,0,124,1,124,11,131,5,1,0,87,0, - 110,24,4,0,116,15,116,16,102,2,144,1,121,76,1,0, - 1,0,1,0,89,0,110,32,48,0,116,17,160,18,100,13, - 124,8,124,2,161,3,1,0,116,19,124,13,124,1,124,8, - 124,2,100,14,141,4,83,0,124,4,100,1,117,0,144,1, - 114,128,124,0,160,6,124,2,161,1,125,4,124,0,160,20, - 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, - 161,2,1,0,116,21,106,22,144,2,115,20,124,8,100,1, - 117,1,144,2,114,20,124,3,100,1,117,1,144,2,114,20, - 124,6,144,1,114,220,124,5,100,1,117,0,144,1,114,206, - 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, - 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, - 124,4,131,1,131,3,125,10,122,18,124,0,160,26,124,2, - 124,8,124,10,161,3,1,0,87,0,110,20,4,0,116,2, - 144,2,121,18,1,0,1,0,1,0,89,0,110,2,48,0, - 124,14,83,0,41,16,122,190,67,111,110,99,114,101,116,101, - 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, - 111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114, - 46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32, - 32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98, - 121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115, - 32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98, - 101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84, - 111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32, - 98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97, - 116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32, - 105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32, - 32,32,32,32,32,32,78,70,84,114,193,0,0,0,114,183, - 0,0,0,114,169,0,0,0,114,4,0,0,0,114,0,0, - 0,0,114,45,0,0,0,90,5,110,101,118,101,114,90,6, - 97,108,119,97,121,115,218,4,115,105,122,101,122,13,123,125, - 32,109,97,116,99,104,101,115,32,123,125,41,3,114,140,0, - 0,0,114,131,0,0,0,114,133,0,0,0,122,19,99,111, - 100,101,32,111,98,106,101,99,116,32,102,114,111,109,32,123, - 125,41,27,114,203,0,0,0,114,120,0,0,0,114,106,0, - 0,0,114,247,0,0,0,114,76,0,0,0,114,36,0,0, - 0,114,250,0,0,0,114,176,0,0,0,218,10,109,101,109, - 111,114,121,118,105,101,119,114,187,0,0,0,90,21,99,104, - 101,99,107,95,104,97,115,104,95,98,97,115,101,100,95,112, - 121,99,115,114,181,0,0,0,218,17,95,82,65,87,95,77, - 65,71,73,67,95,78,85,77,66,69,82,114,182,0,0,0, - 114,180,0,0,0,114,141,0,0,0,114,174,0,0,0,114, - 158,0,0,0,114,173,0,0,0,114,189,0,0,0,114,0, - 1,0,0,114,21,0,0,0,218,19,100,111,110,116,95,119, - 114,105,116,101,95,98,121,116,101,99,111,100,101,114,195,0, - 0,0,114,194,0,0,0,114,6,0,0,0,114,249,0,0, - 0,41,15,114,142,0,0,0,114,163,0,0,0,114,133,0, - 0,0,114,178,0,0,0,114,198,0,0,0,114,181,0,0, - 0,90,10,104,97,115,104,95,98,97,115,101,100,90,12,99, - 104,101,99,107,95,115,111,117,114,99,101,114,131,0,0,0, - 218,2,115,116,114,43,0,0,0,114,175,0,0,0,114,22, - 0,0,0,90,10,98,121,116,101,115,95,100,97,116,97,90, - 11,99,111,100,101,95,111,98,106,101,99,116,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,236,0,0,0, - 148,3,0,0,115,152,0,0,0,0,7,10,1,4,1,4, - 1,4,1,4,1,4,1,2,1,12,1,12,1,12,2,2, - 1,14,1,12,1,8,2,12,1,2,1,14,1,12,1,6, - 3,2,1,2,254,6,4,2,1,12,1,16,1,12,1,6, - 1,12,1,12,1,2,255,2,2,8,254,4,3,10,1,4, - 1,2,1,2,254,4,4,8,1,2,255,6,3,2,1,2, - 1,2,1,6,1,2,1,2,251,8,7,18,1,6,2,8, - 1,2,255,4,2,6,1,2,1,2,254,6,3,10,1,10, - 1,12,1,12,1,18,1,6,255,4,2,6,1,10,1,10, - 1,14,2,6,1,6,255,4,2,2,1,18,1,14,1,6, - 1,122,21,83,111,117,114,99,101,76,111,97,100,101,114,46, - 103,101,116,95,99,111,100,101,78,41,10,114,149,0,0,0, - 114,148,0,0,0,114,150,0,0,0,114,246,0,0,0,114, - 247,0,0,0,114,249,0,0,0,114,248,0,0,0,114,252, - 0,0,0,114,0,1,0,0,114,236,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,244,0,0,0,89,3,0,0,115,14,0,0,0,8, - 2,8,8,8,14,8,10,8,7,8,10,14,8,114,244,0, - 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,4,0,0,0,0,0,0,0,115,124,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, - 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, - 132,0,90,6,101,7,135,0,102,1,100,8,100,9,132,8, - 131,1,90,8,101,7,100,10,100,11,132,0,131,1,90,9, - 100,12,100,13,132,0,90,10,101,7,100,14,100,15,132,0, - 131,1,90,11,100,16,100,17,132,0,90,12,100,18,100,19, - 132,0,90,13,100,20,100,21,132,0,90,14,100,22,100,23, - 132,0,90,15,135,0,4,0,90,16,83,0,41,24,218,10, - 70,105,108,101,76,111,97,100,101,114,122,103,66,97,115,101, - 32,102,105,108,101,32,108,111,97,100,101,114,32,99,108,97, - 115,115,32,119,104,105,99,104,32,105,109,112,108,101,109,101, - 110,116,115,32,116,104,101,32,108,111,97,100,101,114,32,112, - 114,111,116,111,99,111,108,32,109,101,116,104,111,100,115,32, - 116,104,97,116,10,32,32,32,32,114,101,113,117,105,114,101, - 32,102,105,108,101,32,115,121,115,116,101,109,32,117,115,97, - 103,101,46,99,3,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0, - 0,124,1,124,0,95,0,124,2,124,0,95,1,100,1,83, - 0,41,2,122,75,67,97,99,104,101,32,116,104,101,32,109, - 111,100,117,108,101,32,110,97,109,101,32,97,110,100,32,116, - 104,101,32,112,97,116,104,32,116,111,32,116,104,101,32,102, - 105,108,101,32,102,111,117,110,100,32,98,121,32,116,104,101, - 10,32,32,32,32,32,32,32,32,102,105,110,100,101,114,46, - 78,114,183,0,0,0,41,3,114,142,0,0,0,114,163,0, - 0,0,114,65,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,232,0,0,0,238,3,0,0,115, - 4,0,0,0,0,3,6,1,122,19,70,105,108,101,76,111, - 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, - 0,0,67,0,0,0,115,24,0,0,0,124,0,106,0,124, - 1,106,0,107,2,111,22,124,0,106,1,124,1,106,1,107, - 2,83,0,114,69,0,0,0,169,2,218,9,95,95,99,108, - 97,115,115,95,95,114,155,0,0,0,169,2,114,142,0,0, - 0,90,5,111,116,104,101,114,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,6,95,95,101,113,95,95,244, - 3,0,0,115,6,0,0,0,0,1,12,1,10,255,122,17, - 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, - 95,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, - 0,0,3,0,0,0,67,0,0,0,115,20,0,0,0,116, - 0,124,0,106,1,131,1,116,0,124,0,106,2,131,1,65, - 0,83,0,114,69,0,0,0,169,3,218,4,104,97,115,104, - 114,140,0,0,0,114,65,0,0,0,169,1,114,142,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,8,95,95,104,97,115,104,95,95,248,3,0,0,115,2, - 0,0,0,0,1,122,19,70,105,108,101,76,111,97,100,101, - 114,46,95,95,104,97,115,104,95,95,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,3, - 0,0,0,115,16,0,0,0,116,0,116,1,124,0,131,2, - 160,2,124,1,161,1,83,0,41,1,122,100,76,111,97,100, - 32,97,32,109,111,100,117,108,101,32,102,114,111,109,32,97, - 32,102,105,108,101,46,10,10,32,32,32,32,32,32,32,32, - 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, - 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, - 101,120,101,99,95,109,111,100,117,108,101,40,41,32,105,110, - 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, - 41,3,218,5,115,117,112,101,114,114,6,1,0,0,114,243, - 0,0,0,114,242,0,0,0,169,1,114,8,1,0,0,114, - 10,0,0,0,114,11,0,0,0,114,243,0,0,0,251,3, - 0,0,115,2,0,0,0,0,10,122,22,70,105,108,101,76, - 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124, - 0,106,0,83,0,169,1,122,58,82,101,116,117,114,110,32, - 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,32, - 115,111,117,114,99,101,32,102,105,108,101,32,97,115,32,102, - 111,117,110,100,32,98,121,32,116,104,101,32,102,105,110,100, - 101,114,46,114,71,0,0,0,114,242,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,203,0,0, - 0,7,4,0,0,115,2,0,0,0,0,3,122,23,70,105, - 108,101,76,111,97,100,101,114,46,103,101,116,95,102,105,108, - 101,110,97,109,101,99,2,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,8,0,0,0,67,0,0,0,115,126, - 0,0,0,116,0,124,0,116,1,116,2,102,2,131,2,114, - 70,116,3,160,4,116,5,124,1,131,1,161,1,143,24,125, - 2,124,2,160,6,161,0,87,0,2,0,100,1,4,0,4, - 0,131,3,1,0,83,0,49,0,115,58,48,0,1,0,1, - 0,1,0,89,0,1,0,110,52,116,3,160,7,124,1,100, - 2,161,2,143,24,125,2,124,2,160,6,161,0,87,0,2, - 0,100,1,4,0,4,0,131,3,1,0,83,0,49,0,115, - 112,48,0,1,0,1,0,1,0,89,0,1,0,100,1,83, - 0,41,3,122,39,82,101,116,117,114,110,32,116,104,101,32, - 100,97,116,97,32,102,114,111,109,32,112,97,116,104,32,97, - 115,32,114,97,119,32,98,121,116,101,115,46,78,218,1,114, - 41,8,114,185,0,0,0,114,244,0,0,0,218,19,69,120, - 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, - 114,114,90,0,0,0,90,9,111,112,101,110,95,99,111,100, - 101,114,108,0,0,0,90,4,114,101,97,100,114,91,0,0, - 0,41,3,114,142,0,0,0,114,65,0,0,0,114,93,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,250,0,0,0,12,4,0,0,115,10,0,0,0,0, - 2,14,1,16,1,40,2,14,1,122,19,70,105,108,101,76, - 111,97,100,101,114,46,103,101,116,95,100,97,116,97,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,67,0,0,0,115,18,0,0,0,124,0,160,0, - 124,1,161,1,114,14,124,0,83,0,100,0,83,0,114,69, - 0,0,0,41,1,114,206,0,0,0,169,2,114,142,0,0, - 0,114,239,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,19,103,101,116,95,114,101,115,111,117, - 114,99,101,95,114,101,97,100,101,114,23,4,0,0,115,6, - 0,0,0,0,2,10,1,4,1,122,30,70,105,108,101,76, - 111,97,100,101,114,46,103,101,116,95,114,101,115,111,117,114, - 99,101,95,114,101,97,100,101,114,99,2,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, - 0,0,115,32,0,0,0,116,0,116,1,124,0,106,2,131, - 1,100,1,25,0,124,1,131,2,125,2,116,3,160,4,124, - 2,100,2,161,2,83,0,41,3,78,114,0,0,0,0,114, - 18,1,0,0,41,5,114,67,0,0,0,114,74,0,0,0, - 114,65,0,0,0,114,90,0,0,0,114,91,0,0,0,169, - 3,114,142,0,0,0,90,8,114,101,115,111,117,114,99,101, - 114,65,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,13,111,112,101,110,95,114,101,115,111,117, - 114,99,101,29,4,0,0,115,4,0,0,0,0,1,20,1, - 122,24,70,105,108,101,76,111,97,100,101,114,46,111,112,101, - 110,95,114,101,115,111,117,114,99,101,99,2,0,0,0,0, - 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, - 0,0,0,115,38,0,0,0,124,0,160,0,124,1,161,1, - 115,14,116,1,130,1,116,2,116,3,124,0,106,4,131,1, - 100,1,25,0,124,1,131,2,125,2,124,2,83,0,169,2, - 78,114,0,0,0,0,41,5,218,11,105,115,95,114,101,115, - 111,117,114,99,101,218,17,70,105,108,101,78,111,116,70,111, - 117,110,100,69,114,114,111,114,114,67,0,0,0,114,74,0, - 0,0,114,65,0,0,0,114,22,1,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,13,114,101,115, - 111,117,114,99,101,95,112,97,116,104,33,4,0,0,115,8, - 0,0,0,0,1,10,1,4,1,20,1,122,24,70,105,108, - 101,76,111,97,100,101,114,46,114,101,115,111,117,114,99,101, - 95,112,97,116,104,99,2,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,40, - 0,0,0,116,0,124,1,118,0,114,12,100,1,83,0,116, - 1,116,2,124,0,106,3,131,1,100,2,25,0,124,1,131, - 2,125,2,116,4,124,2,131,1,83,0,41,3,78,70,114, - 0,0,0,0,41,5,114,59,0,0,0,114,67,0,0,0, - 114,74,0,0,0,114,65,0,0,0,114,80,0,0,0,169, - 3,114,142,0,0,0,114,140,0,0,0,114,65,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 25,1,0,0,39,4,0,0,115,8,0,0,0,0,1,8, - 1,4,1,20,1,122,22,70,105,108,101,76,111,97,100,101, - 114,46,105,115,95,114,101,115,111,117,114,99,101,99,1,0, - 0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0, - 0,0,67,0,0,0,115,24,0,0,0,116,0,116,1,160, - 2,116,3,124,0,106,4,131,1,100,1,25,0,161,1,131, - 1,83,0,114,24,1,0,0,41,5,218,4,105,116,101,114, - 114,24,0,0,0,218,7,108,105,115,116,100,105,114,114,74, - 0,0,0,114,65,0,0,0,114,13,1,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,8,99,111, - 110,116,101,110,116,115,45,4,0,0,115,2,0,0,0,0, - 1,122,19,70,105,108,101,76,111,97,100,101,114,46,99,111, - 110,116,101,110,116,115,41,17,114,149,0,0,0,114,148,0, - 0,0,114,150,0,0,0,114,151,0,0,0,114,232,0,0, - 0,114,10,1,0,0,114,14,1,0,0,114,160,0,0,0, - 114,243,0,0,0,114,203,0,0,0,114,250,0,0,0,114, - 21,1,0,0,114,23,1,0,0,114,27,1,0,0,114,25, - 1,0,0,114,31,1,0,0,90,13,95,95,99,108,97,115, - 115,99,101,108,108,95,95,114,10,0,0,0,114,10,0,0, - 0,114,16,1,0,0,114,11,0,0,0,114,6,1,0,0, - 233,3,0,0,115,30,0,0,0,8,2,4,3,8,6,8, - 4,8,3,2,1,14,11,2,1,10,4,8,11,2,1,10, - 5,8,4,8,6,8,6,114,6,1,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,64,0,0,0,115,46,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, - 100,5,132,0,90,5,100,6,100,7,156,1,100,8,100,9, - 132,2,90,6,100,10,83,0,41,11,218,16,83,111,117,114, - 99,101,70,105,108,101,76,111,97,100,101,114,122,62,67,111, - 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, - 97,116,105,111,110,32,111,102,32,83,111,117,114,99,101,76, - 111,97,100,101,114,32,117,115,105,110,103,32,116,104,101,32, - 102,105,108,101,32,115,121,115,116,101,109,46,99,2,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0, - 0,67,0,0,0,115,22,0,0,0,116,0,124,1,131,1, - 125,2,124,2,106,1,124,2,106,2,100,1,156,2,83,0, - 41,2,122,33,82,101,116,117,114,110,32,116,104,101,32,109, - 101,116,97,100,97,116,97,32,102,111,114,32,116,104,101,32, - 112,97,116,104,46,41,2,114,193,0,0,0,114,1,1,0, - 0,41,3,114,75,0,0,0,218,8,115,116,95,109,116,105, - 109,101,90,7,115,116,95,115,105,122,101,41,3,114,142,0, - 0,0,114,65,0,0,0,114,5,1,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,247,0,0,0, - 53,4,0,0,115,4,0,0,0,0,2,8,1,122,27,83, - 111,117,114,99,101,70,105,108,101,76,111,97,100,101,114,46, - 112,97,116,104,95,115,116,97,116,115,99,4,0,0,0,0, - 0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,67, - 0,0,0,115,24,0,0,0,116,0,124,1,131,1,125,4, - 124,0,106,1,124,2,124,3,124,4,100,1,141,3,83,0, - 41,2,78,169,1,218,5,95,109,111,100,101,41,2,114,138, - 0,0,0,114,248,0,0,0,41,5,114,142,0,0,0,114, - 133,0,0,0,114,131,0,0,0,114,43,0,0,0,114,78, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,249,0,0,0,58,4,0,0,115,4,0,0,0, - 0,2,8,1,122,32,83,111,117,114,99,101,70,105,108,101, - 76,111,97,100,101,114,46,95,99,97,99,104,101,95,98,121, - 116,101,99,111,100,101,114,86,0,0,0,114,34,1,0,0, - 99,3,0,0,0,0,0,0,0,1,0,0,0,9,0,0, - 0,11,0,0,0,67,0,0,0,115,252,0,0,0,116,0, - 124,1,131,1,92,2,125,4,125,5,103,0,125,6,124,4, - 114,52,116,1,124,4,131,1,115,52,116,0,124,4,131,1, - 92,2,125,4,125,7,124,6,160,2,124,7,161,1,1,0, - 113,16,116,3,124,6,131,1,68,0,93,104,125,7,116,4, - 124,4,124,7,131,2,125,4,122,14,116,5,160,6,124,4, - 161,1,1,0,87,0,113,60,4,0,116,7,121,110,1,0, - 1,0,1,0,89,0,113,60,89,0,113,60,4,0,116,8, - 121,162,1,0,125,8,1,0,122,30,116,9,160,10,100,1, - 124,4,124,8,161,3,1,0,87,0,89,0,100,2,125,8, - 126,8,1,0,100,2,83,0,100,2,125,8,126,8,48,0, - 48,0,113,60,122,28,116,11,124,1,124,2,124,3,131,3, - 1,0,116,9,160,10,100,3,124,1,161,2,1,0,87,0, - 110,52,4,0,116,8,144,0,121,246,1,0,125,8,1,0, - 122,26,116,9,160,10,100,1,124,1,124,8,161,3,1,0, - 87,0,89,0,100,2,125,8,126,8,110,10,100,2,125,8, - 126,8,48,0,48,0,100,2,83,0,41,4,122,27,87,114, - 105,116,101,32,98,121,116,101,115,32,100,97,116,97,32,116, - 111,32,97,32,102,105,108,101,46,122,27,99,111,117,108,100, - 32,110,111,116,32,99,114,101,97,116,101,32,123,33,114,125, - 58,32,123,33,114,125,78,122,12,99,114,101,97,116,101,100, - 32,123,33,114,125,41,12,114,74,0,0,0,114,82,0,0, - 0,114,61,0,0,0,218,8,114,101,118,101,114,115,101,100, - 114,67,0,0,0,114,24,0,0,0,90,5,109,107,100,105, - 114,218,15,70,105,108,101,69,120,105,115,116,115,69,114,114, - 111,114,114,76,0,0,0,114,158,0,0,0,114,173,0,0, - 0,114,94,0,0,0,41,9,114,142,0,0,0,114,65,0, - 0,0,114,43,0,0,0,114,35,1,0,0,218,6,112,97, - 114,101,110,116,114,119,0,0,0,114,63,0,0,0,114,68, - 0,0,0,114,251,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,248,0,0,0,63,4,0,0, - 115,46,0,0,0,0,2,12,1,4,2,12,1,12,1,12, - 2,12,1,10,1,2,1,14,1,12,2,8,1,14,3,6, - 1,4,255,4,2,28,1,2,1,12,1,16,1,16,2,8, - 1,2,255,122,25,83,111,117,114,99,101,70,105,108,101,76, - 111,97,100,101,114,46,115,101,116,95,100,97,116,97,78,41, - 7,114,149,0,0,0,114,148,0,0,0,114,150,0,0,0, - 114,151,0,0,0,114,247,0,0,0,114,249,0,0,0,114, - 248,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,32,1,0,0,49,4,0, - 0,115,8,0,0,0,8,2,4,2,8,5,8,5,114,32, - 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,64,0,0,0,115,32,0,0, - 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, - 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,83, - 0,41,7,218,20,83,111,117,114,99,101,108,101,115,115,70, - 105,108,101,76,111,97,100,101,114,122,45,76,111,97,100,101, - 114,32,119,104,105,99,104,32,104,97,110,100,108,101,115,32, - 115,111,117,114,99,101,108,101,115,115,32,102,105,108,101,32, - 105,109,112,111,114,116,115,46,99,2,0,0,0,0,0,0, - 0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, - 0,115,68,0,0,0,124,0,160,0,124,1,161,1,125,2, - 124,0,160,1,124,2,161,1,125,3,124,1,124,2,100,1, - 156,2,125,4,116,2,124,3,124,1,124,4,131,3,1,0, - 116,3,116,4,124,3,131,1,100,2,100,0,133,2,25,0, - 124,1,124,2,100,3,141,3,83,0,41,4,78,114,183,0, - 0,0,114,169,0,0,0,41,2,114,140,0,0,0,114,131, - 0,0,0,41,5,114,203,0,0,0,114,250,0,0,0,114, - 176,0,0,0,114,189,0,0,0,114,2,1,0,0,41,5, - 114,142,0,0,0,114,163,0,0,0,114,65,0,0,0,114, - 43,0,0,0,114,175,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,236,0,0,0,98,4,0, - 0,115,22,0,0,0,0,1,10,1,10,4,2,1,2,254, - 6,4,12,1,2,1,14,1,2,1,2,253,122,29,83,111, - 117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100, - 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, - 39,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, - 116,104,101,114,101,32,105,115,32,110,111,32,115,111,117,114, - 99,101,32,99,111,100,101,46,78,114,10,0,0,0,114,242, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,252,0,0,0,114,4,0,0,115,2,0,0,0, - 0,2,122,31,83,111,117,114,99,101,108,101,115,115,70,105, - 108,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, - 114,99,101,78,41,6,114,149,0,0,0,114,148,0,0,0, - 114,150,0,0,0,114,151,0,0,0,114,236,0,0,0,114, - 252,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,39,1,0,0,94,4,0, - 0,115,6,0,0,0,8,2,4,2,8,16,114,39,1,0, - 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,64,0,0,0,115,92,0,0,0,101, - 0,90,1,100,0,90,2,100,1,90,3,100,2,100,3,132, - 0,90,4,100,4,100,5,132,0,90,5,100,6,100,7,132, - 0,90,6,100,8,100,9,132,0,90,7,100,10,100,11,132, - 0,90,8,100,12,100,13,132,0,90,9,100,14,100,15,132, - 0,90,10,100,16,100,17,132,0,90,11,101,12,100,18,100, - 19,132,0,131,1,90,13,100,20,83,0,41,21,114,19,1, - 0,0,122,93,76,111,97,100,101,114,32,102,111,114,32,101, - 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,115, - 46,10,10,32,32,32,32,84,104,101,32,99,111,110,115,116, - 114,117,99,116,111,114,32,105,115,32,100,101,115,105,103,110, - 101,100,32,116,111,32,119,111,114,107,32,119,105,116,104,32, - 70,105,108,101,70,105,110,100,101,114,46,10,10,32,32,32, - 32,99,3,0,0,0,0,0,0,0,0,0,0,0,3,0, - 0,0,8,0,0,0,67,0,0,0,115,62,0,0,0,124, - 1,124,0,95,0,116,1,124,2,131,1,115,52,122,18,116, - 2,116,3,160,4,161,0,124,2,131,2,125,2,87,0,110, - 18,4,0,116,5,121,50,1,0,1,0,1,0,89,0,110, - 2,48,0,124,2,124,0,95,6,100,0,83,0,114,69,0, - 0,0,41,7,114,140,0,0,0,114,85,0,0,0,114,67, - 0,0,0,114,24,0,0,0,114,81,0,0,0,114,76,0, - 0,0,114,65,0,0,0,114,28,1,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,232,0,0,0, - 131,4,0,0,115,14,0,0,0,0,1,6,1,8,1,2, - 1,18,1,12,1,6,1,122,28,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, - 110,105,116,95,95,99,2,0,0,0,0,0,0,0,0,0, - 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,24, - 0,0,0,124,0,106,0,124,1,106,0,107,2,111,22,124, - 0,106,1,124,1,106,1,107,2,83,0,114,69,0,0,0, - 114,7,1,0,0,114,9,1,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,10,1,0,0,140,4, - 0,0,115,6,0,0,0,0,1,12,1,10,255,122,26,69, - 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, - 101,114,46,95,95,101,113,95,95,99,1,0,0,0,0,0, - 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, - 0,0,115,20,0,0,0,116,0,124,0,106,1,131,1,116, - 0,124,0,106,2,131,1,65,0,83,0,114,69,0,0,0, - 114,11,1,0,0,114,13,1,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,14,1,0,0,144,4, - 0,0,115,2,0,0,0,0,1,122,28,69,120,116,101,110, - 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,95, - 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,5,0,0,0,67,0,0,0, - 115,36,0,0,0,116,0,160,1,116,2,106,3,124,1,161, - 2,125,2,116,0,160,4,100,1,124,1,106,5,124,0,106, - 6,161,3,1,0,124,2,83,0,41,2,122,38,67,114,101, - 97,116,101,32,97,110,32,117,110,105,116,105,97,108,105,122, - 101,100,32,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,122,38,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,32,123,33,114,125,32,108,111,97,100,101, - 100,32,102,114,111,109,32,123,33,114,125,41,7,114,158,0, - 0,0,114,237,0,0,0,114,187,0,0,0,90,14,99,114, - 101,97,116,101,95,100,121,110,97,109,105,99,114,173,0,0, - 0,114,140,0,0,0,114,65,0,0,0,41,3,114,142,0, - 0,0,114,210,0,0,0,114,239,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,235,0,0,0, - 147,4,0,0,115,14,0,0,0,0,2,4,1,6,255,4, - 2,6,1,8,255,4,2,122,33,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,99,114,101, - 97,116,101,95,109,111,100,117,108,101,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,5,0,0,0,67, - 0,0,0,115,36,0,0,0,116,0,160,1,116,2,106,3, - 124,1,161,2,1,0,116,0,160,4,100,1,124,0,106,5, - 124,0,106,6,161,3,1,0,100,2,83,0,41,3,122,30, - 73,110,105,116,105,97,108,105,122,101,32,97,110,32,101,120, - 116,101,110,115,105,111,110,32,109,111,100,117,108,101,122,40, - 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, - 32,123,33,114,125,32,101,120,101,99,117,116,101,100,32,102, - 114,111,109,32,123,33,114,125,78,41,7,114,158,0,0,0, - 114,237,0,0,0,114,187,0,0,0,90,12,101,120,101,99, - 95,100,121,110,97,109,105,99,114,173,0,0,0,114,140,0, - 0,0,114,65,0,0,0,114,20,1,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,240,0,0,0, - 155,4,0,0,115,8,0,0,0,0,2,14,1,6,1,8, - 255,122,31,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, - 108,101,99,2,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,3,0,0,0,115,36,0,0,0, - 116,0,124,0,106,1,131,1,100,1,25,0,137,0,116,2, - 135,0,102,1,100,2,100,3,132,8,116,3,68,0,131,1, - 131,1,83,0,41,4,122,49,82,101,116,117,114,110,32,84, - 114,117,101,32,105,102,32,116,104,101,32,101,120,116,101,110, - 115,105,111,110,32,109,111,100,117,108,101,32,105,115,32,97, - 32,112,97,99,107,97,103,101,46,114,4,0,0,0,99,1, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,51,0,0,0,115,26,0,0,0,124,0,93,18, - 125,1,136,0,100,0,124,1,23,0,107,2,86,0,1,0, - 113,2,100,1,83,0,41,2,114,232,0,0,0,78,114,10, - 0,0,0,169,2,114,8,0,0,0,218,6,115,117,102,102, - 105,120,169,1,90,9,102,105,108,101,95,110,97,109,101,114, - 10,0,0,0,114,11,0,0,0,114,12,0,0,0,164,4, - 0,0,115,4,0,0,0,4,1,2,255,122,49,69,120,116, - 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,105,115,95,112,97,99,107,97,103,101,46,60,108,111,99, - 97,108,115,62,46,60,103,101,110,101,120,112,114,62,41,4, - 114,74,0,0,0,114,65,0,0,0,218,3,97,110,121,218, - 18,69,88,84,69,78,83,73,79,78,95,83,85,70,70,73, - 88,69,83,114,242,0,0,0,114,10,0,0,0,114,42,1, - 0,0,114,11,0,0,0,114,206,0,0,0,161,4,0,0, - 115,8,0,0,0,0,2,14,1,12,1,2,255,122,30,69, - 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, - 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,122,63,82,101,116,117,114,110,32,78,111,110,101,32,97, - 115,32,97,110,32,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,32,99,97,110,110,111,116,32,99,114,101, - 97,116,101,32,97,32,99,111,100,101,32,111,98,106,101,99, - 116,46,78,114,10,0,0,0,114,242,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,236,0,0, - 0,167,4,0,0,115,2,0,0,0,0,2,122,28,69,120, - 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, - 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,41,2,122,53, - 82,101,116,117,114,110,32,78,111,110,101,32,97,115,32,101, - 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,115, - 32,104,97,118,101,32,110,111,32,115,111,117,114,99,101,32, - 99,111,100,101,46,78,114,10,0,0,0,114,242,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 252,0,0,0,171,4,0,0,115,2,0,0,0,0,2,122, - 30,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, - 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,99, - 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, - 0,83,0,114,17,1,0,0,114,71,0,0,0,114,242,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,203,0,0,0,175,4,0,0,115,2,0,0,0,0, - 3,122,32,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, - 97,109,101,78,41,14,114,149,0,0,0,114,148,0,0,0, - 114,150,0,0,0,114,151,0,0,0,114,232,0,0,0,114, - 10,1,0,0,114,14,1,0,0,114,235,0,0,0,114,240, - 0,0,0,114,206,0,0,0,114,236,0,0,0,114,252,0, - 0,0,114,160,0,0,0,114,203,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,19,1,0,0,123,4,0,0,115,22,0,0,0,8,2, - 4,6,8,9,8,4,8,3,8,8,8,6,8,6,8,4, - 8,4,2,1,114,19,1,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,104,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, - 0,90,7,100,10,100,11,132,0,90,8,100,12,100,13,132, - 0,90,9,100,14,100,15,132,0,90,10,100,16,100,17,132, - 0,90,11,100,18,100,19,132,0,90,12,100,20,100,21,132, - 0,90,13,100,22,100,23,132,0,90,14,100,24,83,0,41, - 25,218,14,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,97,38,1,0,0,82,101,112,114,101,115,101,110,116,115, - 32,97,32,110,97,109,101,115,112,97,99,101,32,112,97,99, - 107,97,103,101,39,115,32,112,97,116,104,46,32,32,73,116, - 32,117,115,101,115,32,116,104,101,32,109,111,100,117,108,101, - 32,110,97,109,101,10,32,32,32,32,116,111,32,102,105,110, - 100,32,105,116,115,32,112,97,114,101,110,116,32,109,111,100, - 117,108,101,44,32,97,110,100,32,102,114,111,109,32,116,104, - 101,114,101,32,105,116,32,108,111,111,107,115,32,117,112,32, - 116,104,101,32,112,97,114,101,110,116,39,115,10,32,32,32, - 32,95,95,112,97,116,104,95,95,46,32,32,87,104,101,110, - 32,116,104,105,115,32,99,104,97,110,103,101,115,44,32,116, - 104,101,32,109,111,100,117,108,101,39,115,32,111,119,110,32, - 112,97,116,104,32,105,115,32,114,101,99,111,109,112,117,116, - 101,100,44,10,32,32,32,32,117,115,105,110,103,32,112,97, - 116,104,95,102,105,110,100,101,114,46,32,32,70,111,114,32, - 116,111,112,45,108,101,118,101,108,32,109,111,100,117,108,101, - 115,44,32,116,104,101,32,112,97,114,101,110,116,32,109,111, - 100,117,108,101,39,115,32,112,97,116,104,10,32,32,32,32, - 105,115,32,115,121,115,46,112,97,116,104,46,99,4,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,3,0,0, - 0,67,0,0,0,115,36,0,0,0,124,1,124,0,95,0, - 124,2,124,0,95,1,116,2,124,0,160,3,161,0,131,1, - 124,0,95,4,124,3,124,0,95,5,100,0,83,0,114,69, - 0,0,0,41,6,218,5,95,110,97,109,101,218,5,95,112, - 97,116,104,114,135,0,0,0,218,16,95,103,101,116,95,112, - 97,114,101,110,116,95,112,97,116,104,218,17,95,108,97,115, - 116,95,112,97,114,101,110,116,95,112,97,116,104,218,12,95, - 112,97,116,104,95,102,105,110,100,101,114,169,4,114,142,0, - 0,0,114,140,0,0,0,114,65,0,0,0,90,11,112,97, - 116,104,95,102,105,110,100,101,114,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,232,0,0,0,188,4,0, - 0,115,8,0,0,0,0,1,6,1,6,1,14,1,122,23, - 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, - 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, - 0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0, - 115,38,0,0,0,124,0,106,0,160,1,100,1,161,1,92, - 3,125,1,125,2,125,3,124,2,100,2,107,2,114,30,100, - 3,83,0,124,1,100,4,102,2,83,0,41,5,122,62,82, - 101,116,117,114,110,115,32,97,32,116,117,112,108,101,32,111, - 102,32,40,112,97,114,101,110,116,45,109,111,100,117,108,101, - 45,110,97,109,101,44,32,112,97,114,101,110,116,45,112,97, - 116,104,45,97,116,116,114,45,110,97,109,101,41,114,96,0, - 0,0,114,14,0,0,0,41,2,114,21,0,0,0,114,65, - 0,0,0,90,8,95,95,112,97,116,104,95,95,41,2,114, - 46,1,0,0,114,103,0,0,0,41,4,114,142,0,0,0, - 114,38,1,0,0,218,3,100,111,116,90,2,109,101,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,23,95, - 102,105,110,100,95,112,97,114,101,110,116,95,112,97,116,104, - 95,110,97,109,101,115,194,4,0,0,115,8,0,0,0,0, - 2,18,1,8,2,4,3,122,38,95,78,97,109,101,115,112, - 97,99,101,80,97,116,104,46,95,102,105,110,100,95,112,97, - 114,101,110,116,95,112,97,116,104,95,110,97,109,101,115,99, - 1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, - 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, - 1,25,0,124,2,131,2,83,0,114,69,0,0,0,41,4, - 114,53,1,0,0,114,154,0,0,0,114,21,0,0,0,218, - 7,109,111,100,117,108,101,115,41,3,114,142,0,0,0,90, - 18,112,97,114,101,110,116,95,109,111,100,117,108,101,95,110, - 97,109,101,90,14,112,97,116,104,95,97,116,116,114,95,110, - 97,109,101,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,48,1,0,0,204,4,0,0,115,4,0,0,0, - 0,1,12,1,122,31,95,78,97,109,101,115,112,97,99,101, - 80,97,116,104,46,95,103,101,116,95,112,97,114,101,110,116, - 95,112,97,116,104,99,1,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,80, - 0,0,0,116,0,124,0,160,1,161,0,131,1,125,1,124, - 1,124,0,106,2,107,3,114,74,124,0,160,3,124,0,106, - 4,124,1,161,2,125,2,124,2,100,0,117,1,114,68,124, - 2,106,5,100,0,117,0,114,68,124,2,106,6,114,68,124, - 2,106,6,124,0,95,7,124,1,124,0,95,2,124,0,106, - 7,83,0,114,69,0,0,0,41,8,114,135,0,0,0,114, - 48,1,0,0,114,49,1,0,0,114,50,1,0,0,114,46, - 1,0,0,114,164,0,0,0,114,202,0,0,0,114,47,1, - 0,0,41,3,114,142,0,0,0,90,11,112,97,114,101,110, - 116,95,112,97,116,104,114,210,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,12,95,114,101,99, - 97,108,99,117,108,97,116,101,208,4,0,0,115,16,0,0, - 0,0,2,12,1,10,1,14,3,18,1,6,1,8,1,6, - 1,122,27,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,114,101,99,97,108,99,117,108,97,116,101,99,1, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,0, - 160,1,161,0,131,1,83,0,114,69,0,0,0,41,2,114, - 29,1,0,0,114,55,1,0,0,114,13,1,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, - 95,105,116,101,114,95,95,221,4,0,0,115,2,0,0,0, - 0,1,122,23,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,95,105,116,101,114,95,95,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, - 67,0,0,0,115,12,0,0,0,124,0,160,0,161,0,124, - 1,25,0,83,0,114,69,0,0,0,169,1,114,55,1,0, - 0,41,2,114,142,0,0,0,218,5,105,110,100,101,120,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,11, - 95,95,103,101,116,105,116,101,109,95,95,224,4,0,0,115, - 2,0,0,0,0,1,122,26,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,95,103,101,116,105,116,101,109, - 95,95,99,3,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,3,0,0,0,67,0,0,0,115,14,0,0,0, - 124,2,124,0,106,0,124,1,60,0,100,0,83,0,114,69, - 0,0,0,41,1,114,47,1,0,0,41,3,114,142,0,0, - 0,114,58,1,0,0,114,65,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,11,95,95,115,101, - 116,105,116,101,109,95,95,227,4,0,0,115,2,0,0,0, - 0,1,122,26,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,95,115,101,116,105,116,101,109,95,95,99,1, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,0, - 160,1,161,0,131,1,83,0,114,69,0,0,0,41,2,114, - 6,0,0,0,114,55,1,0,0,114,13,1,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,7,95, - 95,108,101,110,95,95,230,4,0,0,115,2,0,0,0,0, - 1,122,22,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,95,108,101,110,95,95,99,1,0,0,0,0,0, - 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, - 0,0,115,12,0,0,0,100,1,160,0,124,0,106,1,161, - 1,83,0,41,2,78,122,20,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,40,123,33,114,125,41,41,2,114,88, - 0,0,0,114,47,1,0,0,114,13,1,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,8,95,95, - 114,101,112,114,95,95,233,4,0,0,115,2,0,0,0,0, - 1,122,23,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, - 0,0,0,115,12,0,0,0,124,1,124,0,160,0,161,0, - 118,0,83,0,114,69,0,0,0,114,57,1,0,0,169,2, - 114,142,0,0,0,218,4,105,116,101,109,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,12,95,95,99,111, - 110,116,97,105,110,115,95,95,236,4,0,0,115,2,0,0, - 0,0,1,122,27,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,95,99,111,110,116,97,105,110,115,95,95, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,67,0,0,0,115,16,0,0,0,124,0, - 106,0,160,1,124,1,161,1,1,0,100,0,83,0,114,69, - 0,0,0,41,2,114,47,1,0,0,114,61,0,0,0,114, - 63,1,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,61,0,0,0,239,4,0,0,115,2,0,0, - 0,0,1,122,21,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,97,112,112,101,110,100,78,41,15,114,149,0, - 0,0,114,148,0,0,0,114,150,0,0,0,114,151,0,0, - 0,114,232,0,0,0,114,53,1,0,0,114,48,1,0,0, - 114,55,1,0,0,114,56,1,0,0,114,59,1,0,0,114, - 60,1,0,0,114,61,1,0,0,114,62,1,0,0,114,65, - 1,0,0,114,61,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,45,1,0, - 0,181,4,0,0,115,24,0,0,0,8,1,4,6,8,6, - 8,10,8,4,8,13,8,3,8,3,8,3,8,3,8,3, - 8,3,114,45,1,0,0,99,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,0, - 115,80,0,0,0,101,0,90,1,100,0,90,2,100,1,100, - 2,132,0,90,3,101,4,100,3,100,4,132,0,131,1,90, - 5,100,5,100,6,132,0,90,6,100,7,100,8,132,0,90, - 7,100,9,100,10,132,0,90,8,100,11,100,12,132,0,90, - 9,100,13,100,14,132,0,90,10,100,15,100,16,132,0,90, - 11,100,17,83,0,41,18,218,16,95,78,97,109,101,115,112, - 97,99,101,76,111,97,100,101,114,99,4,0,0,0,0,0, - 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0, - 0,0,115,18,0,0,0,116,0,124,1,124,2,124,3,131, - 3,124,0,95,1,100,0,83,0,114,69,0,0,0,41,2, - 114,45,1,0,0,114,47,1,0,0,114,51,1,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,232, - 0,0,0,245,4,0,0,115,2,0,0,0,0,1,122,25, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,95,95,105,110,105,116,95,95,99,2,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,12,0,0,0,100,1,160,0,124,1,106,1,161, - 1,83,0,41,2,122,115,82,101,116,117,114,110,32,114,101, - 112,114,32,102,111,114,32,116,104,101,32,109,111,100,117,108, - 101,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, - 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, - 97,116,101,100,46,32,32,84,104,101,32,105,109,112,111,114, - 116,32,109,97,99,104,105,110,101,114,121,32,100,111,101,115, - 32,116,104,101,32,106,111,98,32,105,116,115,101,108,102,46, - 10,10,32,32,32,32,32,32,32,32,122,25,60,109,111,100, - 117,108,101,32,123,33,114,125,32,40,110,97,109,101,115,112, - 97,99,101,41,62,41,2,114,88,0,0,0,114,149,0,0, - 0,41,2,114,216,0,0,0,114,239,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,11,109,111, - 100,117,108,101,95,114,101,112,114,248,4,0,0,115,2,0, - 0,0,0,7,122,28,95,78,97,109,101,115,112,97,99,101, - 76,111,97,100,101,114,46,109,111,100,117,108,101,95,114,101, - 112,114,99,2,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,1,83,0,41,2,78,84,114,10,0,0,0,114,242,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,206,0,0,0,1,5,0,0,115,2,0,0,0,0, - 1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, - 100,101,114,46,105,115,95,112,97,99,107,97,103,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,78,114,14,0,0,0,114,10,0,0,0,114,242,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,252,0,0,0,4,5,0,0,115,2,0,0,0,0, - 1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, - 100,101,114,46,103,101,116,95,115,111,117,114,99,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,6, - 0,0,0,67,0,0,0,115,16,0,0,0,116,0,100,1, - 100,2,100,3,100,4,100,5,141,4,83,0,41,6,78,114, - 14,0,0,0,122,8,60,115,116,114,105,110,103,62,114,238, - 0,0,0,84,41,1,114,254,0,0,0,41,1,114,255,0, - 0,0,114,242,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,236,0,0,0,7,5,0,0,115, - 2,0,0,0,0,1,122,25,95,78,97,109,101,115,112,97, - 99,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, - 1,83,0,114,233,0,0,0,114,10,0,0,0,114,234,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,235,0,0,0,10,5,0,0,115,2,0,0,0,0, - 1,122,30,95,78,97,109,101,115,112,97,99,101,76,111,97, - 100,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, - 0,83,0,114,69,0,0,0,114,10,0,0,0,114,20,1, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,240,0,0,0,13,5,0,0,115,2,0,0,0,0, - 1,122,28,95,78,97,109,101,115,112,97,99,101,76,111,97, - 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,99, - 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 4,0,0,0,67,0,0,0,115,26,0,0,0,116,0,160, - 1,100,1,124,0,106,2,161,2,1,0,116,0,160,3,124, - 0,124,1,161,2,83,0,41,2,122,98,76,111,97,100,32, - 97,32,110,97,109,101,115,112,97,99,101,32,109,111,100,117, - 108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105, - 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, - 101,99,97,116,101,100,46,32,32,85,115,101,32,101,120,101, - 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, - 97,100,46,10,10,32,32,32,32,32,32,32,32,122,38,110, - 97,109,101,115,112,97,99,101,32,109,111,100,117,108,101,32, - 108,111,97,100,101,100,32,119,105,116,104,32,112,97,116,104, - 32,123,33,114,125,41,4,114,158,0,0,0,114,173,0,0, - 0,114,47,1,0,0,114,241,0,0,0,114,242,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 243,0,0,0,16,5,0,0,115,8,0,0,0,0,7,6, - 1,4,255,4,2,122,28,95,78,97,109,101,115,112,97,99, - 101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100, - 117,108,101,78,41,12,114,149,0,0,0,114,148,0,0,0, - 114,150,0,0,0,114,232,0,0,0,114,230,0,0,0,114, - 67,1,0,0,114,206,0,0,0,114,252,0,0,0,114,236, - 0,0,0,114,235,0,0,0,114,240,0,0,0,114,243,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,66,1,0,0,244,4,0,0,115, - 18,0,0,0,8,1,8,3,2,1,10,8,8,3,8,3, - 8,3,8,3,8,3,114,66,1,0,0,99,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 64,0,0,0,115,118,0,0,0,101,0,90,1,100,0,90, - 2,100,1,90,3,101,4,100,2,100,3,132,0,131,1,90, - 5,101,4,100,4,100,5,132,0,131,1,90,6,101,4,100, - 6,100,7,132,0,131,1,90,7,101,4,100,8,100,9,132, - 0,131,1,90,8,101,4,100,19,100,11,100,12,132,1,131, - 1,90,9,101,4,100,20,100,13,100,14,132,1,131,1,90, - 10,101,4,100,21,100,15,100,16,132,1,131,1,90,11,101, - 4,100,17,100,18,132,0,131,1,90,12,100,10,83,0,41, - 22,218,10,80,97,116,104,70,105,110,100,101,114,122,62,77, - 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, - 102,111,114,32,115,121,115,46,112,97,116,104,32,97,110,100, - 32,112,97,99,107,97,103,101,32,95,95,112,97,116,104,95, - 95,32,97,116,116,114,105,98,117,116,101,115,46,99,1,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0, - 0,0,67,0,0,0,115,64,0,0,0,116,0,116,1,106, - 2,160,3,161,0,131,1,68,0,93,44,92,2,125,1,125, - 2,124,2,100,1,117,0,114,40,116,1,106,2,124,1,61, - 0,113,14,116,4,124,2,100,2,131,2,114,14,124,2,160, - 5,161,0,1,0,113,14,100,1,83,0,41,3,122,125,67, - 97,108,108,32,116,104,101,32,105,110,118,97,108,105,100,97, - 116,101,95,99,97,99,104,101,115,40,41,32,109,101,116,104, - 111,100,32,111,110,32,97,108,108,32,112,97,116,104,32,101, - 110,116,114,121,32,102,105,110,100,101,114,115,10,32,32,32, - 32,32,32,32,32,115,116,111,114,101,100,32,105,110,32,115, - 121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,114, - 95,99,97,99,104,101,115,32,40,119,104,101,114,101,32,105, - 109,112,108,101,109,101,110,116,101,100,41,46,78,218,17,105, - 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, - 41,6,218,4,108,105,115,116,114,21,0,0,0,218,19,112, - 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, - 104,101,218,5,105,116,101,109,115,114,152,0,0,0,114,69, - 1,0,0,41,3,114,216,0,0,0,114,140,0,0,0,218, - 6,102,105,110,100,101,114,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,69,1,0,0,34,5,0,0,115, - 10,0,0,0,0,4,22,1,8,1,10,1,10,1,122,28, - 80,97,116,104,70,105,110,100,101,114,46,105,110,118,97,108, - 105,100,97,116,101,95,99,97,99,104,101,115,99,2,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,9,0,0, - 0,67,0,0,0,115,82,0,0,0,116,0,106,1,100,1, - 117,1,114,28,116,0,106,1,115,28,116,2,160,3,100,2, - 116,4,161,2,1,0,116,0,106,1,68,0,93,42,125,2, - 122,14,124,2,124,1,131,1,87,0,2,0,1,0,83,0, - 4,0,116,5,121,74,1,0,1,0,1,0,89,0,113,34, - 89,0,113,34,48,0,113,34,100,1,83,0,41,3,122,46, - 83,101,97,114,99,104,32,115,121,115,46,112,97,116,104,95, - 104,111,111,107,115,32,102,111,114,32,97,32,102,105,110,100, - 101,114,32,102,111,114,32,39,112,97,116,104,39,46,78,122, - 23,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, - 105,115,32,101,109,112,116,121,41,6,114,21,0,0,0,218, - 10,112,97,116,104,95,104,111,111,107,115,114,98,0,0,0, - 114,99,0,0,0,114,162,0,0,0,114,141,0,0,0,41, - 3,114,216,0,0,0,114,65,0,0,0,90,4,104,111,111, - 107,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,11,95,112,97,116,104,95,104,111,111,107,115,44,5,0, - 0,115,16,0,0,0,0,3,16,1,12,1,10,1,2,1, - 14,1,12,1,12,2,122,22,80,97,116,104,70,105,110,100, - 101,114,46,95,112,97,116,104,95,104,111,111,107,115,99,2, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8, - 0,0,0,67,0,0,0,115,100,0,0,0,124,1,100,1, - 107,2,114,42,122,12,116,0,160,1,161,0,125,1,87,0, - 110,20,4,0,116,2,121,40,1,0,1,0,1,0,89,0, - 100,2,83,0,48,0,122,14,116,3,106,4,124,1,25,0, - 125,2,87,0,110,38,4,0,116,5,121,94,1,0,1,0, - 1,0,124,0,160,6,124,1,161,1,125,2,124,2,116,3, - 106,4,124,1,60,0,89,0,110,2,48,0,124,2,83,0, - 41,3,122,210,71,101,116,32,116,104,101,32,102,105,110,100, - 101,114,32,102,111,114,32,116,104,101,32,112,97,116,104,32, - 101,110,116,114,121,32,102,114,111,109,32,115,121,115,46,112, - 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, - 104,101,46,10,10,32,32,32,32,32,32,32,32,73,102,32, - 116,104,101,32,112,97,116,104,32,101,110,116,114,121,32,105, - 115,32,110,111,116,32,105,110,32,116,104,101,32,99,97,99, - 104,101,44,32,102,105,110,100,32,116,104,101,32,97,112,112, - 114,111,112,114,105,97,116,101,32,102,105,110,100,101,114,10, - 32,32,32,32,32,32,32,32,97,110,100,32,99,97,99,104, - 101,32,105,116,46,32,73,102,32,110,111,32,102,105,110,100, - 101,114,32,105,115,32,97,118,97,105,108,97,98,108,101,44, - 32,115,116,111,114,101,32,78,111,110,101,46,10,10,32,32, - 32,32,32,32,32,32,114,14,0,0,0,78,41,7,114,24, - 0,0,0,114,81,0,0,0,114,26,1,0,0,114,21,0, - 0,0,114,71,1,0,0,218,8,75,101,121,69,114,114,111, - 114,114,75,1,0,0,41,3,114,216,0,0,0,114,65,0, - 0,0,114,73,1,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,20,95,112,97,116,104,95,105,109, - 112,111,114,116,101,114,95,99,97,99,104,101,57,5,0,0, - 115,22,0,0,0,0,8,8,1,2,1,12,1,12,3,8, - 1,2,1,14,1,12,1,10,1,16,1,122,31,80,97,116, - 104,70,105,110,100,101,114,46,95,112,97,116,104,95,105,109, - 112,111,114,116,101,114,95,99,97,99,104,101,99,3,0,0, - 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, - 0,67,0,0,0,115,82,0,0,0,116,0,124,2,100,1, - 131,2,114,26,124,2,160,1,124,1,161,1,92,2,125,3, - 125,4,110,14,124,2,160,2,124,1,161,1,125,3,103,0, - 125,4,124,3,100,0,117,1,114,60,116,3,160,4,124,1, - 124,3,161,2,83,0,116,3,160,5,124,1,100,0,161,2, - 125,5,124,4,124,5,95,6,124,5,83,0,41,2,78,114, - 161,0,0,0,41,7,114,152,0,0,0,114,161,0,0,0, - 114,229,0,0,0,114,158,0,0,0,114,224,0,0,0,114, - 207,0,0,0,114,202,0,0,0,41,6,114,216,0,0,0, - 114,163,0,0,0,114,73,1,0,0,114,164,0,0,0,114, - 165,0,0,0,114,210,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,16,95,108,101,103,97,99, - 121,95,103,101,116,95,115,112,101,99,79,5,0,0,115,18, - 0,0,0,0,4,10,1,16,2,10,1,4,1,8,1,12, - 1,12,1,6,1,122,27,80,97,116,104,70,105,110,100,101, - 114,46,95,108,101,103,97,99,121,95,103,101,116,95,115,112, - 101,99,78,99,4,0,0,0,0,0,0,0,0,0,0,0, - 9,0,0,0,5,0,0,0,67,0,0,0,115,166,0,0, - 0,103,0,125,4,124,2,68,0,93,134,125,5,116,0,124, - 5,116,1,116,2,102,2,131,2,115,28,113,8,124,0,160, - 3,124,5,161,1,125,6,124,6,100,1,117,1,114,8,116, - 4,124,6,100,2,131,2,114,70,124,6,160,5,124,1,124, - 3,161,2,125,7,110,12,124,0,160,6,124,1,124,6,161, - 2,125,7,124,7,100,1,117,0,114,92,113,8,124,7,106, - 7,100,1,117,1,114,110,124,7,2,0,1,0,83,0,124, - 7,106,8,125,8,124,8,100,1,117,0,114,132,116,9,100, - 3,131,1,130,1,124,4,160,10,124,8,161,1,1,0,113, - 8,116,11,160,12,124,1,100,1,161,2,125,7,124,4,124, - 7,95,8,124,7,83,0,41,4,122,63,70,105,110,100,32, - 116,104,101,32,108,111,97,100,101,114,32,111,114,32,110,97, - 109,101,115,112,97,99,101,95,112,97,116,104,32,102,111,114, - 32,116,104,105,115,32,109,111,100,117,108,101,47,112,97,99, - 107,97,103,101,32,110,97,109,101,46,78,114,226,0,0,0, - 122,19,115,112,101,99,32,109,105,115,115,105,110,103,32,108, - 111,97,100,101,114,41,13,114,185,0,0,0,114,108,0,0, - 0,218,5,98,121,116,101,115,114,77,1,0,0,114,152,0, - 0,0,114,226,0,0,0,114,78,1,0,0,114,164,0,0, - 0,114,202,0,0,0,114,141,0,0,0,114,191,0,0,0, - 114,158,0,0,0,114,207,0,0,0,41,9,114,216,0,0, - 0,114,163,0,0,0,114,65,0,0,0,114,225,0,0,0, - 218,14,110,97,109,101,115,112,97,99,101,95,112,97,116,104, - 90,5,101,110,116,114,121,114,73,1,0,0,114,210,0,0, - 0,114,165,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,9,95,103,101,116,95,115,112,101,99, - 94,5,0,0,115,40,0,0,0,0,5,4,1,8,1,14, - 1,2,1,10,1,8,1,10,1,14,2,12,1,8,1,2, - 1,10,1,8,1,6,1,8,1,8,5,12,2,12,1,6, - 1,122,20,80,97,116,104,70,105,110,100,101,114,46,95,103, - 101,116,95,115,112,101,99,99,4,0,0,0,0,0,0,0, - 0,0,0,0,6,0,0,0,5,0,0,0,67,0,0,0, - 115,100,0,0,0,124,2,100,1,117,0,114,14,116,0,106, - 1,125,2,124,0,160,2,124,1,124,2,124,3,161,3,125, - 4,124,4,100,1,117,0,114,40,100,1,83,0,124,4,106, - 3,100,1,117,0,114,92,124,4,106,4,125,5,124,5,114, - 86,100,1,124,4,95,5,116,6,124,1,124,5,124,0,106, - 2,131,3,124,4,95,4,124,4,83,0,100,1,83,0,110, - 4,124,4,83,0,100,1,83,0,41,2,122,141,84,114,121, - 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, - 102,111,114,32,39,102,117,108,108,110,97,109,101,39,32,111, - 110,32,115,121,115,46,112,97,116,104,32,111,114,32,39,112, - 97,116,104,39,46,10,10,32,32,32,32,32,32,32,32,84, - 104,101,32,115,101,97,114,99,104,32,105,115,32,98,97,115, - 101,100,32,111,110,32,115,121,115,46,112,97,116,104,95,104, - 111,111,107,115,32,97,110,100,32,115,121,115,46,112,97,116, - 104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,101, - 46,10,32,32,32,32,32,32,32,32,78,41,7,114,21,0, - 0,0,114,65,0,0,0,114,81,1,0,0,114,164,0,0, - 0,114,202,0,0,0,114,205,0,0,0,114,45,1,0,0, - 41,6,114,216,0,0,0,114,163,0,0,0,114,65,0,0, - 0,114,225,0,0,0,114,210,0,0,0,114,80,1,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 226,0,0,0,126,5,0,0,115,26,0,0,0,0,6,8, - 1,6,1,14,1,8,1,4,1,10,1,6,1,4,3,6, - 1,16,1,4,2,6,2,122,20,80,97,116,104,70,105,110, - 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, - 0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0, - 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, - 1,124,2,161,2,125,3,124,3,100,1,117,0,114,24,100, - 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110, - 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, - 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, - 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, - 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, - 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, - 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, - 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, - 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, - 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,114,227,0,0,0,114,228,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,229,0,0,0,150,5,0,0,115,8,0,0,0,0, - 8,12,1,8,1,4,1,122,22,80,97,116,104,70,105,110, - 100,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99, - 1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 4,0,0,0,79,0,0,0,115,28,0,0,0,100,1,100, - 2,108,0,109,1,125,3,1,0,124,3,106,2,124,1,105, - 0,124,2,164,1,142,1,83,0,41,3,97,32,1,0,0, - 10,32,32,32,32,32,32,32,32,70,105,110,100,32,100,105, - 115,116,114,105,98,117,116,105,111,110,115,46,10,10,32,32, - 32,32,32,32,32,32,82,101,116,117,114,110,32,97,110,32, - 105,116,101,114,97,98,108,101,32,111,102,32,97,108,108,32, - 68,105,115,116,114,105,98,117,116,105,111,110,32,105,110,115, - 116,97,110,99,101,115,32,99,97,112,97,98,108,101,32,111, - 102,10,32,32,32,32,32,32,32,32,108,111,97,100,105,110, - 103,32,116,104,101,32,109,101,116,97,100,97,116,97,32,102, - 111,114,32,112,97,99,107,97,103,101,115,32,109,97,116,99, - 104,105,110,103,32,96,96,99,111,110,116,101,120,116,46,110, - 97,109,101,96,96,10,32,32,32,32,32,32,32,32,40,111, - 114,32,97,108,108,32,110,97,109,101,115,32,105,102,32,96, - 96,78,111,110,101,96,96,32,105,110,100,105,99,97,116,101, - 100,41,32,97,108,111,110,103,32,116,104,101,32,112,97,116, - 104,115,32,105,110,32,116,104,101,32,108,105,115,116,10,32, - 32,32,32,32,32,32,32,111,102,32,100,105,114,101,99,116, - 111,114,105,101,115,32,96,96,99,111,110,116,101,120,116,46, - 112,97,116,104,96,96,46,10,32,32,32,32,32,32,32,32, - 114,0,0,0,0,41,1,218,18,77,101,116,97,100,97,116, - 97,80,97,116,104,70,105,110,100,101,114,41,3,90,18,105, - 109,112,111,114,116,108,105,98,46,109,101,116,97,100,97,116, - 97,114,82,1,0,0,218,18,102,105,110,100,95,100,105,115, - 116,114,105,98,117,116,105,111,110,115,41,4,114,216,0,0, - 0,114,143,0,0,0,114,144,0,0,0,114,82,1,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 83,1,0,0,163,5,0,0,115,4,0,0,0,0,10,12, - 1,122,29,80,97,116,104,70,105,110,100,101,114,46,102,105, - 110,100,95,100,105,115,116,114,105,98,117,116,105,111,110,115, - 41,1,78,41,2,78,78,41,1,78,41,13,114,149,0,0, - 0,114,148,0,0,0,114,150,0,0,0,114,151,0,0,0, - 114,230,0,0,0,114,69,1,0,0,114,75,1,0,0,114, - 77,1,0,0,114,78,1,0,0,114,81,1,0,0,114,226, - 0,0,0,114,229,0,0,0,114,83,1,0,0,114,10,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,68,1,0,0,30,5,0,0,115,34,0,0,0,8, - 2,4,2,2,1,10,9,2,1,10,12,2,1,10,21,2, - 1,10,14,2,1,12,31,2,1,12,23,2,1,12,12,2, - 1,114,68,1,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, - 90,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 101,6,90,7,100,6,100,7,132,0,90,8,100,8,100,9, - 132,0,90,9,100,19,100,11,100,12,132,1,90,10,100,13, - 100,14,132,0,90,11,101,12,100,15,100,16,132,0,131,1, - 90,13,100,17,100,18,132,0,90,14,100,10,83,0,41,20, - 218,10,70,105,108,101,70,105,110,100,101,114,122,172,70,105, - 108,101,45,98,97,115,101,100,32,102,105,110,100,101,114,46, - 10,10,32,32,32,32,73,110,116,101,114,97,99,116,105,111, - 110,115,32,119,105,116,104,32,116,104,101,32,102,105,108,101, - 32,115,121,115,116,101,109,32,97,114,101,32,99,97,99,104, - 101,100,32,102,111,114,32,112,101,114,102,111,114,109,97,110, - 99,101,44,32,98,101,105,110,103,10,32,32,32,32,114,101, - 102,114,101,115,104,101,100,32,119,104,101,110,32,116,104,101, - 32,100,105,114,101,99,116,111,114,121,32,116,104,101,32,102, - 105,110,100,101,114,32,105,115,32,104,97,110,100,108,105,110, - 103,32,104,97,115,32,98,101,101,110,32,109,111,100,105,102, - 105,101,100,46,10,10,32,32,32,32,99,2,0,0,0,0, - 0,0,0,0,0,0,0,5,0,0,0,6,0,0,0,7, - 0,0,0,115,112,0,0,0,103,0,125,3,124,2,68,0, - 93,32,92,2,137,0,125,4,124,3,160,0,135,0,102,1, - 100,1,100,2,132,8,124,4,68,0,131,1,161,1,1,0, - 113,8,124,3,124,0,95,1,124,1,112,54,100,3,124,0, - 95,2,116,3,124,0,106,2,131,1,115,86,116,4,116,5, - 160,6,161,0,124,0,106,2,131,2,124,0,95,2,100,4, - 124,0,95,7,116,8,131,0,124,0,95,9,116,8,131,0, - 124,0,95,10,100,5,83,0,41,6,122,154,73,110,105,116, - 105,97,108,105,122,101,32,119,105,116,104,32,116,104,101,32, - 112,97,116,104,32,116,111,32,115,101,97,114,99,104,32,111, - 110,32,97,110,100,32,97,32,118,97,114,105,97,98,108,101, - 32,110,117,109,98,101,114,32,111,102,10,32,32,32,32,32, - 32,32,32,50,45,116,117,112,108,101,115,32,99,111,110,116, - 97,105,110,105,110,103,32,116,104,101,32,108,111,97,100,101, - 114,32,97,110,100,32,116,104,101,32,102,105,108,101,32,115, - 117,102,102,105,120,101,115,32,116,104,101,32,108,111,97,100, - 101,114,10,32,32,32,32,32,32,32,32,114,101,99,111,103, - 110,105,122,101,115,46,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,51,0,0,0,115, - 22,0,0,0,124,0,93,14,125,1,124,1,136,0,102,2, - 86,0,1,0,113,2,100,0,83,0,114,69,0,0,0,114, - 10,0,0,0,114,40,1,0,0,169,1,114,164,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,12,0,0,0,192, - 5,0,0,114,13,0,0,0,122,38,70,105,108,101,70,105, - 110,100,101,114,46,95,95,105,110,105,116,95,95,46,60,108, - 111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,62, - 114,96,0,0,0,114,129,0,0,0,78,41,11,114,191,0, - 0,0,218,8,95,108,111,97,100,101,114,115,114,65,0,0, - 0,114,85,0,0,0,114,67,0,0,0,114,24,0,0,0, - 114,81,0,0,0,218,11,95,112,97,116,104,95,109,116,105, - 109,101,218,3,115,101,116,218,11,95,112,97,116,104,95,99, - 97,99,104,101,218,19,95,114,101,108,97,120,101,100,95,112, - 97,116,104,95,99,97,99,104,101,41,5,114,142,0,0,0, - 114,65,0,0,0,218,14,108,111,97,100,101,114,95,100,101, - 116,97,105,108,115,90,7,108,111,97,100,101,114,115,114,212, - 0,0,0,114,10,0,0,0,114,85,1,0,0,114,11,0, - 0,0,114,232,0,0,0,186,5,0,0,115,20,0,0,0, - 0,4,4,1,12,1,26,1,6,2,10,1,10,1,18,1, - 6,1,8,1,122,19,70,105,108,101,70,105,110,100,101,114, - 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, - 0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0, - 0,0,115,10,0,0,0,100,1,124,0,95,0,100,2,83, - 0,41,3,122,31,73,110,118,97,108,105,100,97,116,101,32, - 116,104,101,32,100,105,114,101,99,116,111,114,121,32,109,116, - 105,109,101,46,114,129,0,0,0,78,41,1,114,87,1,0, - 0,114,13,1,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,69,1,0,0,202,5,0,0,115,2, - 0,0,0,0,2,122,28,70,105,108,101,70,105,110,100,101, - 114,46,105,110,118,97,108,105,100,97,116,101,95,99,97,99, - 104,101,115,99,2,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,42,0,0, - 0,124,0,160,0,124,1,161,1,125,2,124,2,100,1,117, - 0,114,26,100,1,103,0,102,2,83,0,124,2,106,1,124, - 2,106,2,112,38,103,0,102,2,83,0,41,2,122,197,84, - 114,121,32,116,111,32,102,105,110,100,32,97,32,108,111,97, - 100,101,114,32,102,111,114,32,116,104,101,32,115,112,101,99, - 105,102,105,101,100,32,109,111,100,117,108,101,44,32,111,114, - 32,116,104,101,32,110,97,109,101,115,112,97,99,101,10,32, - 32,32,32,32,32,32,32,112,97,99,107,97,103,101,32,112, - 111,114,116,105,111,110,115,46,32,82,101,116,117,114,110,115, - 32,40,108,111,97,100,101,114,44,32,108,105,115,116,45,111, - 102,45,112,111,114,116,105,111,110,115,41,46,10,10,32,32, - 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,85,115,101,32,102,105,110,100,95,115,112,101,99,40, - 41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32, - 32,32,32,32,78,41,3,114,226,0,0,0,114,164,0,0, - 0,114,202,0,0,0,41,3,114,142,0,0,0,114,163,0, - 0,0,114,210,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,161,0,0,0,208,5,0,0,115, - 8,0,0,0,0,7,10,1,8,1,8,1,122,22,70,105, - 108,101,70,105,110,100,101,114,46,102,105,110,100,95,108,111, - 97,100,101,114,99,6,0,0,0,0,0,0,0,0,0,0, - 0,7,0,0,0,6,0,0,0,67,0,0,0,115,26,0, - 0,0,124,1,124,2,124,3,131,2,125,6,116,0,124,2, - 124,3,124,6,124,4,100,1,141,4,83,0,41,2,78,114, - 201,0,0,0,41,1,114,213,0,0,0,41,7,114,142,0, - 0,0,114,211,0,0,0,114,163,0,0,0,114,65,0,0, - 0,90,4,115,109,115,108,114,225,0,0,0,114,164,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,81,1,0,0,220,5,0,0,115,8,0,0,0,0,1, - 10,1,8,1,2,255,122,20,70,105,108,101,70,105,110,100, - 101,114,46,95,103,101,116,95,115,112,101,99,78,99,3,0, - 0,0,0,0,0,0,0,0,0,0,14,0,0,0,9,0, - 0,0,67,0,0,0,115,126,1,0,0,100,1,125,3,124, - 1,160,0,100,2,161,1,100,3,25,0,125,4,122,24,116, - 1,124,0,106,2,112,34,116,3,160,4,161,0,131,1,106, - 5,125,5,87,0,110,22,4,0,116,6,121,64,1,0,1, - 0,1,0,100,4,125,5,89,0,110,2,48,0,124,5,124, - 0,106,7,107,3,114,90,124,0,160,8,161,0,1,0,124, - 5,124,0,95,7,116,9,131,0,114,112,124,0,106,10,125, - 6,124,4,160,11,161,0,125,7,110,10,124,0,106,12,125, - 6,124,4,125,7,124,7,124,6,118,0,114,216,116,13,124, - 0,106,2,124,4,131,2,125,8,124,0,106,14,68,0,93, - 58,92,2,125,9,125,10,100,5,124,9,23,0,125,11,116, - 13,124,8,124,11,131,2,125,12,116,15,124,12,131,1,114, - 148,124,0,160,16,124,10,124,1,124,12,124,8,103,1,124, - 2,161,5,2,0,1,0,83,0,113,148,116,17,124,8,131, - 1,125,3,124,0,106,14,68,0,93,112,92,2,125,9,125, - 10,122,20,116,13,124,0,106,2,124,4,124,9,23,0,131, - 2,125,12,87,0,110,24,4,0,116,18,144,1,121,18,1, - 0,1,0,1,0,89,0,1,0,100,6,83,0,48,0,116, - 19,106,20,100,7,124,12,100,3,100,8,141,3,1,0,124, - 7,124,9,23,0,124,6,118,0,114,222,116,15,124,12,131, - 1,114,222,124,0,160,16,124,10,124,1,124,12,100,6,124, - 2,161,5,2,0,1,0,83,0,113,222,124,3,144,1,114, - 122,116,19,160,20,100,9,124,8,161,2,1,0,116,19,160, - 21,124,1,100,6,161,2,125,13,124,8,103,1,124,13,95, - 22,124,13,83,0,100,6,83,0,41,10,122,111,84,114,121, - 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, - 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, - 100,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, - 32,32,32,82,101,116,117,114,110,115,32,116,104,101,32,109, - 97,116,99,104,105,110,103,32,115,112,101,99,44,32,111,114, - 32,78,111,110,101,32,105,102,32,110,111,116,32,102,111,117, - 110,100,46,10,32,32,32,32,32,32,32,32,70,114,96,0, - 0,0,114,45,0,0,0,114,129,0,0,0,114,232,0,0, - 0,78,122,9,116,114,121,105,110,103,32,123,125,41,1,90, - 9,118,101,114,98,111,115,105,116,121,122,25,112,111,115,115, - 105,98,108,101,32,110,97,109,101,115,112,97,99,101,32,102, - 111,114,32,123,125,41,23,114,103,0,0,0,114,75,0,0, - 0,114,65,0,0,0,114,24,0,0,0,114,81,0,0,0, - 114,33,1,0,0,114,76,0,0,0,114,87,1,0,0,218, - 11,95,102,105,108,108,95,99,97,99,104,101,114,27,0,0, - 0,114,90,1,0,0,114,130,0,0,0,114,89,1,0,0, - 114,67,0,0,0,114,86,1,0,0,114,80,0,0,0,114, - 81,1,0,0,114,82,0,0,0,114,110,0,0,0,114,158, - 0,0,0,114,173,0,0,0,114,207,0,0,0,114,202,0, - 0,0,41,14,114,142,0,0,0,114,163,0,0,0,114,225, - 0,0,0,90,12,105,115,95,110,97,109,101,115,112,97,99, - 101,90,11,116,97,105,108,95,109,111,100,117,108,101,114,193, - 0,0,0,90,5,99,97,99,104,101,90,12,99,97,99,104, - 101,95,109,111,100,117,108,101,90,9,98,97,115,101,95,112, - 97,116,104,114,41,1,0,0,114,211,0,0,0,90,13,105, - 110,105,116,95,102,105,108,101,110,97,109,101,90,9,102,117, - 108,108,95,112,97,116,104,114,210,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,226,0,0,0, - 225,5,0,0,115,78,0,0,0,0,5,4,1,14,1,2, - 1,24,1,12,1,10,1,10,1,8,1,6,2,6,1,6, - 1,10,2,6,1,4,2,8,1,12,1,14,1,8,1,10, - 1,8,1,26,4,8,2,14,1,2,1,20,1,14,1,10, - 1,16,1,12,1,8,1,10,1,4,255,10,2,6,1,12, - 1,12,1,8,1,4,1,122,20,70,105,108,101,70,105,110, - 100,101,114,46,102,105,110,100,95,115,112,101,99,99,1,0, - 0,0,0,0,0,0,0,0,0,0,9,0,0,0,10,0, - 0,0,67,0,0,0,115,188,0,0,0,124,0,106,0,125, - 1,122,22,116,1,160,2,124,1,112,22,116,1,160,3,161, - 0,161,1,125,2,87,0,110,28,4,0,116,4,116,5,116, - 6,102,3,121,56,1,0,1,0,1,0,103,0,125,2,89, - 0,110,2,48,0,116,7,106,8,160,9,100,1,161,1,115, - 82,116,10,124,2,131,1,124,0,95,11,110,74,116,10,131, - 0,125,3,124,2,68,0,93,56,125,4,124,4,160,12,100, - 2,161,1,92,3,125,5,125,6,125,7,124,6,114,134,100, - 3,160,13,124,5,124,7,160,14,161,0,161,2,125,8,110, - 4,124,5,125,8,124,3,160,15,124,8,161,1,1,0,113, - 92,124,3,124,0,95,11,116,7,106,8,160,9,116,16,161, - 1,114,184,100,4,100,5,132,0,124,2,68,0,131,1,124, - 0,95,17,100,6,83,0,41,7,122,68,70,105,108,108,32, - 116,104,101,32,99,97,99,104,101,32,111,102,32,112,111,116, - 101,110,116,105,97,108,32,109,111,100,117,108,101,115,32,97, - 110,100,32,112,97,99,107,97,103,101,115,32,102,111,114,32, - 116,104,105,115,32,100,105,114,101,99,116,111,114,121,46,114, - 20,0,0,0,114,96,0,0,0,114,87,0,0,0,99,1, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,83,0,0,0,115,20,0,0,0,104,0,124,0, - 93,12,125,1,124,1,160,0,161,0,146,2,113,4,83,0, - 114,10,0,0,0,41,1,114,130,0,0,0,41,2,114,8, - 0,0,0,90,2,102,110,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,19,0,0,0,49,6,0,0,114, - 13,0,0,0,122,41,70,105,108,101,70,105,110,100,101,114, - 46,95,102,105,108,108,95,99,97,99,104,101,46,60,108,111, - 99,97,108,115,62,46,60,115,101,116,99,111,109,112,62,78, - 41,18,114,65,0,0,0,114,24,0,0,0,114,30,1,0, - 0,114,81,0,0,0,114,26,1,0,0,218,15,80,101,114, - 109,105,115,115,105,111,110,69,114,114,111,114,218,18,78,111, - 116,65,68,105,114,101,99,116,111,114,121,69,114,114,111,114, - 114,21,0,0,0,114,28,0,0,0,114,29,0,0,0,114, - 88,1,0,0,114,89,1,0,0,114,125,0,0,0,114,88, - 0,0,0,114,130,0,0,0,218,3,97,100,100,114,30,0, - 0,0,114,90,1,0,0,41,9,114,142,0,0,0,114,65, - 0,0,0,114,31,1,0,0,90,21,108,111,119,101,114,95, - 115,117,102,102,105,120,95,99,111,110,116,101,110,116,115,114, - 64,1,0,0,114,140,0,0,0,114,52,1,0,0,114,41, - 1,0,0,90,8,110,101,119,95,110,97,109,101,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,92,1,0, - 0,20,6,0,0,115,34,0,0,0,0,2,6,1,2,1, - 22,1,18,3,10,3,12,1,12,7,6,1,8,1,16,1, - 4,1,18,2,4,1,12,1,6,1,12,1,122,22,70,105, - 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, - 97,99,104,101,99,1,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,7,0,0,0,115,18,0, - 0,0,135,0,135,1,102,2,100,1,100,2,132,8,125,2, - 124,2,83,0,41,3,97,20,1,0,0,65,32,99,108,97, - 115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,32, - 114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,114, - 101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,46, - 112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,32, - 32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,116, - 117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,32, - 117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,102, - 105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,32, - 116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,32, - 32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99, - 108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,32, - 32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,108, - 108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117, - 114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,101, - 99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,114, - 111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,97, - 105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 4,0,0,0,19,0,0,0,115,36,0,0,0,116,0,124, - 0,131,1,115,20,116,1,100,1,124,0,100,2,141,2,130, - 1,136,0,124,0,103,1,136,1,162,1,82,0,142,0,83, - 0,41,3,122,45,80,97,116,104,32,104,111,111,107,32,102, - 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, - 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, - 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, - 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, - 101,100,114,71,0,0,0,41,2,114,82,0,0,0,114,141, - 0,0,0,114,71,0,0,0,169,2,114,216,0,0,0,114, - 91,1,0,0,114,10,0,0,0,114,11,0,0,0,218,24, - 112,97,116,104,95,104,111,111,107,95,102,111,114,95,70,105, - 108,101,70,105,110,100,101,114,61,6,0,0,115,6,0,0, - 0,0,2,8,1,12,1,122,54,70,105,108,101,70,105,110, - 100,101,114,46,112,97,116,104,95,104,111,111,107,46,60,108, - 111,99,97,108,115,62,46,112,97,116,104,95,104,111,111,107, - 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,114, - 10,0,0,0,41,3,114,216,0,0,0,114,91,1,0,0, - 114,97,1,0,0,114,10,0,0,0,114,96,1,0,0,114, - 11,0,0,0,218,9,112,97,116,104,95,104,111,111,107,51, - 6,0,0,115,4,0,0,0,0,10,14,6,122,20,70,105, - 108,101,70,105,110,100,101,114,46,112,97,116,104,95,104,111, - 111,107,99,1,0,0,0,0,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, - 100,1,160,0,124,0,106,1,161,1,83,0,41,2,78,122, - 16,70,105,108,101,70,105,110,100,101,114,40,123,33,114,125, - 41,41,2,114,88,0,0,0,114,65,0,0,0,114,13,1, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,62,1,0,0,69,6,0,0,115,2,0,0,0,0, - 1,122,19,70,105,108,101,70,105,110,100,101,114,46,95,95, - 114,101,112,114,95,95,41,1,78,41,15,114,149,0,0,0, - 114,148,0,0,0,114,150,0,0,0,114,151,0,0,0,114, - 232,0,0,0,114,69,1,0,0,114,167,0,0,0,114,229, - 0,0,0,114,161,0,0,0,114,81,1,0,0,114,226,0, - 0,0,114,92,1,0,0,114,230,0,0,0,114,98,1,0, - 0,114,62,1,0,0,114,10,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,84,1,0,0,177, - 5,0,0,115,22,0,0,0,8,2,4,7,8,16,8,4, - 4,2,8,12,8,5,10,51,8,31,2,1,10,17,114,84, - 1,0,0,99,4,0,0,0,0,0,0,0,0,0,0,0, - 6,0,0,0,8,0,0,0,67,0,0,0,115,144,0,0, - 0,124,0,160,0,100,1,161,1,125,4,124,0,160,0,100, - 2,161,1,125,5,124,4,115,66,124,5,114,36,124,5,106, - 1,125,4,110,30,124,2,124,3,107,2,114,56,116,2,124, - 1,124,2,131,2,125,4,110,10,116,3,124,1,124,2,131, - 2,125,4,124,5,115,84,116,4,124,1,124,2,124,4,100, - 3,141,3,125,5,122,36,124,5,124,0,100,2,60,0,124, - 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, - 3,124,0,100,5,60,0,87,0,110,18,4,0,116,5,121, - 138,1,0,1,0,1,0,89,0,110,2,48,0,100,0,83, - 0,41,6,78,218,10,95,95,108,111,97,100,101,114,95,95, - 218,8,95,95,115,112,101,99,95,95,114,85,1,0,0,90, - 8,95,95,102,105,108,101,95,95,90,10,95,95,99,97,99, - 104,101,100,95,95,41,6,218,3,103,101,116,114,164,0,0, - 0,114,39,1,0,0,114,32,1,0,0,114,213,0,0,0, - 218,9,69,120,99,101,112,116,105,111,110,41,6,90,2,110, - 115,114,140,0,0,0,90,8,112,97,116,104,110,97,109,101, - 90,9,99,112,97,116,104,110,97,109,101,114,164,0,0,0, - 114,210,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,14,95,102,105,120,95,117,112,95,109,111, - 100,117,108,101,75,6,0,0,115,34,0,0,0,0,2,10, - 1,10,1,4,1,4,1,8,1,8,1,12,2,10,1,4, - 1,14,1,2,1,8,1,8,1,8,1,12,1,12,2,114, - 103,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, - 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, - 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, - 124,1,124,2,103,3,83,0,41,1,122,95,82,101,116,117, - 114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,105, - 108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,32, - 108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,97, - 99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,112, - 108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,102, - 105,120,101,115,41,46,10,32,32,32,32,41,7,114,19,1, - 0,0,114,187,0,0,0,218,18,101,120,116,101,110,115,105, - 111,110,95,115,117,102,102,105,120,101,115,114,32,1,0,0, - 114,126,0,0,0,114,39,1,0,0,114,112,0,0,0,41, - 3,90,10,101,120,116,101,110,115,105,111,110,115,90,6,115, - 111,117,114,99,101,90,8,98,121,116,101,99,111,100,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,208, - 0,0,0,98,6,0,0,115,8,0,0,0,0,5,12,1, - 8,1,8,1,114,208,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,10,0,0,0,9,0,0,0,67,0, - 0,0,115,132,1,0,0,124,0,97,0,116,0,106,1,97, - 1,116,0,106,2,97,2,116,1,106,3,116,4,25,0,125, - 1,100,1,100,2,103,1,102,2,100,3,100,4,100,2,103, - 2,102,2,102,2,125,2,124,2,68,0,93,108,92,2,125, - 3,125,4,116,5,100,5,100,6,132,0,124,4,68,0,131, - 1,131,1,115,82,74,0,130,1,124,4,100,7,25,0,125, - 5,124,3,116,1,106,3,118,0,114,116,116,1,106,3,124, - 3,25,0,125,6,1,0,113,170,113,52,122,20,116,0,160, - 6,124,3,161,1,125,6,87,0,1,0,113,170,87,0,113, - 52,4,0,116,7,121,158,1,0,1,0,1,0,89,0,113, - 52,89,0,113,52,48,0,113,52,116,7,100,8,131,1,130, - 1,116,8,124,1,100,9,124,6,131,3,1,0,116,8,124, - 1,100,10,124,5,131,3,1,0,116,8,124,1,100,11,100, - 12,160,9,124,4,161,1,131,3,1,0,116,8,124,1,100, - 13,100,14,100,15,132,0,124,4,68,0,131,1,131,3,1, - 0,103,0,100,16,162,1,125,7,124,3,100,3,107,2,144, - 1,114,6,124,7,160,10,100,17,161,1,1,0,124,7,68, - 0,93,52,125,8,124,8,116,1,106,3,118,1,144,1,114, - 38,116,0,160,6,124,8,161,1,125,9,110,10,116,1,106, - 3,124,8,25,0,125,9,116,8,124,1,124,8,124,9,131, - 3,1,0,144,1,113,10,116,8,124,1,100,18,116,11,131, - 0,131,3,1,0,116,12,160,13,116,2,160,14,161,0,161, - 1,1,0,124,3,100,3,107,2,144,1,114,128,116,15,160, - 10,100,19,161,1,1,0,100,20,116,12,118,0,144,1,114, - 128,100,21,116,16,95,17,100,22,83,0,41,23,122,205,83, - 101,116,117,112,32,116,104,101,32,112,97,116,104,45,98,97, - 115,101,100,32,105,109,112,111,114,116,101,114,115,32,102,111, - 114,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, - 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,10, - 32,32,32,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, - 110,103,32,116,104,101,109,32,105,110,116,111,32,116,104,101, - 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, - 101,46,10,10,32,32,32,32,79,116,104,101,114,32,99,111, - 109,112,111,110,101,110,116,115,32,97,114,101,32,101,120,116, - 114,97,99,116,101,100,32,102,114,111,109,32,116,104,101,32, - 99,111,114,101,32,98,111,111,116,115,116,114,97,112,32,109, - 111,100,117,108,101,46,10,10,32,32,32,32,218,5,112,111, - 115,105,120,114,2,0,0,0,218,2,110,116,114,1,0,0, - 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,115,0,0,0,115,26,0,0,0,124, - 0,93,18,125,1,116,0,124,1,131,1,100,0,107,2,86, - 0,1,0,113,2,100,1,83,0,114,3,0,0,0,114,5, - 0,0,0,114,7,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,12,0,0,0,127,6,0,0, - 114,13,0,0,0,122,25,95,115,101,116,117,112,46,60,108, - 111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,62, - 114,0,0,0,0,122,30,105,109,112,111,114,116,108,105,98, - 32,114,101,113,117,105,114,101,115,32,112,111,115,105,120,32, - 111,114,32,110,116,114,24,0,0,0,114,59,0,0,0,114, - 50,0,0,0,114,14,0,0,0,218,20,95,112,97,116,104, - 115,101,112,115,95,119,105,116,104,95,99,111,108,111,110,99, - 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 4,0,0,0,83,0,0,0,115,22,0,0,0,104,0,124, - 0,93,14,125,1,100,0,124,1,155,0,157,2,146,2,113, - 4,83,0,114,15,0,0,0,114,10,0,0,0,114,17,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,19,0,0,0,144,6,0,0,114,13,0,0,0,122, - 25,95,115,101,116,117,112,46,60,108,111,99,97,108,115,62, - 46,60,115,101,116,99,111,109,112,62,41,3,114,90,0,0, - 0,114,98,0,0,0,114,184,0,0,0,114,215,0,0,0, - 114,27,0,0,0,122,4,46,112,121,119,122,6,95,100,46, - 112,121,100,84,78,41,18,114,158,0,0,0,114,21,0,0, - 0,114,187,0,0,0,114,54,1,0,0,114,149,0,0,0, - 218,3,97,108,108,90,18,95,98,117,105,108,116,105,110,95, - 102,114,111,109,95,110,97,109,101,114,141,0,0,0,114,153, - 0,0,0,114,62,0,0,0,114,61,0,0,0,114,32,0, - 0,0,114,44,1,0,0,114,191,0,0,0,114,104,1,0, - 0,114,126,0,0,0,114,214,0,0,0,114,218,0,0,0, - 41,10,218,17,95,98,111,111,116,115,116,114,97,112,95,109, - 111,100,117,108,101,90,11,115,101,108,102,95,109,111,100,117, - 108,101,90,10,111,115,95,100,101,116,97,105,108,115,90,10, - 98,117,105,108,116,105,110,95,111,115,114,50,0,0,0,114, - 59,0,0,0,90,9,111,115,95,109,111,100,117,108,101,90, - 13,98,117,105,108,116,105,110,95,110,97,109,101,115,90,12, - 98,117,105,108,116,105,110,95,110,97,109,101,90,14,98,117, - 105,108,116,105,110,95,109,111,100,117,108,101,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,6,95,115,101, - 116,117,112,109,6,0,0,115,70,0,0,0,0,8,4,1, - 6,1,6,2,10,3,22,1,12,2,22,1,8,1,10,1, - 10,1,6,2,2,1,10,1,10,1,12,1,12,2,8,2, - 12,1,12,1,18,1,22,3,8,1,10,1,10,1,8,1, - 12,1,12,2,10,1,16,3,14,1,14,1,10,1,10,1, - 10,1,114,110,1,0,0,99,1,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, - 115,50,0,0,0,116,0,124,0,131,1,1,0,116,1,131, - 0,125,1,116,2,106,3,160,4,116,5,106,6,124,1,142, - 0,103,1,161,1,1,0,116,2,106,7,160,8,116,9,161, - 1,1,0,100,1,83,0,41,2,122,41,73,110,115,116,97, - 108,108,32,116,104,101,32,112,97,116,104,45,98,97,115,101, - 100,32,105,109,112,111,114,116,32,99,111,109,112,111,110,101, - 110,116,115,46,78,41,10,114,110,1,0,0,114,208,0,0, - 0,114,21,0,0,0,114,74,1,0,0,114,191,0,0,0, - 114,84,1,0,0,114,98,1,0,0,218,9,109,101,116,97, - 95,112,97,116,104,114,61,0,0,0,114,68,1,0,0,41, - 2,114,109,1,0,0,90,17,115,117,112,112,111,114,116,101, - 100,95,108,111,97,100,101,114,115,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,8,95,105,110,115,116,97, - 108,108,166,6,0,0,115,8,0,0,0,0,2,8,1,6, - 1,20,1,114,112,1,0,0,41,1,114,86,0,0,0,41, - 1,78,41,3,78,78,78,41,2,114,0,0,0,0,114,0, - 0,0,0,41,1,84,41,1,78,41,1,78,41,81,114,151, - 0,0,0,114,187,0,0,0,114,90,0,0,0,114,21,0, - 0,0,114,98,0,0,0,114,184,0,0,0,114,28,0,0, - 0,90,11,95,77,83,95,87,73,78,68,79,87,83,114,106, - 1,0,0,114,24,0,0,0,114,215,0,0,0,114,105,1, - 0,0,114,50,0,0,0,114,108,1,0,0,114,59,0,0, - 0,114,135,0,0,0,114,57,0,0,0,114,62,0,0,0, - 114,107,1,0,0,114,31,0,0,0,90,37,95,67,65,83, - 69,95,73,78,83,69,78,83,73,84,73,86,69,95,80,76, - 65,84,70,79,82,77,83,95,66,89,84,69,83,95,75,69, - 89,114,30,0,0,0,114,32,0,0,0,114,39,0,0,0, - 114,44,0,0,0,114,46,0,0,0,114,67,0,0,0,114, - 74,0,0,0,114,75,0,0,0,114,79,0,0,0,114,80, - 0,0,0,114,82,0,0,0,114,85,0,0,0,114,94,0, - 0,0,218,4,116,121,112,101,218,8,95,95,99,111,100,101, - 95,95,114,186,0,0,0,114,37,0,0,0,114,172,0,0, - 0,114,36,0,0,0,114,41,0,0,0,114,3,1,0,0, - 114,115,0,0,0,114,111,0,0,0,114,126,0,0,0,114, - 112,0,0,0,90,23,68,69,66,85,71,95,66,89,84,69, - 67,79,68,69,95,83,85,70,70,73,88,69,83,90,27,79, - 80,84,73,77,73,90,69,68,95,66,89,84,69,67,79,68, - 69,95,83,85,70,70,73,88,69,83,114,120,0,0,0,114, - 127,0,0,0,114,134,0,0,0,114,136,0,0,0,114,138, - 0,0,0,114,160,0,0,0,114,167,0,0,0,114,176,0, - 0,0,114,180,0,0,0,114,182,0,0,0,114,189,0,0, - 0,114,194,0,0,0,114,195,0,0,0,114,200,0,0,0, - 218,6,111,98,106,101,99,116,114,209,0,0,0,114,213,0, - 0,0,114,214,0,0,0,114,231,0,0,0,114,244,0,0, - 0,114,6,1,0,0,114,32,1,0,0,114,39,1,0,0, - 114,44,1,0,0,114,19,1,0,0,114,45,1,0,0,114, - 66,1,0,0,114,68,1,0,0,114,84,1,0,0,114,103, - 1,0,0,114,208,0,0,0,114,110,1,0,0,114,112,1, - 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,8,60,109,111,100,117,108,101,62, - 1,0,0,0,115,170,0,0,0,4,22,8,1,8,1,8, - 1,8,1,8,3,10,1,4,1,8,1,10,2,8,3,4, - 1,10,2,6,2,22,1,8,1,8,1,10,1,14,4,4, - 1,4,1,2,1,2,255,4,4,8,17,8,5,8,5,8, - 6,4,1,10,30,8,6,8,8,8,10,8,9,8,5,8, - 7,6,1,10,8,8,5,10,22,10,127,0,20,16,1,12, - 2,4,1,4,2,6,2,6,2,8,2,16,71,8,40,8, - 19,8,12,8,12,8,28,8,17,8,33,8,28,8,24,10, - 13,10,10,10,11,8,14,6,3,4,1,2,255,12,68,14, - 64,14,29,16,127,0,17,14,72,18,45,18,26,4,3,18, - 58,14,63,14,42,14,127,0,20,14,127,0,27,10,23,8, - 11,8,57, +const unsigned char _Py_M__importlib_bootstrap_external[] = { + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,0,64,0,0,0,115,224,2,0,0,100,0, + 90,0,100,1,100,2,108,1,97,1,100,1,100,2,108,2, + 90,2,100,1,100,2,108,3,97,3,100,1,100,2,108,4, + 90,4,100,1,100,2,108,5,90,5,116,3,106,6,100,3, + 107,2,90,7,101,7,114,76,100,1,100,2,108,8,90,9, + 100,1,100,2,108,10,90,10,110,8,100,1,100,2,108,11, + 90,9,101,7,114,98,100,4,100,5,103,2,90,12,110,6, + 100,5,103,1,90,12,101,13,100,6,100,7,132,0,101,12, + 68,0,131,1,131,1,115,126,74,0,130,1,101,12,100,1, + 25,0,90,14,101,15,101,12,131,1,90,16,100,8,160,17, + 101,12,161,1,90,12,100,9,100,10,132,0,101,12,68,0, + 131,1,90,18,100,11,90,19,100,12,90,20,101,20,101,19, + 23,0,90,21,100,13,100,14,132,0,90,22,100,15,100,16, + 132,0,90,23,100,17,100,18,132,0,90,24,100,19,100,20, + 132,0,90,25,101,7,114,228,100,21,100,22,132,0,90,26, + 110,8,100,23,100,22,132,0,90,26,100,24,100,25,132,0, + 90,27,100,26,100,27,132,0,90,28,100,28,100,29,132,0, + 90,29,100,30,100,31,132,0,90,30,100,32,100,33,132,0, + 90,31,101,7,144,1,114,36,100,34,100,35,132,0,90,32, + 110,8,100,36,100,35,132,0,90,32,100,111,100,38,100,39, + 132,1,90,33,101,34,101,33,106,35,131,1,90,36,100,40, + 160,37,100,41,100,42,161,2,100,43,23,0,90,38,101,39, + 160,40,101,38,100,42,161,2,90,41,100,44,90,42,100,45, + 90,43,100,46,103,1,90,44,100,47,103,1,90,45,101,45, + 4,0,90,46,90,47,100,112,100,2,100,48,156,1,100,49, + 100,50,132,3,90,48,100,51,100,52,132,0,90,49,100,53, + 100,54,132,0,90,50,100,55,100,56,132,0,90,51,100,57, + 100,58,132,0,90,52,100,59,100,60,132,0,90,53,100,61, + 100,62,132,0,90,54,100,63,100,64,132,0,90,55,100,65, + 100,66,132,0,90,56,100,67,100,68,132,0,90,57,100,113, + 100,69,100,70,132,1,90,58,100,114,100,71,100,72,132,1, + 90,59,100,115,100,74,100,75,132,1,90,60,100,76,100,77, + 132,0,90,61,101,62,131,0,90,63,100,116,100,2,101,63, + 100,78,156,2,100,79,100,80,132,3,90,64,71,0,100,81, + 100,82,132,0,100,82,131,2,90,65,71,0,100,83,100,84, + 132,0,100,84,131,2,90,66,71,0,100,85,100,86,132,0, + 100,86,101,66,131,3,90,67,71,0,100,87,100,88,132,0, + 100,88,131,2,90,68,71,0,100,89,100,90,132,0,100,90, + 101,68,101,67,131,4,90,69,71,0,100,91,100,92,132,0, + 100,92,101,68,101,66,131,4,90,70,103,0,90,71,71,0, + 100,93,100,94,132,0,100,94,101,68,101,66,131,4,90,72, + 71,0,100,95,100,96,132,0,100,96,131,2,90,73,71,0, + 100,97,100,98,132,0,100,98,131,2,90,74,71,0,100,99, + 100,100,132,0,100,100,131,2,90,75,71,0,100,101,100,102, + 132,0,100,102,131,2,90,76,100,117,100,103,100,104,132,1, + 90,77,100,105,100,106,132,0,90,78,100,107,100,108,132,0, + 90,79,100,109,100,110,132,0,90,80,100,2,83,0,41,118, + 97,94,1,0,0,67,111,114,101,32,105,109,112,108,101,109, + 101,110,116,97,116,105,111,110,32,111,102,32,112,97,116,104, + 45,98,97,115,101,100,32,105,109,112,111,114,116,46,10,10, + 84,104,105,115,32,109,111,100,117,108,101,32,105,115,32,78, + 79,84,32,109,101,97,110,116,32,116,111,32,98,101,32,100, + 105,114,101,99,116,108,121,32,105,109,112,111,114,116,101,100, + 33,32,73,116,32,104,97,115,32,98,101,101,110,32,100,101, + 115,105,103,110,101,100,32,115,117,99,104,10,116,104,97,116, + 32,105,116,32,99,97,110,32,98,101,32,98,111,111,116,115, + 116,114,97,112,112,101,100,32,105,110,116,111,32,80,121,116, + 104,111,110,32,97,115,32,116,104,101,32,105,109,112,108,101, + 109,101,110,116,97,116,105,111,110,32,111,102,32,105,109,112, + 111,114,116,46,32,65,115,10,115,117,99,104,32,105,116,32, + 114,101,113,117,105,114,101,115,32,116,104,101,32,105,110,106, + 101,99,116,105,111,110,32,111,102,32,115,112,101,99,105,102, + 105,99,32,109,111,100,117,108,101,115,32,97,110,100,32,97, + 116,116,114,105,98,117,116,101,115,32,105,110,32,111,114,100, + 101,114,32,116,111,10,119,111,114,107,46,32,79,110,101,32, + 115,104,111,117,108,100,32,117,115,101,32,105,109,112,111,114, + 116,108,105,98,32,97,115,32,116,104,101,32,112,117,98,108, + 105,99,45,102,97,99,105,110,103,32,118,101,114,115,105,111, + 110,32,111,102,32,116,104,105,115,32,109,111,100,117,108,101, + 46,10,10,233,0,0,0,0,78,90,5,119,105,110,51,50, + 250,1,92,250,1,47,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,99,0,0,0,115, + 26,0,0,0,124,0,93,18,125,1,116,0,124,1,131,1, + 100,0,107,2,86,0,1,0,113,2,100,1,83,0,169,2, + 233,1,0,0,0,78,169,1,218,3,108,101,110,169,2,218, + 2,46,48,218,3,115,101,112,169,0,114,10,0,0,0,250, + 38,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108, + 105,98,46,95,98,111,111,116,115,116,114,97,112,95,101,120, + 116,101,114,110,97,108,62,218,9,60,103,101,110,101,120,112, + 114,62,43,0,0,0,243,0,0,0,0,114,12,0,0,0, + 218,0,99,1,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,67,0,0,0,115,22,0,0,0, + 104,0,124,0,93,14,125,1,100,0,124,1,155,0,157,2, + 146,2,113,4,83,0,169,1,250,1,58,114,10,0,0,0, + 169,2,114,8,0,0,0,218,1,115,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,9,60,115,101,116,99, + 111,109,112,62,47,0,0,0,114,13,0,0,0,114,19,0, + 0,0,41,1,218,3,119,105,110,41,2,90,6,99,121,103, + 119,105,110,90,6,100,97,114,119,105,110,99,0,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, + 3,0,0,0,115,60,0,0,0,116,0,106,1,160,2,116, + 3,161,1,114,48,116,0,106,1,160,2,116,4,161,1,114, + 30,100,1,137,0,110,4,100,2,137,0,135,0,102,1,100, + 3,100,4,132,8,125,0,110,8,100,5,100,4,132,0,125, + 0,124,0,83,0,41,6,78,90,12,80,89,84,72,79,78, + 67,65,83,69,79,75,115,12,0,0,0,80,89,84,72,79, + 78,67,65,83,69,79,75,99,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,19,0,0,0, + 115,20,0,0,0,116,0,106,1,106,2,12,0,111,18,136, + 0,116,3,106,4,118,0,83,0,41,1,122,94,84,114,117, + 101,32,105,102,32,102,105,108,101,110,97,109,101,115,32,109, + 117,115,116,32,98,101,32,99,104,101,99,107,101,100,32,99, + 97,115,101,45,105,110,115,101,110,115,105,116,105,118,101,108, + 121,32,97,110,100,32,105,103,110,111,114,101,32,101,110,118, + 105,114,111,110,109,101,110,116,32,102,108,97,103,115,32,97, + 114,101,32,110,111,116,32,115,101,116,46,41,5,218,3,115, + 121,115,218,5,102,108,97,103,115,218,18,105,103,110,111,114, + 101,95,101,110,118,105,114,111,110,109,101,110,116,218,3,95, + 111,115,90,7,101,110,118,105,114,111,110,114,10,0,0,0, + 169,1,218,3,107,101,121,114,10,0,0,0,114,11,0,0, + 0,218,11,95,114,101,108,97,120,95,99,97,115,101,64,0, + 0,0,115,2,0,0,0,0,2,122,37,95,109,97,107,101, + 95,114,101,108,97,120,95,99,97,115,101,46,60,108,111,99, + 97,108,115,62,46,95,114,101,108,97,120,95,99,97,115,101, + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,1,0,0,0,83,0,0,0,115,4,0,0,0,100,1, + 83,0,41,2,122,53,84,114,117,101,32,105,102,32,102,105, + 108,101,110,97,109,101,115,32,109,117,115,116,32,98,101,32, + 99,104,101,99,107,101,100,32,99,97,115,101,45,105,110,115, + 101,110,115,105,116,105,118,101,108,121,46,70,114,10,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,27,0,0,0,68,0,0,0,115,2, + 0,0,0,0,2,41,5,114,21,0,0,0,218,8,112,108, + 97,116,102,111,114,109,218,10,115,116,97,114,116,115,119,105, + 116,104,218,27,95,67,65,83,69,95,73,78,83,69,78,83, + 73,84,73,86,69,95,80,76,65,84,70,79,82,77,83,218, + 35,95,67,65,83,69,95,73,78,83,69,78,83,73,84,73, + 86,69,95,80,76,65,84,70,79,82,77,83,95,83,84,82, + 95,75,69,89,41,1,114,27,0,0,0,114,10,0,0,0, + 114,25,0,0,0,114,11,0,0,0,218,16,95,109,97,107, + 101,95,114,101,108,97,120,95,99,97,115,101,57,0,0,0, + 115,14,0,0,0,0,1,12,1,12,1,6,2,4,2,14, + 4,8,3,114,32,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, + 0,115,20,0,0,0,116,0,124,0,131,1,100,1,64,0, + 160,1,100,2,100,3,161,2,83,0,41,4,122,42,67,111, + 110,118,101,114,116,32,97,32,51,50,45,98,105,116,32,105, + 110,116,101,103,101,114,32,116,111,32,108,105,116,116,108,101, + 45,101,110,100,105,97,110,46,236,3,0,0,0,255,127,255, + 127,3,0,233,4,0,0,0,218,6,108,105,116,116,108,101, + 41,2,218,3,105,110,116,218,8,116,111,95,98,121,116,101, + 115,41,1,218,1,120,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,12,95,112,97,99,107,95,117,105,110, + 116,51,50,74,0,0,0,115,2,0,0,0,0,2,114,39, + 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,4,0,0,0,67,0,0,0,115,28,0,0, + 0,116,0,124,0,131,1,100,1,107,2,115,16,74,0,130, + 1,116,1,160,2,124,0,100,2,161,2,83,0,41,3,122, + 47,67,111,110,118,101,114,116,32,52,32,98,121,116,101,115, + 32,105,110,32,108,105,116,116,108,101,45,101,110,100,105,97, + 110,32,116,111,32,97,110,32,105,110,116,101,103,101,114,46, + 114,34,0,0,0,114,35,0,0,0,169,3,114,6,0,0, + 0,114,36,0,0,0,218,10,102,114,111,109,95,98,121,116, + 101,115,169,1,218,4,100,97,116,97,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,14,95,117,110,112,97, + 99,107,95,117,105,110,116,51,50,79,0,0,0,115,4,0, + 0,0,0,2,16,1,114,44,0,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0, + 67,0,0,0,115,28,0,0,0,116,0,124,0,131,1,100, + 1,107,2,115,16,74,0,130,1,116,1,160,2,124,0,100, + 2,161,2,83,0,41,3,122,47,67,111,110,118,101,114,116, + 32,50,32,98,121,116,101,115,32,105,110,32,108,105,116,116, + 108,101,45,101,110,100,105,97,110,32,116,111,32,97,110,32, + 105,110,116,101,103,101,114,46,233,2,0,0,0,114,35,0, + 0,0,114,40,0,0,0,114,42,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,14,95,117,110, + 112,97,99,107,95,117,105,110,116,49,54,84,0,0,0,115, + 4,0,0,0,0,2,16,1,114,46,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0, + 0,0,71,0,0,0,115,228,0,0,0,124,0,115,8,100, + 1,83,0,116,0,124,0,131,1,100,2,107,2,114,28,124, + 0,100,3,25,0,83,0,100,1,125,1,103,0,125,2,116, + 1,116,2,106,3,124,0,131,2,68,0,93,122,92,2,125, + 3,125,4,124,3,160,4,116,5,161,1,115,76,124,3,160, + 6,116,5,161,1,114,102,124,3,160,7,116,8,161,1,112, + 88,124,1,125,1,116,9,124,4,23,0,103,1,125,2,113, + 48,124,3,160,6,100,4,161,1,114,152,124,1,160,10,161, + 0,124,3,160,10,161,0,107,3,114,140,124,3,125,1,124, + 4,103,1,125,2,113,170,124,2,160,11,124,4,161,1,1, + 0,113,48,124,3,112,158,124,1,125,1,124,2,160,11,124, + 4,161,1,1,0,113,48,100,5,100,6,132,0,124,2,68, + 0,131,1,125,2,116,0,124,2,131,1,100,2,107,2,114, + 214,124,2,100,3,25,0,115,214,124,1,116,9,23,0,83, + 0,124,1,116,9,160,12,124,2,161,1,23,0,83,0,41, + 7,250,31,82,101,112,108,97,99,101,109,101,110,116,32,102, + 111,114,32,111,115,46,112,97,116,104,46,106,111,105,110,40, + 41,46,114,14,0,0,0,114,4,0,0,0,114,0,0,0, + 0,114,16,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,5,0,0,0,83,0,0,0,115, + 26,0,0,0,103,0,124,0,93,18,125,1,124,1,114,4, + 124,1,160,0,116,1,161,1,145,2,113,4,83,0,114,10, + 0,0,0,169,2,218,6,114,115,116,114,105,112,218,15,112, + 97,116,104,95,115,101,112,97,114,97,116,111,114,115,169,2, + 114,8,0,0,0,218,1,112,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,10,60,108,105,115,116,99,111, + 109,112,62,114,0,0,0,114,13,0,0,0,250,30,95,112, + 97,116,104,95,106,111,105,110,46,60,108,111,99,97,108,115, + 62,46,60,108,105,115,116,99,111,109,112,62,41,13,114,6, + 0,0,0,218,3,109,97,112,114,24,0,0,0,218,15,95, + 112,97,116,104,95,115,112,108,105,116,114,111,111,116,114,29, + 0,0,0,218,14,112,97,116,104,95,115,101,112,95,116,117, + 112,108,101,218,8,101,110,100,115,119,105,116,104,114,49,0, + 0,0,114,50,0,0,0,218,8,112,97,116,104,95,115,101, + 112,218,8,99,97,115,101,102,111,108,100,218,6,97,112,112, + 101,110,100,218,4,106,111,105,110,41,5,218,10,112,97,116, + 104,95,112,97,114,116,115,218,4,114,111,111,116,218,4,112, + 97,116,104,90,8,110,101,119,95,114,111,111,116,218,4,116, + 97,105,108,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,10,95,112,97,116,104,95,106,111,105,110,91,0, + 0,0,115,42,0,0,0,0,2,4,1,4,1,12,1,8, + 1,4,1,4,1,20,1,20,1,14,1,12,1,10,1,16, + 3,4,1,8,2,12,2,8,1,12,1,14,1,20,2,8, + 1,114,67,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,4,0,0,0,71,0,0,0,115, + 20,0,0,0,116,0,160,1,100,1,100,2,132,0,124,0, + 68,0,131,1,161,1,83,0,41,3,114,47,0,0,0,99, + 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 5,0,0,0,83,0,0,0,115,26,0,0,0,103,0,124, + 0,93,18,125,1,124,1,114,4,124,1,160,0,116,1,161, + 1,145,2,113,4,83,0,114,10,0,0,0,114,48,0,0, + 0,41,2,114,8,0,0,0,218,4,112,97,114,116,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,53,0, + 0,0,123,0,0,0,115,4,0,0,0,6,1,6,255,114, + 54,0,0,0,41,2,114,59,0,0,0,114,62,0,0,0, + 41,1,114,63,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,67,0,0,0,121,0,0,0,115, + 6,0,0,0,0,2,10,1,2,255,99,1,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,3, + 0,0,0,115,66,0,0,0,116,0,135,0,102,1,100,1, + 100,2,132,8,116,1,68,0,131,1,131,1,125,1,124,1, + 100,3,107,0,114,38,100,4,136,0,102,2,83,0,136,0, + 100,5,124,1,133,2,25,0,136,0,124,1,100,6,23,0, + 100,5,133,2,25,0,102,2,83,0,41,7,122,32,82,101, + 112,108,97,99,101,109,101,110,116,32,102,111,114,32,111,115, + 46,112,97,116,104,46,115,112,108,105,116,40,41,46,99,1, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,51,0,0,0,115,24,0,0,0,124,0,93,16, + 125,1,136,0,160,0,124,1,161,1,86,0,1,0,113,2, + 100,0,83,0,169,1,78,41,1,218,5,114,102,105,110,100, + 114,51,0,0,0,169,1,114,65,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,12,0,0,0,129,0,0,0,114, + 13,0,0,0,122,30,95,112,97,116,104,95,115,112,108,105, + 116,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101, + 120,112,114,62,114,0,0,0,0,114,14,0,0,0,78,114, + 4,0,0,0,41,2,218,3,109,97,120,114,50,0,0,0, + 41,2,114,65,0,0,0,218,1,105,114,10,0,0,0,114, + 71,0,0,0,114,11,0,0,0,218,11,95,112,97,116,104, + 95,115,112,108,105,116,127,0,0,0,115,8,0,0,0,0, + 2,22,1,8,1,8,1,114,74,0,0,0,99,1,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,10,0,0,0,116,0,160,1,124,0, + 161,1,83,0,41,1,122,126,83,116,97,116,32,116,104,101, + 32,112,97,116,104,46,10,10,32,32,32,32,77,97,100,101, + 32,97,32,115,101,112,97,114,97,116,101,32,102,117,110,99, + 116,105,111,110,32,116,111,32,109,97,107,101,32,105,116,32, + 101,97,115,105,101,114,32,116,111,32,111,118,101,114,114,105, + 100,101,32,105,110,32,101,120,112,101,114,105,109,101,110,116, + 115,10,32,32,32,32,40,101,46,103,46,32,99,97,99,104, + 101,32,115,116,97,116,32,114,101,115,117,108,116,115,41,46, + 10,10,32,32,32,32,41,2,114,24,0,0,0,90,4,115, + 116,97,116,114,71,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,10,95,112,97,116,104,95,115, + 116,97,116,135,0,0,0,115,2,0,0,0,0,7,114,75, + 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,8,0,0,0,67,0,0,0,115,48,0,0, + 0,122,12,116,0,124,0,131,1,125,2,87,0,110,20,4, + 0,116,1,121,32,1,0,1,0,1,0,89,0,100,1,83, + 0,48,0,124,2,106,2,100,2,64,0,124,1,107,2,83, + 0,41,3,122,49,84,101,115,116,32,119,104,101,116,104,101, + 114,32,116,104,101,32,112,97,116,104,32,105,115,32,116,104, + 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,101, + 32,116,121,112,101,46,70,105,0,240,0,0,41,3,114,75, + 0,0,0,218,7,79,83,69,114,114,111,114,218,7,115,116, + 95,109,111,100,101,41,3,114,65,0,0,0,218,4,109,111, + 100,101,90,9,115,116,97,116,95,105,110,102,111,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,18,95,112, + 97,116,104,95,105,115,95,109,111,100,101,95,116,121,112,101, + 145,0,0,0,115,10,0,0,0,0,2,2,1,12,1,12, + 1,8,1,114,79,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, + 0,115,10,0,0,0,116,0,124,0,100,1,131,2,83,0, + 41,2,122,31,82,101,112,108,97,99,101,109,101,110,116,32, + 102,111,114,32,111,115,46,112,97,116,104,46,105,115,102,105, + 108,101,46,105,0,128,0,0,41,1,114,79,0,0,0,114, + 71,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,12,95,112,97,116,104,95,105,115,102,105,108, + 101,154,0,0,0,115,2,0,0,0,0,2,114,80,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,22,0,0,0,124, + 0,115,12,116,0,160,1,161,0,125,0,116,2,124,0,100, + 1,131,2,83,0,41,2,122,30,82,101,112,108,97,99,101, + 109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,104, + 46,105,115,100,105,114,46,105,0,64,0,0,41,3,114,24, + 0,0,0,218,6,103,101,116,99,119,100,114,79,0,0,0, + 114,71,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,11,95,112,97,116,104,95,105,115,100,105, + 114,159,0,0,0,115,6,0,0,0,0,2,4,1,8,1, + 114,82,0,0,0,99,1,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,62, + 0,0,0,124,0,115,8,100,1,83,0,116,0,160,1,124, + 0,161,1,100,2,25,0,160,2,100,3,100,4,161,2,125, + 1,116,3,124,1,131,1,100,5,107,4,111,60,124,1,160, + 4,100,6,161,1,112,60,124,1,160,5,100,4,161,1,83, + 0,41,7,250,30,82,101,112,108,97,99,101,109,101,110,116, + 32,102,111,114,32,111,115,46,112,97,116,104,46,105,115,97, + 98,115,46,70,114,0,0,0,0,114,2,0,0,0,114,1, + 0,0,0,114,4,0,0,0,122,2,92,92,41,6,114,24, + 0,0,0,114,56,0,0,0,218,7,114,101,112,108,97,99, + 101,114,6,0,0,0,114,29,0,0,0,114,58,0,0,0, + 41,2,114,65,0,0,0,114,64,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,11,95,112,97, + 116,104,95,105,115,97,98,115,167,0,0,0,115,8,0,0, + 0,0,2,4,1,4,1,22,1,114,85,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,10,0,0,0,124,0,160,0, + 116,1,161,1,83,0,41,1,114,83,0,0,0,41,2,114, + 29,0,0,0,114,50,0,0,0,114,71,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,85,0, + 0,0,175,0,0,0,115,2,0,0,0,0,2,233,182,1, + 0,0,99,3,0,0,0,0,0,0,0,0,0,0,0,6, + 0,0,0,11,0,0,0,67,0,0,0,115,178,0,0,0, + 100,1,160,0,124,0,116,1,124,0,131,1,161,2,125,3, + 116,2,160,3,124,3,116,2,106,4,116,2,106,5,66,0, + 116,2,106,6,66,0,124,2,100,2,64,0,161,3,125,4, + 122,70,116,7,160,8,124,4,100,3,161,2,143,26,125,5, + 124,5,160,9,124,1,161,1,1,0,87,0,100,4,4,0, + 4,0,131,3,1,0,110,16,49,0,115,94,48,0,1,0, + 1,0,1,0,89,0,1,0,116,2,160,10,124,3,124,0, + 161,2,1,0,87,0,110,54,4,0,116,11,121,172,1,0, + 1,0,1,0,122,14,116,2,160,12,124,3,161,1,1,0, + 87,0,110,18,4,0,116,11,121,164,1,0,1,0,1,0, + 89,0,110,2,48,0,130,0,89,0,110,2,48,0,100,4, + 83,0,41,5,122,162,66,101,115,116,45,101,102,102,111,114, + 116,32,102,117,110,99,116,105,111,110,32,116,111,32,119,114, + 105,116,101,32,100,97,116,97,32,116,111,32,97,32,112,97, + 116,104,32,97,116,111,109,105,99,97,108,108,121,46,10,32, + 32,32,32,66,101,32,112,114,101,112,97,114,101,100,32,116, + 111,32,104,97,110,100,108,101,32,97,32,70,105,108,101,69, + 120,105,115,116,115,69,114,114,111,114,32,105,102,32,99,111, + 110,99,117,114,114,101,110,116,32,119,114,105,116,105,110,103, + 32,111,102,32,116,104,101,10,32,32,32,32,116,101,109,112, + 111,114,97,114,121,32,102,105,108,101,32,105,115,32,97,116, + 116,101,109,112,116,101,100,46,250,5,123,125,46,123,125,114, + 86,0,0,0,90,2,119,98,78,41,13,218,6,102,111,114, + 109,97,116,218,2,105,100,114,24,0,0,0,90,4,111,112, + 101,110,90,6,79,95,69,88,67,76,90,7,79,95,67,82, + 69,65,84,90,8,79,95,87,82,79,78,76,89,218,3,95, + 105,111,218,6,70,105,108,101,73,79,218,5,119,114,105,116, + 101,114,84,0,0,0,114,76,0,0,0,90,6,117,110,108, + 105,110,107,41,6,114,65,0,0,0,114,43,0,0,0,114, + 78,0,0,0,90,8,112,97,116,104,95,116,109,112,90,2, + 102,100,218,4,102,105,108,101,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,13,95,119,114,105,116,101,95, + 97,116,111,109,105,99,180,0,0,0,115,28,0,0,0,0, + 5,16,1,6,1,22,255,4,2,2,3,14,1,40,1,16, + 1,12,1,2,1,14,1,12,1,6,1,114,94,0,0,0, + 105,97,13,0,0,114,45,0,0,0,114,35,0,0,0,115, + 2,0,0,0,13,10,90,11,95,95,112,121,99,97,99,104, + 101,95,95,122,4,111,112,116,45,122,3,46,112,121,122,4, + 46,112,121,99,41,1,218,12,111,112,116,105,109,105,122,97, + 116,105,111,110,99,2,0,0,0,0,0,0,0,1,0,0, + 0,12,0,0,0,5,0,0,0,67,0,0,0,115,88,1, + 0,0,124,1,100,1,117,1,114,52,116,0,160,1,100,2, + 116,2,161,2,1,0,124,2,100,1,117,1,114,40,100,3, + 125,3,116,3,124,3,131,1,130,1,124,1,114,48,100,4, + 110,2,100,5,125,2,116,4,160,5,124,0,161,1,125,0, + 116,6,124,0,131,1,92,2,125,4,125,5,124,5,160,7, + 100,6,161,1,92,3,125,6,125,7,125,8,116,8,106,9, + 106,10,125,9,124,9,100,1,117,0,114,114,116,11,100,7, + 131,1,130,1,100,4,160,12,124,6,114,126,124,6,110,2, + 124,8,124,7,124,9,103,3,161,1,125,10,124,2,100,1, + 117,0,114,172,116,8,106,13,106,14,100,8,107,2,114,164, + 100,4,125,2,110,8,116,8,106,13,106,14,125,2,116,15, + 124,2,131,1,125,2,124,2,100,4,107,3,114,224,124,2, + 160,16,161,0,115,210,116,17,100,9,160,18,124,2,161,1, + 131,1,130,1,100,10,160,18,124,10,116,19,124,2,161,3, + 125,10,124,10,116,20,100,8,25,0,23,0,125,11,116,8, + 106,21,100,1,117,1,144,1,114,76,116,22,124,4,131,1, + 144,1,115,16,116,23,116,4,160,24,161,0,124,4,131,2, + 125,4,124,4,100,5,25,0,100,11,107,2,144,1,114,56, + 124,4,100,8,25,0,116,25,118,1,144,1,114,56,124,4, + 100,12,100,1,133,2,25,0,125,4,116,23,116,8,106,21, + 124,4,160,26,116,25,161,1,124,11,131,3,83,0,116,23, + 124,4,116,27,124,11,131,3,83,0,41,13,97,254,2,0, + 0,71,105,118,101,110,32,116,104,101,32,112,97,116,104,32, + 116,111,32,97,32,46,112,121,32,102,105,108,101,44,32,114, + 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, + 111,32,105,116,115,32,46,112,121,99,32,102,105,108,101,46, + 10,10,32,32,32,32,84,104,101,32,46,112,121,32,102,105, + 108,101,32,100,111,101,115,32,110,111,116,32,110,101,101,100, + 32,116,111,32,101,120,105,115,116,59,32,116,104,105,115,32, + 115,105,109,112,108,121,32,114,101,116,117,114,110,115,32,116, + 104,101,32,112,97,116,104,32,116,111,32,116,104,101,10,32, + 32,32,32,46,112,121,99,32,102,105,108,101,32,99,97,108, + 99,117,108,97,116,101,100,32,97,115,32,105,102,32,116,104, + 101,32,46,112,121,32,102,105,108,101,32,119,101,114,101,32, + 105,109,112,111,114,116,101,100,46,10,10,32,32,32,32,84, + 104,101,32,39,111,112,116,105,109,105,122,97,116,105,111,110, + 39,32,112,97,114,97,109,101,116,101,114,32,99,111,110,116, + 114,111,108,115,32,116,104,101,32,112,114,101,115,117,109,101, + 100,32,111,112,116,105,109,105,122,97,116,105,111,110,32,108, + 101,118,101,108,32,111,102,10,32,32,32,32,116,104,101,32, + 98,121,116,101,99,111,100,101,32,102,105,108,101,46,32,73, + 102,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, + 32,105,115,32,110,111,116,32,78,111,110,101,44,32,116,104, + 101,32,115,116,114,105,110,103,32,114,101,112,114,101,115,101, + 110,116,97,116,105,111,110,10,32,32,32,32,111,102,32,116, + 104,101,32,97,114,103,117,109,101,110,116,32,105,115,32,116, + 97,107,101,110,32,97,110,100,32,118,101,114,105,102,105,101, + 100,32,116,111,32,98,101,32,97,108,112,104,97,110,117,109, + 101,114,105,99,32,40,101,108,115,101,32,86,97,108,117,101, + 69,114,114,111,114,10,32,32,32,32,105,115,32,114,97,105, + 115,101,100,41,46,10,10,32,32,32,32,84,104,101,32,100, + 101,98,117,103,95,111,118,101,114,114,105,100,101,32,112,97, + 114,97,109,101,116,101,114,32,105,115,32,100,101,112,114,101, + 99,97,116,101,100,46,32,73,102,32,100,101,98,117,103,95, + 111,118,101,114,114,105,100,101,32,105,115,32,110,111,116,32, + 78,111,110,101,44,10,32,32,32,32,97,32,84,114,117,101, + 32,118,97,108,117,101,32,105,115,32,116,104,101,32,115,97, + 109,101,32,97,115,32,115,101,116,116,105,110,103,32,39,111, + 112,116,105,109,105,122,97,116,105,111,110,39,32,116,111,32, + 116,104,101,32,101,109,112,116,121,32,115,116,114,105,110,103, + 10,32,32,32,32,119,104,105,108,101,32,97,32,70,97,108, + 115,101,32,118,97,108,117,101,32,105,115,32,101,113,117,105, + 118,97,108,101,110,116,32,116,111,32,115,101,116,116,105,110, + 103,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, + 32,116,111,32,39,49,39,46,10,10,32,32,32,32,73,102, + 32,115,121,115,46,105,109,112,108,101,109,101,110,116,97,116, + 105,111,110,46,99,97,99,104,101,95,116,97,103,32,105,115, + 32,78,111,110,101,32,116,104,101,110,32,78,111,116,73,109, + 112,108,101,109,101,110,116,101,100,69,114,114,111,114,32,105, + 115,32,114,97,105,115,101,100,46,10,10,32,32,32,32,78, + 122,70,116,104,101,32,100,101,98,117,103,95,111,118,101,114, + 114,105,100,101,32,112,97,114,97,109,101,116,101,114,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,59,32,117,115, + 101,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, + 32,105,110,115,116,101,97,100,122,50,100,101,98,117,103,95, + 111,118,101,114,114,105,100,101,32,111,114,32,111,112,116,105, + 109,105,122,97,116,105,111,110,32,109,117,115,116,32,98,101, + 32,115,101,116,32,116,111,32,78,111,110,101,114,14,0,0, + 0,114,4,0,0,0,218,1,46,250,36,115,121,115,46,105, + 109,112,108,101,109,101,110,116,97,116,105,111,110,46,99,97, + 99,104,101,95,116,97,103,32,105,115,32,78,111,110,101,114, + 0,0,0,0,122,24,123,33,114,125,32,105,115,32,110,111, + 116,32,97,108,112,104,97,110,117,109,101,114,105,99,122,7, + 123,125,46,123,125,123,125,114,16,0,0,0,114,45,0,0, + 0,41,28,218,9,95,119,97,114,110,105,110,103,115,218,4, + 119,97,114,110,218,18,68,101,112,114,101,99,97,116,105,111, + 110,87,97,114,110,105,110,103,218,9,84,121,112,101,69,114, + 114,111,114,114,24,0,0,0,218,6,102,115,112,97,116,104, + 114,74,0,0,0,218,10,114,112,97,114,116,105,116,105,111, + 110,114,21,0,0,0,218,14,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,218,9,99,97,99,104,101,95,116,97, + 103,218,19,78,111,116,73,109,112,108,101,109,101,110,116,101, + 100,69,114,114,111,114,114,62,0,0,0,114,22,0,0,0, + 218,8,111,112,116,105,109,105,122,101,218,3,115,116,114,218, + 7,105,115,97,108,110,117,109,218,10,86,97,108,117,101,69, + 114,114,111,114,114,88,0,0,0,218,4,95,79,80,84,218, + 17,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, + 69,83,218,14,112,121,99,97,99,104,101,95,112,114,101,102, + 105,120,114,85,0,0,0,114,67,0,0,0,114,81,0,0, + 0,114,50,0,0,0,218,6,108,115,116,114,105,112,218,8, + 95,80,89,67,65,67,72,69,41,12,114,65,0,0,0,90, + 14,100,101,98,117,103,95,111,118,101,114,114,105,100,101,114, + 95,0,0,0,218,7,109,101,115,115,97,103,101,218,4,104, + 101,97,100,114,66,0,0,0,90,4,98,97,115,101,114,9, + 0,0,0,218,4,114,101,115,116,90,3,116,97,103,90,15, + 97,108,109,111,115,116,95,102,105,108,101,110,97,109,101,218, + 8,102,105,108,101,110,97,109,101,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,17,99,97,99,104,101,95, + 102,114,111,109,95,115,111,117,114,99,101,105,1,0,0,115, + 72,0,0,0,0,18,8,1,6,1,2,255,4,2,8,1, + 4,1,8,1,12,1,10,1,12,1,16,1,8,1,8,1, + 8,1,24,1,8,1,12,1,6,2,8,1,8,1,8,1, + 8,1,14,1,14,1,12,1,12,9,10,1,14,5,28,1, + 12,4,2,1,4,1,8,1,2,253,4,5,114,120,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,10,0, + 0,0,5,0,0,0,67,0,0,0,115,46,1,0,0,116, + 0,106,1,106,2,100,1,117,0,114,20,116,3,100,2,131, + 1,130,1,116,4,160,5,124,0,161,1,125,0,116,6,124, + 0,131,1,92,2,125,1,125,2,100,3,125,3,116,0,106, + 7,100,1,117,1,114,102,116,0,106,7,160,8,116,9,161, + 1,125,4,124,1,160,10,124,4,116,11,23,0,161,1,114, + 102,124,1,116,12,124,4,131,1,100,1,133,2,25,0,125, + 1,100,4,125,3,124,3,115,144,116,6,124,1,131,1,92, + 2,125,1,125,5,124,5,116,13,107,3,114,144,116,14,116, + 13,155,0,100,5,124,0,155,2,157,3,131,1,130,1,124, + 2,160,15,100,6,161,1,125,6,124,6,100,7,118,1,114, + 178,116,14,100,8,124,2,155,2,157,2,131,1,130,1,110, + 92,124,6,100,9,107,2,144,1,114,14,124,2,160,16,100, + 6,100,10,161,2,100,11,25,0,125,7,124,7,160,10,116, + 17,161,1,115,228,116,14,100,12,116,17,155,2,157,2,131, + 1,130,1,124,7,116,12,116,17,131,1,100,1,133,2,25, + 0,125,8,124,8,160,18,161,0,144,1,115,14,116,14,100, + 13,124,7,155,2,100,14,157,3,131,1,130,1,124,2,160, + 19,100,6,161,1,100,15,25,0,125,9,116,20,124,1,124, + 9,116,21,100,15,25,0,23,0,131,2,83,0,41,16,97, + 110,1,0,0,71,105,118,101,110,32,116,104,101,32,112,97, + 116,104,32,116,111,32,97,32,46,112,121,99,46,32,102,105, + 108,101,44,32,114,101,116,117,114,110,32,116,104,101,32,112, + 97,116,104,32,116,111,32,105,116,115,32,46,112,121,32,102, + 105,108,101,46,10,10,32,32,32,32,84,104,101,32,46,112, + 121,99,32,102,105,108,101,32,100,111,101,115,32,110,111,116, + 32,110,101,101,100,32,116,111,32,101,120,105,115,116,59,32, + 116,104,105,115,32,115,105,109,112,108,121,32,114,101,116,117, + 114,110,115,32,116,104,101,32,112,97,116,104,32,116,111,10, + 32,32,32,32,116,104,101,32,46,112,121,32,102,105,108,101, + 32,99,97,108,99,117,108,97,116,101,100,32,116,111,32,99, + 111,114,114,101,115,112,111,110,100,32,116,111,32,116,104,101, + 32,46,112,121,99,32,102,105,108,101,46,32,32,73,102,32, + 112,97,116,104,32,100,111,101,115,10,32,32,32,32,110,111, + 116,32,99,111,110,102,111,114,109,32,116,111,32,80,69,80, + 32,51,49,52,55,47,52,56,56,32,102,111,114,109,97,116, + 44,32,86,97,108,117,101,69,114,114,111,114,32,119,105,108, + 108,32,98,101,32,114,97,105,115,101,100,46,32,73,102,10, + 32,32,32,32,115,121,115,46,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,46,99,97,99,104,101,95,116,97,103, + 32,105,115,32,78,111,110,101,32,116,104,101,110,32,78,111, + 116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111, + 114,32,105,115,32,114,97,105,115,101,100,46,10,10,32,32, + 32,32,78,114,97,0,0,0,70,84,122,31,32,110,111,116, + 32,98,111,116,116,111,109,45,108,101,118,101,108,32,100,105, + 114,101,99,116,111,114,121,32,105,110,32,114,96,0,0,0, + 62,2,0,0,0,114,45,0,0,0,233,3,0,0,0,122, + 29,101,120,112,101,99,116,101,100,32,111,110,108,121,32,50, + 32,111,114,32,51,32,100,111,116,115,32,105,110,32,114,121, + 0,0,0,114,45,0,0,0,233,254,255,255,255,122,53,111, + 112,116,105,109,105,122,97,116,105,111,110,32,112,111,114,116, + 105,111,110,32,111,102,32,102,105,108,101,110,97,109,101,32, + 100,111,101,115,32,110,111,116,32,115,116,97,114,116,32,119, + 105,116,104,32,122,19,111,112,116,105,109,105,122,97,116,105, + 111,110,32,108,101,118,101,108,32,122,29,32,105,115,32,110, + 111,116,32,97,110,32,97,108,112,104,97,110,117,109,101,114, + 105,99,32,118,97,108,117,101,114,0,0,0,0,41,22,114, + 21,0,0,0,114,104,0,0,0,114,105,0,0,0,114,106, + 0,0,0,114,24,0,0,0,114,102,0,0,0,114,74,0, + 0,0,114,113,0,0,0,114,49,0,0,0,114,50,0,0, + 0,114,29,0,0,0,114,59,0,0,0,114,6,0,0,0, + 114,115,0,0,0,114,110,0,0,0,218,5,99,111,117,110, + 116,218,6,114,115,112,108,105,116,114,111,0,0,0,114,109, + 0,0,0,218,9,112,97,114,116,105,116,105,111,110,114,67, + 0,0,0,218,15,83,79,85,82,67,69,95,83,85,70,70, + 73,88,69,83,41,10,114,65,0,0,0,114,117,0,0,0, + 90,16,112,121,99,97,99,104,101,95,102,105,108,101,110,97, + 109,101,90,23,102,111,117,110,100,95,105,110,95,112,121,99, + 97,99,104,101,95,112,114,101,102,105,120,90,13,115,116,114, + 105,112,112,101,100,95,112,97,116,104,90,7,112,121,99,97, + 99,104,101,90,9,100,111,116,95,99,111,117,110,116,114,95, + 0,0,0,90,9,111,112,116,95,108,101,118,101,108,90,13, + 98,97,115,101,95,102,105,108,101,110,97,109,101,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,17,115,111, + 117,114,99,101,95,102,114,111,109,95,99,97,99,104,101,176, + 1,0,0,115,60,0,0,0,0,9,12,1,8,1,10,1, + 12,1,4,1,10,1,12,1,14,1,16,1,4,1,4,1, + 12,1,8,1,8,1,2,255,8,2,10,1,8,1,16,1, + 10,1,16,1,10,1,4,1,2,255,8,2,16,1,10,1, + 16,2,14,1,114,127,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,5,0,0,0,9,0,0,0,67,0, + 0,0,115,124,0,0,0,116,0,124,0,131,1,100,1,107, + 2,114,16,100,2,83,0,124,0,160,1,100,3,161,1,92, + 3,125,1,125,2,125,3,124,1,114,56,124,3,160,2,161, + 0,100,4,100,5,133,2,25,0,100,6,107,3,114,60,124, + 0,83,0,122,12,116,3,124,0,131,1,125,4,87,0,110, + 34,4,0,116,4,116,5,102,2,121,106,1,0,1,0,1, + 0,124,0,100,2,100,5,133,2,25,0,125,4,89,0,110, + 2,48,0,116,6,124,4,131,1,114,120,124,4,83,0,124, + 0,83,0,41,7,122,188,67,111,110,118,101,114,116,32,97, + 32,98,121,116,101,99,111,100,101,32,102,105,108,101,32,112, + 97,116,104,32,116,111,32,97,32,115,111,117,114,99,101,32, + 112,97,116,104,32,40,105,102,32,112,111,115,115,105,98,108, + 101,41,46,10,10,32,32,32,32,84,104,105,115,32,102,117, + 110,99,116,105,111,110,32,101,120,105,115,116,115,32,112,117, + 114,101,108,121,32,102,111,114,32,98,97,99,107,119,97,114, + 100,115,45,99,111,109,112,97,116,105,98,105,108,105,116,121, + 32,102,111,114,10,32,32,32,32,80,121,73,109,112,111,114, + 116,95,69,120,101,99,67,111,100,101,77,111,100,117,108,101, + 87,105,116,104,70,105,108,101,110,97,109,101,115,40,41,32, + 105,110,32,116,104,101,32,67,32,65,80,73,46,10,10,32, + 32,32,32,114,0,0,0,0,78,114,96,0,0,0,233,253, + 255,255,255,233,255,255,255,255,90,2,112,121,41,7,114,6, + 0,0,0,114,103,0,0,0,218,5,108,111,119,101,114,114, + 127,0,0,0,114,106,0,0,0,114,110,0,0,0,114,80, + 0,0,0,41,5,218,13,98,121,116,101,99,111,100,101,95, + 112,97,116,104,114,118,0,0,0,218,1,95,90,9,101,120, + 116,101,110,115,105,111,110,218,11,115,111,117,114,99,101,95, + 112,97,116,104,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,15,95,103,101,116,95,115,111,117,114,99,101, + 102,105,108,101,216,1,0,0,115,20,0,0,0,0,7,12, + 1,4,1,16,1,24,1,4,1,2,1,12,1,16,1,18, + 1,114,134,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,8,0,0,0,67,0,0,0,115, + 72,0,0,0,124,0,160,0,116,1,116,2,131,1,161,1, + 114,46,122,10,116,3,124,0,131,1,87,0,83,0,4,0, + 116,4,121,42,1,0,1,0,1,0,89,0,113,68,48,0, + 110,22,124,0,160,0,116,1,116,5,131,1,161,1,114,64, + 124,0,83,0,100,0,83,0,100,0,83,0,114,69,0,0, + 0,41,6,114,58,0,0,0,218,5,116,117,112,108,101,114, + 126,0,0,0,114,120,0,0,0,114,106,0,0,0,114,112, + 0,0,0,41,1,114,119,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,11,95,103,101,116,95, + 99,97,99,104,101,100,235,1,0,0,115,16,0,0,0,0, + 1,14,1,2,1,10,1,12,1,8,1,14,1,4,2,114, + 136,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,8,0,0,0,67,0,0,0,115,50,0, + 0,0,122,14,116,0,124,0,131,1,106,1,125,1,87,0, + 110,22,4,0,116,2,121,36,1,0,1,0,1,0,100,1, + 125,1,89,0,110,2,48,0,124,1,100,2,79,0,125,1, + 124,1,83,0,41,3,122,51,67,97,108,99,117,108,97,116, + 101,32,116,104,101,32,109,111,100,101,32,112,101,114,109,105, + 115,115,105,111,110,115,32,102,111,114,32,97,32,98,121,116, + 101,99,111,100,101,32,102,105,108,101,46,114,86,0,0,0, + 233,128,0,0,0,41,3,114,75,0,0,0,114,77,0,0, + 0,114,76,0,0,0,41,2,114,65,0,0,0,114,78,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,10,95,99,97,108,99,95,109,111,100,101,247,1,0, + 0,115,12,0,0,0,0,2,2,1,14,1,12,1,10,3, + 8,1,114,138,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,8,0,0,0,3,0,0,0, + 115,66,0,0,0,100,6,135,0,102,1,100,2,100,3,132, + 9,125,1,122,10,116,0,106,1,125,2,87,0,110,26,4, + 0,116,2,121,50,1,0,1,0,1,0,100,4,100,5,132, + 0,125,2,89,0,110,2,48,0,124,2,124,1,136,0,131, + 2,1,0,124,1,83,0,41,7,122,252,68,101,99,111,114, + 97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,116, + 104,97,116,32,116,104,101,32,109,111,100,117,108,101,32,98, + 101,105,110,103,32,114,101,113,117,101,115,116,101,100,32,109, + 97,116,99,104,101,115,32,116,104,101,32,111,110,101,32,116, + 104,101,10,32,32,32,32,108,111,97,100,101,114,32,99,97, + 110,32,104,97,110,100,108,101,46,10,10,32,32,32,32,84, + 104,101,32,102,105,114,115,116,32,97,114,103,117,109,101,110, + 116,32,40,115,101,108,102,41,32,109,117,115,116,32,100,101, + 102,105,110,101,32,95,110,97,109,101,32,119,104,105,99,104, + 32,116,104,101,32,115,101,99,111,110,100,32,97,114,103,117, + 109,101,110,116,32,105,115,10,32,32,32,32,99,111,109,112, + 97,114,101,100,32,97,103,97,105,110,115,116,46,32,73,102, + 32,116,104,101,32,99,111,109,112,97,114,105,115,111,110,32, + 102,97,105,108,115,32,116,104,101,110,32,73,109,112,111,114, + 116,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, + 46,10,10,32,32,32,32,78,99,2,0,0,0,0,0,0, + 0,0,0,0,0,4,0,0,0,4,0,0,0,31,0,0, + 0,115,72,0,0,0,124,1,100,0,117,0,114,16,124,0, + 106,0,125,1,110,32,124,0,106,0,124,1,107,3,114,48, + 116,1,100,1,124,0,106,0,124,1,102,2,22,0,124,1, + 100,2,141,2,130,1,136,0,124,0,124,1,103,2,124,2, + 162,1,82,0,105,0,124,3,164,1,142,1,83,0,41,3, + 78,122,30,108,111,97,100,101,114,32,102,111,114,32,37,115, + 32,99,97,110,110,111,116,32,104,97,110,100,108,101,32,37, + 115,169,1,218,4,110,97,109,101,41,2,114,140,0,0,0, + 218,11,73,109,112,111,114,116,69,114,114,111,114,41,4,218, + 4,115,101,108,102,114,140,0,0,0,218,4,97,114,103,115, + 218,6,107,119,97,114,103,115,169,1,218,6,109,101,116,104, + 111,100,114,10,0,0,0,114,11,0,0,0,218,19,95,99, + 104,101,99,107,95,110,97,109,101,95,119,114,97,112,112,101, + 114,11,2,0,0,115,18,0,0,0,0,1,8,1,8,1, + 10,1,4,1,8,255,2,1,2,255,6,2,122,40,95,99, + 104,101,99,107,95,110,97,109,101,46,60,108,111,99,97,108, + 115,62,46,95,99,104,101,99,107,95,110,97,109,101,95,119, + 114,97,112,112,101,114,99,2,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,7,0,0,0,83,0,0,0,115, + 56,0,0,0,100,1,68,0,93,32,125,2,116,0,124,1, + 124,2,131,2,114,4,116,1,124,0,124,2,116,2,124,1, + 124,2,131,2,131,3,1,0,113,4,124,0,106,3,160,4, + 124,1,106,3,161,1,1,0,100,0,83,0,41,2,78,41, + 4,218,10,95,95,109,111,100,117,108,101,95,95,218,8,95, + 95,110,97,109,101,95,95,218,12,95,95,113,117,97,108,110, + 97,109,101,95,95,218,7,95,95,100,111,99,95,95,41,5, + 218,7,104,97,115,97,116,116,114,218,7,115,101,116,97,116, + 116,114,218,7,103,101,116,97,116,116,114,218,8,95,95,100, + 105,99,116,95,95,218,6,117,112,100,97,116,101,41,3,90, + 3,110,101,119,90,3,111,108,100,114,84,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,5,95, + 119,114,97,112,22,2,0,0,115,8,0,0,0,0,1,8, + 1,10,1,20,1,122,26,95,99,104,101,99,107,95,110,97, + 109,101,46,60,108,111,99,97,108,115,62,46,95,119,114,97, + 112,41,1,78,41,3,218,10,95,98,111,111,116,115,116,114, + 97,112,114,157,0,0,0,218,9,78,97,109,101,69,114,114, + 111,114,41,3,114,146,0,0,0,114,147,0,0,0,114,157, + 0,0,0,114,10,0,0,0,114,145,0,0,0,114,11,0, + 0,0,218,11,95,99,104,101,99,107,95,110,97,109,101,3, + 2,0,0,115,14,0,0,0,0,8,14,7,2,1,10,1, + 12,2,14,5,10,1,114,160,0,0,0,99,2,0,0,0, + 0,0,0,0,0,0,0,0,5,0,0,0,6,0,0,0, + 67,0,0,0,115,60,0,0,0,124,0,160,0,124,1,161, + 1,92,2,125,2,125,3,124,2,100,1,117,0,114,56,116, + 1,124,3,131,1,114,56,100,2,125,4,116,2,160,3,124, + 4,160,4,124,3,100,3,25,0,161,1,116,5,161,2,1, + 0,124,2,83,0,41,4,122,155,84,114,121,32,116,111,32, + 102,105,110,100,32,97,32,108,111,97,100,101,114,32,102,111, + 114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,32, + 109,111,100,117,108,101,32,98,121,32,100,101,108,101,103,97, + 116,105,110,103,32,116,111,10,32,32,32,32,115,101,108,102, + 46,102,105,110,100,95,108,111,97,100,101,114,40,41,46,10, + 10,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100, + 32,105,115,32,100,101,112,114,101,99,97,116,101,100,32,105, + 110,32,102,97,118,111,114,32,111,102,32,102,105,110,100,101, + 114,46,102,105,110,100,95,115,112,101,99,40,41,46,10,10, + 32,32,32,32,78,122,44,78,111,116,32,105,109,112,111,114, + 116,105,110,103,32,100,105,114,101,99,116,111,114,121,32,123, + 125,58,32,109,105,115,115,105,110,103,32,95,95,105,110,105, + 116,95,95,114,0,0,0,0,41,6,218,11,102,105,110,100, + 95,108,111,97,100,101,114,114,6,0,0,0,114,98,0,0, + 0,114,99,0,0,0,114,88,0,0,0,218,13,73,109,112, + 111,114,116,87,97,114,110,105,110,103,41,5,114,142,0,0, + 0,218,8,102,117,108,108,110,97,109,101,218,6,108,111,97, + 100,101,114,218,8,112,111,114,116,105,111,110,115,218,3,109, + 115,103,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,17,95,102,105,110,100,95,109,111,100,117,108,101,95, + 115,104,105,109,31,2,0,0,115,10,0,0,0,0,10,14, + 1,16,1,4,1,22,1,114,167,0,0,0,99,3,0,0, + 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, + 0,67,0,0,0,115,166,0,0,0,124,0,100,1,100,2, + 133,2,25,0,125,3,124,3,116,0,107,3,114,64,100,3, + 124,1,155,2,100,4,124,3,155,2,157,4,125,4,116,1, + 160,2,100,5,124,4,161,2,1,0,116,3,124,4,102,1, + 105,0,124,2,164,1,142,1,130,1,116,4,124,0,131,1, + 100,6,107,0,114,106,100,7,124,1,155,2,157,2,125,4, + 116,1,160,2,100,5,124,4,161,2,1,0,116,5,124,4, + 131,1,130,1,116,6,124,0,100,2,100,8,133,2,25,0, + 131,1,125,5,124,5,100,9,64,0,114,162,100,10,124,5, + 155,2,100,11,124,1,155,2,157,4,125,4,116,3,124,4, + 102,1,105,0,124,2,164,1,142,1,130,1,124,5,83,0, + 41,12,97,84,2,0,0,80,101,114,102,111,114,109,32,98, + 97,115,105,99,32,118,97,108,105,100,105,116,121,32,99,104, + 101,99,107,105,110,103,32,111,102,32,97,32,112,121,99,32, + 104,101,97,100,101,114,32,97,110,100,32,114,101,116,117,114, + 110,32,116,104,101,32,102,108,97,103,115,32,102,105,101,108, + 100,44,10,32,32,32,32,119,104,105,99,104,32,100,101,116, + 101,114,109,105,110,101,115,32,104,111,119,32,116,104,101,32, + 112,121,99,32,115,104,111,117,108,100,32,98,101,32,102,117, + 114,116,104,101,114,32,118,97,108,105,100,97,116,101,100,32, + 97,103,97,105,110,115,116,32,116,104,101,32,115,111,117,114, + 99,101,46,10,10,32,32,32,32,42,100,97,116,97,42,32, + 105,115,32,116,104,101,32,99,111,110,116,101,110,116,115,32, + 111,102,32,116,104,101,32,112,121,99,32,102,105,108,101,46, + 32,40,79,110,108,121,32,116,104,101,32,102,105,114,115,116, + 32,49,54,32,98,121,116,101,115,32,97,114,101,10,32,32, + 32,32,114,101,113,117,105,114,101,100,44,32,116,104,111,117, + 103,104,46,41,10,10,32,32,32,32,42,110,97,109,101,42, + 32,105,115,32,116,104,101,32,110,97,109,101,32,111,102,32, + 116,104,101,32,109,111,100,117,108,101,32,98,101,105,110,103, + 32,105,109,112,111,114,116,101,100,46,32,73,116,32,105,115, + 32,117,115,101,100,32,102,111,114,32,108,111,103,103,105,110, + 103,46,10,10,32,32,32,32,42,101,120,99,95,100,101,116, + 97,105,108,115,42,32,105,115,32,97,32,100,105,99,116,105, + 111,110,97,114,121,32,112,97,115,115,101,100,32,116,111,32, + 73,109,112,111,114,116,69,114,114,111,114,32,105,102,32,105, + 116,32,114,97,105,115,101,100,32,102,111,114,10,32,32,32, + 32,105,109,112,114,111,118,101,100,32,100,101,98,117,103,103, + 105,110,103,46,10,10,32,32,32,32,73,109,112,111,114,116, + 69,114,114,111,114,32,105,115,32,114,97,105,115,101,100,32, + 119,104,101,110,32,116,104,101,32,109,97,103,105,99,32,110, + 117,109,98,101,114,32,105,115,32,105,110,99,111,114,114,101, + 99,116,32,111,114,32,119,104,101,110,32,116,104,101,32,102, + 108,97,103,115,10,32,32,32,32,102,105,101,108,100,32,105, + 115,32,105,110,118,97,108,105,100,46,32,69,79,70,69,114, + 114,111,114,32,105,115,32,114,97,105,115,101,100,32,119,104, + 101,110,32,116,104,101,32,100,97,116,97,32,105,115,32,102, + 111,117,110,100,32,116,111,32,98,101,32,116,114,117,110,99, + 97,116,101,100,46,10,10,32,32,32,32,78,114,34,0,0, + 0,122,20,98,97,100,32,109,97,103,105,99,32,110,117,109, + 98,101,114,32,105,110,32,122,2,58,32,250,2,123,125,233, + 16,0,0,0,122,40,114,101,97,99,104,101,100,32,69,79, + 70,32,119,104,105,108,101,32,114,101,97,100,105,110,103,32, + 112,121,99,32,104,101,97,100,101,114,32,111,102,32,233,8, + 0,0,0,233,252,255,255,255,122,14,105,110,118,97,108,105, + 100,32,102,108,97,103,115,32,122,4,32,105,110,32,41,7, + 218,12,77,65,71,73,67,95,78,85,77,66,69,82,114,158, + 0,0,0,218,16,95,118,101,114,98,111,115,101,95,109,101, + 115,115,97,103,101,114,141,0,0,0,114,6,0,0,0,218, + 8,69,79,70,69,114,114,111,114,114,44,0,0,0,41,6, + 114,43,0,0,0,114,140,0,0,0,218,11,101,120,99,95, + 100,101,116,97,105,108,115,90,5,109,97,103,105,99,114,116, + 0,0,0,114,22,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,13,95,99,108,97,115,115,105, + 102,121,95,112,121,99,48,2,0,0,115,28,0,0,0,0, + 16,12,1,8,1,16,1,12,1,16,1,12,1,10,1,12, + 1,8,1,16,2,8,1,16,1,16,1,114,176,0,0,0, + 99,5,0,0,0,0,0,0,0,0,0,0,0,6,0,0, + 0,4,0,0,0,67,0,0,0,115,120,0,0,0,116,0, + 124,0,100,1,100,2,133,2,25,0,131,1,124,1,100,3, + 64,0,107,3,114,62,100,4,124,3,155,2,157,2,125,5, + 116,1,160,2,100,5,124,5,161,2,1,0,116,3,124,5, + 102,1,105,0,124,4,164,1,142,1,130,1,124,2,100,6, + 117,1,114,116,116,0,124,0,100,2,100,7,133,2,25,0, + 131,1,124,2,100,3,64,0,107,3,114,116,116,3,100,4, + 124,3,155,2,157,2,102,1,105,0,124,4,164,1,142,1, + 130,1,100,6,83,0,41,8,97,7,2,0,0,86,97,108, + 105,100,97,116,101,32,97,32,112,121,99,32,97,103,97,105, + 110,115,116,32,116,104,101,32,115,111,117,114,99,101,32,108, + 97,115,116,45,109,111,100,105,102,105,101,100,32,116,105,109, + 101,46,10,10,32,32,32,32,42,100,97,116,97,42,32,105, + 115,32,116,104,101,32,99,111,110,116,101,110,116,115,32,111, + 102,32,116,104,101,32,112,121,99,32,102,105,108,101,46,32, + 40,79,110,108,121,32,116,104,101,32,102,105,114,115,116,32, + 49,54,32,98,121,116,101,115,32,97,114,101,10,32,32,32, + 32,114,101,113,117,105,114,101,100,46,41,10,10,32,32,32, + 32,42,115,111,117,114,99,101,95,109,116,105,109,101,42,32, + 105,115,32,116,104,101,32,108,97,115,116,32,109,111,100,105, + 102,105,101,100,32,116,105,109,101,115,116,97,109,112,32,111, + 102,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, + 101,46,10,10,32,32,32,32,42,115,111,117,114,99,101,95, + 115,105,122,101,42,32,105,115,32,78,111,110,101,32,111,114, + 32,116,104,101,32,115,105,122,101,32,111,102,32,116,104,101, + 32,115,111,117,114,99,101,32,102,105,108,101,32,105,110,32, + 98,121,116,101,115,46,10,10,32,32,32,32,42,110,97,109, + 101,42,32,105,115,32,116,104,101,32,110,97,109,101,32,111, + 102,32,116,104,101,32,109,111,100,117,108,101,32,98,101,105, + 110,103,32,105,109,112,111,114,116,101,100,46,32,73,116,32, + 105,115,32,117,115,101,100,32,102,111,114,32,108,111,103,103, + 105,110,103,46,10,10,32,32,32,32,42,101,120,99,95,100, + 101,116,97,105,108,115,42,32,105,115,32,97,32,100,105,99, + 116,105,111,110,97,114,121,32,112,97,115,115,101,100,32,116, + 111,32,73,109,112,111,114,116,69,114,114,111,114,32,105,102, + 32,105,116,32,114,97,105,115,101,100,32,102,111,114,10,32, + 32,32,32,105,109,112,114,111,118,101,100,32,100,101,98,117, + 103,103,105,110,103,46,10,10,32,32,32,32,65,110,32,73, + 109,112,111,114,116,69,114,114,111,114,32,105,115,32,114,97, + 105,115,101,100,32,105,102,32,116,104,101,32,98,121,116,101, + 99,111,100,101,32,105,115,32,115,116,97,108,101,46,10,10, + 32,32,32,32,114,170,0,0,0,233,12,0,0,0,114,33, + 0,0,0,122,22,98,121,116,101,99,111,100,101,32,105,115, + 32,115,116,97,108,101,32,102,111,114,32,114,168,0,0,0, + 78,114,169,0,0,0,41,4,114,44,0,0,0,114,158,0, + 0,0,114,173,0,0,0,114,141,0,0,0,41,6,114,43, + 0,0,0,218,12,115,111,117,114,99,101,95,109,116,105,109, + 101,218,11,115,111,117,114,99,101,95,115,105,122,101,114,140, + 0,0,0,114,175,0,0,0,114,116,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,23,95,118, + 97,108,105,100,97,116,101,95,116,105,109,101,115,116,97,109, + 112,95,112,121,99,81,2,0,0,115,16,0,0,0,0,19, + 24,1,10,1,12,1,16,1,8,1,22,255,2,2,114,180, + 0,0,0,99,4,0,0,0,0,0,0,0,0,0,0,0, + 4,0,0,0,4,0,0,0,67,0,0,0,115,42,0,0, + 0,124,0,100,1,100,2,133,2,25,0,124,1,107,3,114, + 38,116,0,100,3,124,2,155,2,157,2,102,1,105,0,124, + 3,164,1,142,1,130,1,100,4,83,0,41,5,97,243,1, + 0,0,86,97,108,105,100,97,116,101,32,97,32,104,97,115, + 104,45,98,97,115,101,100,32,112,121,99,32,98,121,32,99, + 104,101,99,107,105,110,103,32,116,104,101,32,114,101,97,108, + 32,115,111,117,114,99,101,32,104,97,115,104,32,97,103,97, + 105,110,115,116,32,116,104,101,32,111,110,101,32,105,110,10, + 32,32,32,32,116,104,101,32,112,121,99,32,104,101,97,100, + 101,114,46,10,10,32,32,32,32,42,100,97,116,97,42,32, + 105,115,32,116,104,101,32,99,111,110,116,101,110,116,115,32, + 111,102,32,116,104,101,32,112,121,99,32,102,105,108,101,46, + 32,40,79,110,108,121,32,116,104,101,32,102,105,114,115,116, + 32,49,54,32,98,121,116,101,115,32,97,114,101,10,32,32, + 32,32,114,101,113,117,105,114,101,100,46,41,10,10,32,32, + 32,32,42,115,111,117,114,99,101,95,104,97,115,104,42,32, + 105,115,32,116,104,101,32,105,109,112,111,114,116,108,105,98, + 46,117,116,105,108,46,115,111,117,114,99,101,95,104,97,115, + 104,40,41,32,111,102,32,116,104,101,32,115,111,117,114,99, + 101,32,102,105,108,101,46,10,10,32,32,32,32,42,110,97, + 109,101,42,32,105,115,32,116,104,101,32,110,97,109,101,32, + 111,102,32,116,104,101,32,109,111,100,117,108,101,32,98,101, + 105,110,103,32,105,109,112,111,114,116,101,100,46,32,73,116, + 32,105,115,32,117,115,101,100,32,102,111,114,32,108,111,103, + 103,105,110,103,46,10,10,32,32,32,32,42,101,120,99,95, + 100,101,116,97,105,108,115,42,32,105,115,32,97,32,100,105, + 99,116,105,111,110,97,114,121,32,112,97,115,115,101,100,32, + 116,111,32,73,109,112,111,114,116,69,114,114,111,114,32,105, + 102,32,105,116,32,114,97,105,115,101,100,32,102,111,114,10, + 32,32,32,32,105,109,112,114,111,118,101,100,32,100,101,98, + 117,103,103,105,110,103,46,10,10,32,32,32,32,65,110,32, + 73,109,112,111,114,116,69,114,114,111,114,32,105,115,32,114, + 97,105,115,101,100,32,105,102,32,116,104,101,32,98,121,116, + 101,99,111,100,101,32,105,115,32,115,116,97,108,101,46,10, + 10,32,32,32,32,114,170,0,0,0,114,169,0,0,0,122, + 46,104,97,115,104,32,105,110,32,98,121,116,101,99,111,100, + 101,32,100,111,101,115,110,39,116,32,109,97,116,99,104,32, + 104,97,115,104,32,111,102,32,115,111,117,114,99,101,32,78, + 41,1,114,141,0,0,0,41,4,114,43,0,0,0,218,11, + 115,111,117,114,99,101,95,104,97,115,104,114,140,0,0,0, + 114,175,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,18,95,118,97,108,105,100,97,116,101,95, + 104,97,115,104,95,112,121,99,109,2,0,0,115,12,0,0, + 0,0,17,16,1,2,1,8,255,4,2,2,254,114,182,0, + 0,0,99,4,0,0,0,0,0,0,0,0,0,0,0,5, + 0,0,0,5,0,0,0,67,0,0,0,115,80,0,0,0, + 116,0,160,1,124,0,161,1,125,4,116,2,124,4,116,3, + 131,2,114,56,116,4,160,5,100,1,124,2,161,2,1,0, + 124,3,100,2,117,1,114,52,116,6,160,7,124,4,124,3, + 161,2,1,0,124,4,83,0,116,8,100,3,160,9,124,2, + 161,1,124,1,124,2,100,4,141,3,130,1,100,2,83,0, + 41,5,122,35,67,111,109,112,105,108,101,32,98,121,116,101, + 99,111,100,101,32,97,115,32,102,111,117,110,100,32,105,110, + 32,97,32,112,121,99,46,122,21,99,111,100,101,32,111,98, + 106,101,99,116,32,102,114,111,109,32,123,33,114,125,78,122, + 23,78,111,110,45,99,111,100,101,32,111,98,106,101,99,116, + 32,105,110,32,123,33,114,125,169,2,114,140,0,0,0,114, + 65,0,0,0,41,10,218,7,109,97,114,115,104,97,108,90, + 5,108,111,97,100,115,218,10,105,115,105,110,115,116,97,110, + 99,101,218,10,95,99,111,100,101,95,116,121,112,101,114,158, + 0,0,0,114,173,0,0,0,218,4,95,105,109,112,90,16, + 95,102,105,120,95,99,111,95,102,105,108,101,110,97,109,101, + 114,141,0,0,0,114,88,0,0,0,41,5,114,43,0,0, + 0,114,140,0,0,0,114,131,0,0,0,114,133,0,0,0, + 218,4,99,111,100,101,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,17,95,99,111,109,112,105,108,101,95, + 98,121,116,101,99,111,100,101,133,2,0,0,115,18,0,0, + 0,0,2,10,1,10,1,12,1,8,1,12,1,4,2,10, + 1,4,255,114,189,0,0,0,99,3,0,0,0,0,0,0, + 0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,0, + 0,115,70,0,0,0,116,0,116,1,131,1,125,3,124,3, + 160,2,116,3,100,1,131,1,161,1,1,0,124,3,160,2, + 116,3,124,1,131,1,161,1,1,0,124,3,160,2,116,3, + 124,2,131,1,161,1,1,0,124,3,160,2,116,4,160,5, + 124,0,161,1,161,1,1,0,124,3,83,0,41,2,122,43, + 80,114,111,100,117,99,101,32,116,104,101,32,100,97,116,97, + 32,102,111,114,32,97,32,116,105,109,101,115,116,97,109,112, + 45,98,97,115,101,100,32,112,121,99,46,114,0,0,0,0, + 41,6,218,9,98,121,116,101,97,114,114,97,121,114,172,0, + 0,0,218,6,101,120,116,101,110,100,114,39,0,0,0,114, + 184,0,0,0,218,5,100,117,109,112,115,41,4,114,188,0, + 0,0,218,5,109,116,105,109,101,114,179,0,0,0,114,43, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,22,95,99,111,100,101,95,116,111,95,116,105,109, + 101,115,116,97,109,112,95,112,121,99,146,2,0,0,115,12, + 0,0,0,0,2,8,1,14,1,14,1,14,1,16,1,114, + 194,0,0,0,84,99,3,0,0,0,0,0,0,0,0,0, + 0,0,5,0,0,0,5,0,0,0,67,0,0,0,115,80, + 0,0,0,116,0,116,1,131,1,125,3,100,1,124,2,100, + 1,62,0,66,0,125,4,124,3,160,2,116,3,124,4,131, + 1,161,1,1,0,116,4,124,1,131,1,100,2,107,2,115, + 50,74,0,130,1,124,3,160,2,124,1,161,1,1,0,124, + 3,160,2,116,5,160,6,124,0,161,1,161,1,1,0,124, + 3,83,0,41,3,122,38,80,114,111,100,117,99,101,32,116, + 104,101,32,100,97,116,97,32,102,111,114,32,97,32,104,97, + 115,104,45,98,97,115,101,100,32,112,121,99,46,114,4,0, + 0,0,114,170,0,0,0,41,7,114,190,0,0,0,114,172, + 0,0,0,114,191,0,0,0,114,39,0,0,0,114,6,0, + 0,0,114,184,0,0,0,114,192,0,0,0,41,5,114,188, + 0,0,0,114,181,0,0,0,90,7,99,104,101,99,107,101, + 100,114,43,0,0,0,114,22,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,17,95,99,111,100, + 101,95,116,111,95,104,97,115,104,95,112,121,99,156,2,0, + 0,115,14,0,0,0,0,2,8,1,12,1,14,1,16,1, + 10,1,16,1,114,195,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,5,0,0,0,6,0,0,0,67,0, + 0,0,115,62,0,0,0,100,1,100,2,108,0,125,1,116, + 1,160,2,124,0,161,1,106,3,125,2,124,1,160,4,124, + 2,161,1,125,3,116,1,160,5,100,2,100,3,161,2,125, + 4,124,4,160,6,124,0,160,6,124,3,100,1,25,0,161, + 1,161,1,83,0,41,4,122,121,68,101,99,111,100,101,32, + 98,121,116,101,115,32,114,101,112,114,101,115,101,110,116,105, + 110,103,32,115,111,117,114,99,101,32,99,111,100,101,32,97, + 110,100,32,114,101,116,117,114,110,32,116,104,101,32,115,116, + 114,105,110,103,46,10,10,32,32,32,32,85,110,105,118,101, + 114,115,97,108,32,110,101,119,108,105,110,101,32,115,117,112, + 112,111,114,116,32,105,115,32,117,115,101,100,32,105,110,32, + 116,104,101,32,100,101,99,111,100,105,110,103,46,10,32,32, + 32,32,114,0,0,0,0,78,84,41,7,218,8,116,111,107, + 101,110,105,122,101,114,90,0,0,0,90,7,66,121,116,101, + 115,73,79,90,8,114,101,97,100,108,105,110,101,90,15,100, + 101,116,101,99,116,95,101,110,99,111,100,105,110,103,90,25, + 73,110,99,114,101,109,101,110,116,97,108,78,101,119,108,105, + 110,101,68,101,99,111,100,101,114,218,6,100,101,99,111,100, + 101,41,5,218,12,115,111,117,114,99,101,95,98,121,116,101, + 115,114,196,0,0,0,90,21,115,111,117,114,99,101,95,98, + 121,116,101,115,95,114,101,97,100,108,105,110,101,218,8,101, + 110,99,111,100,105,110,103,90,15,110,101,119,108,105,110,101, + 95,100,101,99,111,100,101,114,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,13,100,101,99,111,100,101,95, + 115,111,117,114,99,101,167,2,0,0,115,10,0,0,0,0, + 5,8,1,12,1,10,1,12,1,114,200,0,0,0,169,2, + 114,164,0,0,0,218,26,115,117,98,109,111,100,117,108,101, + 95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,110, + 115,99,2,0,0,0,0,0,0,0,2,0,0,0,9,0, + 0,0,8,0,0,0,67,0,0,0,115,12,1,0,0,124, + 1,100,1,117,0,114,58,100,2,125,1,116,0,124,2,100, + 3,131,2,114,68,122,14,124,2,160,1,124,0,161,1,125, + 1,87,0,113,68,4,0,116,2,121,54,1,0,1,0,1, + 0,89,0,113,68,48,0,110,10,116,3,160,4,124,1,161, + 1,125,1,116,5,106,6,124,0,124,2,124,1,100,4,141, + 3,125,4,100,5,124,4,95,7,124,2,100,1,117,0,114, + 152,116,8,131,0,68,0,93,42,92,2,125,5,125,6,124, + 1,160,9,116,10,124,6,131,1,161,1,114,104,124,5,124, + 0,124,1,131,2,125,2,124,2,124,4,95,11,1,0,113, + 152,113,104,100,1,83,0,124,3,116,12,117,0,114,216,116, + 0,124,2,100,6,131,2,114,222,122,14,124,2,160,13,124, + 0,161,1,125,7,87,0,110,18,4,0,116,2,121,202,1, + 0,1,0,1,0,89,0,113,222,48,0,124,7,114,222,103, + 0,124,4,95,14,110,6,124,3,124,4,95,14,124,4,106, + 14,103,0,107,2,144,1,114,8,124,1,144,1,114,8,116, + 15,124,1,131,1,100,7,25,0,125,8,124,4,106,14,160, + 16,124,8,161,1,1,0,124,4,83,0,41,8,97,61,1, + 0,0,82,101,116,117,114,110,32,97,32,109,111,100,117,108, + 101,32,115,112,101,99,32,98,97,115,101,100,32,111,110,32, + 97,32,102,105,108,101,32,108,111,99,97,116,105,111,110,46, + 10,10,32,32,32,32,84,111,32,105,110,100,105,99,97,116, + 101,32,116,104,97,116,32,116,104,101,32,109,111,100,117,108, + 101,32,105,115,32,97,32,112,97,99,107,97,103,101,44,32, + 115,101,116,10,32,32,32,32,115,117,98,109,111,100,117,108, + 101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111, + 110,115,32,116,111,32,97,32,108,105,115,116,32,111,102,32, + 100,105,114,101,99,116,111,114,121,32,112,97,116,104,115,46, + 32,32,65,110,10,32,32,32,32,101,109,112,116,121,32,108, + 105,115,116,32,105,115,32,115,117,102,102,105,99,105,101,110, + 116,44,32,116,104,111,117,103,104,32,105,116,115,32,110,111, + 116,32,111,116,104,101,114,119,105,115,101,32,117,115,101,102, + 117,108,32,116,111,32,116,104,101,10,32,32,32,32,105,109, + 112,111,114,116,32,115,121,115,116,101,109,46,10,10,32,32, + 32,32,84,104,101,32,108,111,97,100,101,114,32,109,117,115, + 116,32,116,97,107,101,32,97,32,115,112,101,99,32,97,115, + 32,105,116,115,32,111,110,108,121,32,95,95,105,110,105,116, + 95,95,40,41,32,97,114,103,46,10,10,32,32,32,32,78, + 122,9,60,117,110,107,110,111,119,110,62,218,12,103,101,116, + 95,102,105,108,101,110,97,109,101,169,1,218,6,111,114,105, + 103,105,110,84,218,10,105,115,95,112,97,99,107,97,103,101, + 114,0,0,0,0,41,17,114,152,0,0,0,114,203,0,0, + 0,114,141,0,0,0,114,24,0,0,0,114,102,0,0,0, + 114,158,0,0,0,218,10,77,111,100,117,108,101,83,112,101, + 99,90,13,95,115,101,116,95,102,105,108,101,97,116,116,114, + 218,27,95,103,101,116,95,115,117,112,112,111,114,116,101,100, + 95,102,105,108,101,95,108,111,97,100,101,114,115,114,58,0, + 0,0,114,135,0,0,0,114,164,0,0,0,218,9,95,80, + 79,80,85,76,65,84,69,114,206,0,0,0,114,202,0,0, + 0,114,74,0,0,0,114,61,0,0,0,41,9,114,140,0, + 0,0,90,8,108,111,99,97,116,105,111,110,114,164,0,0, + 0,114,202,0,0,0,218,4,115,112,101,99,218,12,108,111, + 97,100,101,114,95,99,108,97,115,115,218,8,115,117,102,102, + 105,120,101,115,114,206,0,0,0,90,7,100,105,114,110,97, + 109,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,23,115,112,101,99,95,102,114,111,109,95,102,105,108, + 101,95,108,111,99,97,116,105,111,110,184,2,0,0,115,62, + 0,0,0,0,12,8,4,4,1,10,2,2,1,14,1,12, + 1,8,2,10,8,16,1,6,3,8,1,14,1,14,1,10, + 1,6,1,6,2,4,3,8,2,10,1,2,1,14,1,12, + 1,6,2,4,1,8,2,6,1,12,1,6,1,12,1,12, + 2,114,213,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,4,0,0,0,64,0,0,0,115, + 80,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,90,4,100,3,90,5,100,4,90,6,101,7,100,5, + 100,6,132,0,131,1,90,8,101,7,100,7,100,8,132,0, + 131,1,90,9,101,7,100,14,100,10,100,11,132,1,131,1, + 90,10,101,7,100,15,100,12,100,13,132,1,131,1,90,11, + 100,9,83,0,41,16,218,21,87,105,110,100,111,119,115,82, + 101,103,105,115,116,114,121,70,105,110,100,101,114,122,62,77, + 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, + 102,111,114,32,109,111,100,117,108,101,115,32,100,101,99,108, + 97,114,101,100,32,105,110,32,116,104,101,32,87,105,110,100, + 111,119,115,32,114,101,103,105,115,116,114,121,46,122,59,83, + 111,102,116,119,97,114,101,92,80,121,116,104,111,110,92,80, + 121,116,104,111,110,67,111,114,101,92,123,115,121,115,95,118, + 101,114,115,105,111,110,125,92,77,111,100,117,108,101,115,92, + 123,102,117,108,108,110,97,109,101,125,122,65,83,111,102,116, + 119,97,114,101,92,80,121,116,104,111,110,92,80,121,116,104, + 111,110,67,111,114,101,92,123,115,121,115,95,118,101,114,115, + 105,111,110,125,92,77,111,100,117,108,101,115,92,123,102,117, + 108,108,110,97,109,101,125,92,68,101,98,117,103,70,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8, + 0,0,0,67,0,0,0,115,54,0,0,0,122,16,116,0, + 160,1,116,0,106,2,124,1,161,2,87,0,83,0,4,0, + 116,3,121,48,1,0,1,0,1,0,116,0,160,1,116,0, + 106,4,124,1,161,2,6,0,89,0,83,0,48,0,100,0, + 83,0,114,69,0,0,0,41,5,218,6,119,105,110,114,101, + 103,90,7,79,112,101,110,75,101,121,90,17,72,75,69,89, + 95,67,85,82,82,69,78,84,95,85,83,69,82,114,76,0, + 0,0,90,18,72,75,69,89,95,76,79,67,65,76,95,77, + 65,67,72,73,78,69,41,2,218,3,99,108,115,114,26,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,14,95,111,112,101,110,95,114,101,103,105,115,116,114, + 121,8,3,0,0,115,8,0,0,0,0,2,2,1,16,1, + 12,1,122,36,87,105,110,100,111,119,115,82,101,103,105,115, + 116,114,121,70,105,110,100,101,114,46,95,111,112,101,110,95, + 114,101,103,105,115,116,114,121,99,2,0,0,0,0,0,0, + 0,0,0,0,0,6,0,0,0,8,0,0,0,67,0,0, + 0,115,132,0,0,0,124,0,106,0,114,14,124,0,106,1, + 125,2,110,6,124,0,106,2,125,2,124,2,106,3,124,1, + 100,1,116,4,106,5,100,0,100,2,133,2,25,0,22,0, + 100,3,141,2,125,3,122,58,124,0,160,6,124,3,161,1, + 143,28,125,4,116,7,160,8,124,4,100,4,161,2,125,5, + 87,0,100,0,4,0,4,0,131,3,1,0,110,16,49,0, + 115,94,48,0,1,0,1,0,1,0,89,0,1,0,87,0, + 110,20,4,0,116,9,121,126,1,0,1,0,1,0,89,0, + 100,0,83,0,48,0,124,5,83,0,41,5,78,122,5,37, + 100,46,37,100,114,45,0,0,0,41,2,114,163,0,0,0, + 90,11,115,121,115,95,118,101,114,115,105,111,110,114,14,0, + 0,0,41,10,218,11,68,69,66,85,71,95,66,85,73,76, + 68,218,18,82,69,71,73,83,84,82,89,95,75,69,89,95, + 68,69,66,85,71,218,12,82,69,71,73,83,84,82,89,95, + 75,69,89,114,88,0,0,0,114,21,0,0,0,218,12,118, + 101,114,115,105,111,110,95,105,110,102,111,114,217,0,0,0, + 114,215,0,0,0,90,10,81,117,101,114,121,86,97,108,117, + 101,114,76,0,0,0,41,6,114,216,0,0,0,114,163,0, + 0,0,90,12,114,101,103,105,115,116,114,121,95,107,101,121, + 114,26,0,0,0,90,4,104,107,101,121,218,8,102,105,108, + 101,112,97,116,104,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,16,95,115,101,97,114,99,104,95,114,101, + 103,105,115,116,114,121,15,3,0,0,115,24,0,0,0,0, + 2,6,1,8,2,6,1,6,1,16,255,6,2,2,1,12, + 1,46,1,12,1,8,1,122,38,87,105,110,100,111,119,115, + 82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,95, + 115,101,97,114,99,104,95,114,101,103,105,115,116,114,121,78, + 99,4,0,0,0,0,0,0,0,0,0,0,0,8,0,0, + 0,8,0,0,0,67,0,0,0,115,120,0,0,0,124,0, + 160,0,124,1,161,1,125,4,124,4,100,0,117,0,114,22, + 100,0,83,0,122,12,116,1,124,4,131,1,1,0,87,0, + 110,20,4,0,116,2,121,54,1,0,1,0,1,0,89,0, + 100,0,83,0,48,0,116,3,131,0,68,0,93,52,92,2, + 125,5,125,6,124,4,160,4,116,5,124,6,131,1,161,1, + 114,62,116,6,106,7,124,1,124,5,124,1,124,4,131,2, + 124,4,100,1,141,3,125,7,124,7,2,0,1,0,83,0, + 113,62,100,0,83,0,41,2,78,114,204,0,0,0,41,8, + 114,223,0,0,0,114,75,0,0,0,114,76,0,0,0,114, + 208,0,0,0,114,58,0,0,0,114,135,0,0,0,114,158, + 0,0,0,218,16,115,112,101,99,95,102,114,111,109,95,108, + 111,97,100,101,114,41,8,114,216,0,0,0,114,163,0,0, + 0,114,65,0,0,0,218,6,116,97,114,103,101,116,114,222, + 0,0,0,114,164,0,0,0,114,212,0,0,0,114,210,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,9,102,105,110,100,95,115,112,101,99,30,3,0,0, + 115,28,0,0,0,0,2,10,1,8,1,4,1,2,1,12, + 1,12,1,8,1,14,1,14,1,6,1,8,1,2,254,6, + 3,122,31,87,105,110,100,111,119,115,82,101,103,105,115,116, + 114,121,70,105,110,100,101,114,46,102,105,110,100,95,115,112, + 101,99,99,3,0,0,0,0,0,0,0,0,0,0,0,4, + 0,0,0,4,0,0,0,67,0,0,0,115,34,0,0,0, + 124,0,160,0,124,1,124,2,161,2,125,3,124,3,100,1, + 117,1,114,26,124,3,106,1,83,0,100,1,83,0,100,1, + 83,0,41,2,122,108,70,105,110,100,32,109,111,100,117,108, + 101,32,110,97,109,101,100,32,105,110,32,116,104,101,32,114, + 101,103,105,115,116,114,121,46,10,10,32,32,32,32,32,32, + 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, + 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, + 101,32,101,120,101,99,95,109,111,100,117,108,101,40,41,32, + 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, + 32,32,78,169,2,114,226,0,0,0,114,164,0,0,0,169, + 4,114,216,0,0,0,114,163,0,0,0,114,65,0,0,0, + 114,210,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,11,102,105,110,100,95,109,111,100,117,108, + 101,46,3,0,0,115,8,0,0,0,0,7,12,1,8,1, + 6,2,122,33,87,105,110,100,111,119,115,82,101,103,105,115, + 116,114,121,70,105,110,100,101,114,46,102,105,110,100,95,109, + 111,100,117,108,101,41,2,78,78,41,1,78,41,12,114,149, + 0,0,0,114,148,0,0,0,114,150,0,0,0,114,151,0, + 0,0,114,220,0,0,0,114,219,0,0,0,114,218,0,0, + 0,218,11,99,108,97,115,115,109,101,116,104,111,100,114,217, + 0,0,0,114,223,0,0,0,114,226,0,0,0,114,229,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,214,0,0,0,252,2,0,0,115, + 28,0,0,0,8,2,4,3,2,255,2,4,2,255,2,3, + 4,2,2,1,10,6,2,1,10,14,2,1,12,15,2,1, + 114,214,0,0,0,99,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,48, + 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, + 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, + 6,100,7,132,0,90,6,100,8,100,9,132,0,90,7,100, + 10,83,0,41,11,218,13,95,76,111,97,100,101,114,66,97, + 115,105,99,115,122,83,66,97,115,101,32,99,108,97,115,115, + 32,111,102,32,99,111,109,109,111,110,32,99,111,100,101,32, + 110,101,101,100,101,100,32,98,121,32,98,111,116,104,32,83, + 111,117,114,99,101,76,111,97,100,101,114,32,97,110,100,10, + 32,32,32,32,83,111,117,114,99,101,108,101,115,115,70,105, + 108,101,76,111,97,100,101,114,46,99,2,0,0,0,0,0, + 0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,0, + 0,0,115,64,0,0,0,116,0,124,0,160,1,124,1,161, + 1,131,1,100,1,25,0,125,2,124,2,160,2,100,2,100, + 1,161,2,100,3,25,0,125,3,124,1,160,3,100,2,161, + 1,100,4,25,0,125,4,124,3,100,5,107,2,111,62,124, + 4,100,5,107,3,83,0,41,6,122,141,67,111,110,99,114, + 101,116,101,32,105,109,112,108,101,109,101,110,116,97,116,105, + 111,110,32,111,102,32,73,110,115,112,101,99,116,76,111,97, + 100,101,114,46,105,115,95,112,97,99,107,97,103,101,32,98, + 121,32,99,104,101,99,107,105,110,103,32,105,102,10,32,32, + 32,32,32,32,32,32,116,104,101,32,112,97,116,104,32,114, + 101,116,117,114,110,101,100,32,98,121,32,103,101,116,95,102, + 105,108,101,110,97,109,101,32,104,97,115,32,97,32,102,105, + 108,101,110,97,109,101,32,111,102,32,39,95,95,105,110,105, + 116,95,95,46,112,121,39,46,114,4,0,0,0,114,96,0, + 0,0,114,0,0,0,0,114,45,0,0,0,218,8,95,95, + 105,110,105,116,95,95,41,4,114,74,0,0,0,114,203,0, + 0,0,114,124,0,0,0,114,103,0,0,0,41,5,114,142, + 0,0,0,114,163,0,0,0,114,119,0,0,0,90,13,102, + 105,108,101,110,97,109,101,95,98,97,115,101,90,9,116,97, + 105,108,95,110,97,109,101,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,206,0,0,0,65,3,0,0,115, + 8,0,0,0,0,3,18,1,16,1,14,1,122,24,95,76, + 111,97,100,101,114,66,97,115,105,99,115,46,105,115,95,112, + 97,99,107,97,103,101,99,2,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,169,2,122,42,85,115,101,32, + 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, + 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, + 97,116,105,111,110,46,78,114,10,0,0,0,169,2,114,142, + 0,0,0,114,210,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,13,99,114,101,97,116,101,95, + 109,111,100,117,108,101,73,3,0,0,115,2,0,0,0,0, + 1,122,27,95,76,111,97,100,101,114,66,97,115,105,99,115, + 46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,5, + 0,0,0,67,0,0,0,115,56,0,0,0,124,0,160,0, + 124,1,106,1,161,1,125,2,124,2,100,1,117,0,114,36, + 116,2,100,2,160,3,124,1,106,1,161,1,131,1,130,1, + 116,4,160,5,116,6,124,2,124,1,106,7,161,3,1,0, + 100,1,83,0,41,3,122,19,69,120,101,99,117,116,101,32, + 116,104,101,32,109,111,100,117,108,101,46,78,122,52,99,97, + 110,110,111,116,32,108,111,97,100,32,109,111,100,117,108,101, + 32,123,33,114,125,32,119,104,101,110,32,103,101,116,95,99, + 111,100,101,40,41,32,114,101,116,117,114,110,115,32,78,111, + 110,101,41,8,218,8,103,101,116,95,99,111,100,101,114,149, + 0,0,0,114,141,0,0,0,114,88,0,0,0,114,158,0, + 0,0,218,25,95,99,97,108,108,95,119,105,116,104,95,102, + 114,97,109,101,115,95,114,101,109,111,118,101,100,218,4,101, + 120,101,99,114,155,0,0,0,41,3,114,142,0,0,0,218, + 6,109,111,100,117,108,101,114,188,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,11,101,120,101, + 99,95,109,111,100,117,108,101,76,3,0,0,115,12,0,0, + 0,0,2,12,1,8,1,6,1,4,255,6,2,122,25,95, + 76,111,97,100,101,114,66,97,115,105,99,115,46,101,120,101, + 99,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, + 0,115,12,0,0,0,116,0,160,1,124,0,124,1,161,2, + 83,0,41,1,122,26,84,104,105,115,32,109,111,100,117,108, + 101,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, + 41,2,114,158,0,0,0,218,17,95,108,111,97,100,95,109, + 111,100,117,108,101,95,115,104,105,109,169,2,114,142,0,0, + 0,114,163,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,11,108,111,97,100,95,109,111,100,117, + 108,101,84,3,0,0,115,2,0,0,0,0,2,122,25,95, + 76,111,97,100,101,114,66,97,115,105,99,115,46,108,111,97, + 100,95,109,111,100,117,108,101,78,41,8,114,149,0,0,0, + 114,148,0,0,0,114,150,0,0,0,114,151,0,0,0,114, + 206,0,0,0,114,235,0,0,0,114,240,0,0,0,114,243, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,231,0,0,0,60,3,0,0, + 115,10,0,0,0,8,2,4,3,8,8,8,3,8,8,114, + 231,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,64,0,0,0,115,74,0, + 0,0,101,0,90,1,100,0,90,2,100,1,100,2,132,0, + 90,3,100,3,100,4,132,0,90,4,100,5,100,6,132,0, + 90,5,100,7,100,8,132,0,90,6,100,9,100,10,132,0, + 90,7,100,11,100,12,156,1,100,13,100,14,132,2,90,8, + 100,15,100,16,132,0,90,9,100,17,83,0,41,18,218,12, + 83,111,117,114,99,101,76,111,97,100,101,114,99,2,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,8,0,0,0,116,0,130,1,100,1, + 83,0,41,2,122,165,79,112,116,105,111,110,97,108,32,109, + 101,116,104,111,100,32,116,104,97,116,32,114,101,116,117,114, + 110,115,32,116,104,101,32,109,111,100,105,102,105,99,97,116, + 105,111,110,32,116,105,109,101,32,40,97,110,32,105,110,116, + 41,32,102,111,114,32,116,104,101,10,32,32,32,32,32,32, + 32,32,115,112,101,99,105,102,105,101,100,32,112,97,116,104, + 32,40,97,32,115,116,114,41,46,10,10,32,32,32,32,32, + 32,32,32,82,97,105,115,101,115,32,79,83,69,114,114,111, + 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, + 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, + 100,46,10,32,32,32,32,32,32,32,32,78,41,1,114,76, + 0,0,0,169,2,114,142,0,0,0,114,65,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,10, + 112,97,116,104,95,109,116,105,109,101,91,3,0,0,115,2, + 0,0,0,0,6,122,23,83,111,117,114,99,101,76,111,97, + 100,101,114,46,112,97,116,104,95,109,116,105,109,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,67,0,0,0,115,14,0,0,0,100,1,124,0, + 160,0,124,1,161,1,105,1,83,0,41,2,97,158,1,0, + 0,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, + 32,114,101,116,117,114,110,105,110,103,32,97,32,109,101,116, + 97,100,97,116,97,32,100,105,99,116,32,102,111,114,32,116, + 104,101,32,115,112,101,99,105,102,105,101,100,10,32,32,32, + 32,32,32,32,32,112,97,116,104,32,40,97,32,115,116,114, + 41,46,10,10,32,32,32,32,32,32,32,32,80,111,115,115, + 105,98,108,101,32,107,101,121,115,58,10,32,32,32,32,32, + 32,32,32,45,32,39,109,116,105,109,101,39,32,40,109,97, + 110,100,97,116,111,114,121,41,32,105,115,32,116,104,101,32, + 110,117,109,101,114,105,99,32,116,105,109,101,115,116,97,109, + 112,32,111,102,32,108,97,115,116,32,115,111,117,114,99,101, + 10,32,32,32,32,32,32,32,32,32,32,99,111,100,101,32, + 109,111,100,105,102,105,99,97,116,105,111,110,59,10,32,32, + 32,32,32,32,32,32,45,32,39,115,105,122,101,39,32,40, + 111,112,116,105,111,110,97,108,41,32,105,115,32,116,104,101, + 32,115,105,122,101,32,105,110,32,98,121,116,101,115,32,111, + 102,32,116,104,101,32,115,111,117,114,99,101,32,99,111,100, + 101,46,10,10,32,32,32,32,32,32,32,32,73,109,112,108, + 101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,101, + 116,104,111,100,32,97,108,108,111,119,115,32,116,104,101,32, + 108,111,97,100,101,114,32,116,111,32,114,101,97,100,32,98, + 121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,32, + 32,32,32,32,32,32,32,82,97,105,115,101,115,32,79,83, + 69,114,114,111,114,32,119,104,101,110,32,116,104,101,32,112, + 97,116,104,32,99,97,110,110,111,116,32,98,101,32,104,97, + 110,100,108,101,100,46,10,32,32,32,32,32,32,32,32,114, + 193,0,0,0,41,1,114,246,0,0,0,114,245,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 10,112,97,116,104,95,115,116,97,116,115,99,3,0,0,115, + 2,0,0,0,0,12,122,23,83,111,117,114,99,101,76,111, + 97,100,101,114,46,112,97,116,104,95,115,116,97,116,115,99, + 4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 4,0,0,0,67,0,0,0,115,12,0,0,0,124,0,160, + 0,124,2,124,3,161,2,83,0,41,1,122,228,79,112,116, + 105,111,110,97,108,32,109,101,116,104,111,100,32,119,104,105, + 99,104,32,119,114,105,116,101,115,32,100,97,116,97,32,40, + 98,121,116,101,115,41,32,116,111,32,97,32,102,105,108,101, + 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, + 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, + 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, + 32,97,108,108,111,119,115,32,102,111,114,32,116,104,101,32, + 119,114,105,116,105,110,103,32,111,102,32,98,121,116,101,99, + 111,100,101,32,102,105,108,101,115,46,10,10,32,32,32,32, + 32,32,32,32,84,104,101,32,115,111,117,114,99,101,32,112, + 97,116,104,32,105,115,32,110,101,101,100,101,100,32,105,110, + 32,111,114,100,101,114,32,116,111,32,99,111,114,114,101,99, + 116,108,121,32,116,114,97,110,115,102,101,114,32,112,101,114, + 109,105,115,115,105,111,110,115,10,32,32,32,32,32,32,32, + 32,41,1,218,8,115,101,116,95,100,97,116,97,41,4,114, + 142,0,0,0,114,133,0,0,0,90,10,99,97,99,104,101, + 95,112,97,116,104,114,43,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,15,95,99,97,99,104, + 101,95,98,121,116,101,99,111,100,101,113,3,0,0,115,2, + 0,0,0,0,8,122,28,83,111,117,114,99,101,76,111,97, + 100,101,114,46,95,99,97,99,104,101,95,98,121,116,101,99, + 111,100,101,99,3,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,1,83,0,41,2,122,150,79,112,116,105,111,110,97, + 108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119, + 114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101, + 115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116, + 104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32, + 32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103, + 32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108, + 111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116, + 105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32, + 102,105,108,101,115,46,10,32,32,32,32,32,32,32,32,78, + 114,10,0,0,0,41,3,114,142,0,0,0,114,65,0,0, + 0,114,43,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,248,0,0,0,123,3,0,0,115,2, + 0,0,0,0,1,122,21,83,111,117,114,99,101,76,111,97, + 100,101,114,46,115,101,116,95,100,97,116,97,99,2,0,0, + 0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0, + 0,67,0,0,0,115,84,0,0,0,124,0,160,0,124,1, + 161,1,125,2,122,14,124,0,160,1,124,2,161,1,125,3, + 87,0,110,50,4,0,116,2,121,74,1,0,125,4,1,0, + 122,26,116,3,100,1,124,1,100,2,141,2,124,4,130,2, + 87,0,89,0,100,3,125,4,126,4,110,10,100,3,125,4, + 126,4,48,0,48,0,116,4,124,3,131,1,83,0,41,4, + 122,52,67,111,110,99,114,101,116,101,32,105,109,112,108,101, + 109,101,110,116,97,116,105,111,110,32,111,102,32,73,110,115, + 112,101,99,116,76,111,97,100,101,114,46,103,101,116,95,115, + 111,117,114,99,101,46,122,39,115,111,117,114,99,101,32,110, + 111,116,32,97,118,97,105,108,97,98,108,101,32,116,104,114, + 111,117,103,104,32,103,101,116,95,100,97,116,97,40,41,114, + 139,0,0,0,78,41,5,114,203,0,0,0,218,8,103,101, + 116,95,100,97,116,97,114,76,0,0,0,114,141,0,0,0, + 114,200,0,0,0,41,5,114,142,0,0,0,114,163,0,0, + 0,114,65,0,0,0,114,198,0,0,0,218,3,101,120,99, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 10,103,101,116,95,115,111,117,114,99,101,130,3,0,0,115, + 20,0,0,0,0,2,10,1,2,1,14,1,14,1,4,1, + 2,255,4,1,2,255,24,2,122,23,83,111,117,114,99,101, + 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, + 101,114,129,0,0,0,41,1,218,9,95,111,112,116,105,109, + 105,122,101,99,3,0,0,0,0,0,0,0,1,0,0,0, + 4,0,0,0,8,0,0,0,67,0,0,0,115,22,0,0, + 0,116,0,106,1,116,2,124,1,124,2,100,1,100,2,124, + 3,100,3,141,6,83,0,41,4,122,130,82,101,116,117,114, + 110,32,116,104,101,32,99,111,100,101,32,111,98,106,101,99, + 116,32,99,111,109,112,105,108,101,100,32,102,114,111,109,32, + 115,111,117,114,99,101,46,10,10,32,32,32,32,32,32,32, + 32,84,104,101,32,39,100,97,116,97,39,32,97,114,103,117, + 109,101,110,116,32,99,97,110,32,98,101,32,97,110,121,32, + 111,98,106,101,99,116,32,116,121,112,101,32,116,104,97,116, + 32,99,111,109,112,105,108,101,40,41,32,115,117,112,112,111, + 114,116,115,46,10,32,32,32,32,32,32,32,32,114,238,0, + 0,0,84,41,2,218,12,100,111,110,116,95,105,110,104,101, + 114,105,116,114,107,0,0,0,41,3,114,158,0,0,0,114, + 237,0,0,0,218,7,99,111,109,112,105,108,101,41,4,114, + 142,0,0,0,114,43,0,0,0,114,65,0,0,0,114,253, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,14,115,111,117,114,99,101,95,116,111,95,99,111, + 100,101,140,3,0,0,115,6,0,0,0,0,5,12,1,4, + 255,122,27,83,111,117,114,99,101,76,111,97,100,101,114,46, + 115,111,117,114,99,101,95,116,111,95,99,111,100,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,9, + 0,0,0,67,0,0,0,115,24,2,0,0,124,0,160,0, + 124,1,161,1,125,2,100,1,125,3,100,1,125,4,100,1, + 125,5,100,2,125,6,100,3,125,7,122,12,116,1,124,2, + 131,1,125,8,87,0,110,24,4,0,116,2,121,66,1,0, + 1,0,1,0,100,1,125,8,89,0,144,1,110,42,48,0, + 122,14,124,0,160,3,124,2,161,1,125,9,87,0,110,20, + 4,0,116,4,121,102,1,0,1,0,1,0,89,0,144,1, + 110,6,48,0,116,5,124,9,100,4,25,0,131,1,125,3, + 122,14,124,0,160,6,124,8,161,1,125,10,87,0,110,18, + 4,0,116,4,121,148,1,0,1,0,1,0,89,0,110,216, + 48,0,124,1,124,8,100,5,156,2,125,11,122,148,116,7, + 124,10,124,1,124,11,131,3,125,12,116,8,124,10,131,1, + 100,6,100,1,133,2,25,0,125,13,124,12,100,7,64,0, + 100,8,107,3,125,6,124,6,144,1,114,30,124,12,100,9, + 64,0,100,8,107,3,125,7,116,9,106,10,100,10,107,3, + 144,1,114,50,124,7,115,248,116,9,106,10,100,11,107,2, + 144,1,114,50,124,0,160,6,124,2,161,1,125,4,116,9, + 160,11,116,12,124,4,161,2,125,5,116,13,124,10,124,5, + 124,1,124,11,131,4,1,0,110,20,116,14,124,10,124,3, + 124,9,100,12,25,0,124,1,124,11,131,5,1,0,87,0, + 110,24,4,0,116,15,116,16,102,2,144,1,121,76,1,0, + 1,0,1,0,89,0,110,32,48,0,116,17,160,18,100,13, + 124,8,124,2,161,3,1,0,116,19,124,13,124,1,124,8, + 124,2,100,14,141,4,83,0,124,4,100,1,117,0,144,1, + 114,128,124,0,160,6,124,2,161,1,125,4,124,0,160,20, + 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, + 161,2,1,0,116,21,106,22,144,2,115,20,124,8,100,1, + 117,1,144,2,114,20,124,3,100,1,117,1,144,2,114,20, + 124,6,144,1,114,220,124,5,100,1,117,0,144,1,114,206, + 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, + 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, + 124,4,131,1,131,3,125,10,122,18,124,0,160,26,124,2, + 124,8,124,10,161,3,1,0,87,0,110,20,4,0,116,2, + 144,2,121,18,1,0,1,0,1,0,89,0,110,2,48,0, + 124,14,83,0,41,16,122,190,67,111,110,99,114,101,116,101, + 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, + 111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114, + 46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32, + 32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98, + 121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115, + 32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98, + 101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84, + 111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32, + 98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97, + 116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32, + 105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32, + 32,32,32,32,32,32,78,70,84,114,193,0,0,0,114,183, + 0,0,0,114,169,0,0,0,114,4,0,0,0,114,0,0, + 0,0,114,45,0,0,0,90,5,110,101,118,101,114,90,6, + 97,108,119,97,121,115,218,4,115,105,122,101,122,13,123,125, + 32,109,97,116,99,104,101,115,32,123,125,41,3,114,140,0, + 0,0,114,131,0,0,0,114,133,0,0,0,122,19,99,111, + 100,101,32,111,98,106,101,99,116,32,102,114,111,109,32,123, + 125,41,27,114,203,0,0,0,114,120,0,0,0,114,106,0, + 0,0,114,247,0,0,0,114,76,0,0,0,114,36,0,0, + 0,114,250,0,0,0,114,176,0,0,0,218,10,109,101,109, + 111,114,121,118,105,101,119,114,187,0,0,0,90,21,99,104, + 101,99,107,95,104,97,115,104,95,98,97,115,101,100,95,112, + 121,99,115,114,181,0,0,0,218,17,95,82,65,87,95,77, + 65,71,73,67,95,78,85,77,66,69,82,114,182,0,0,0, + 114,180,0,0,0,114,141,0,0,0,114,174,0,0,0,114, + 158,0,0,0,114,173,0,0,0,114,189,0,0,0,114,0, + 1,0,0,114,21,0,0,0,218,19,100,111,110,116,95,119, + 114,105,116,101,95,98,121,116,101,99,111,100,101,114,195,0, + 0,0,114,194,0,0,0,114,6,0,0,0,114,249,0,0, + 0,41,15,114,142,0,0,0,114,163,0,0,0,114,133,0, + 0,0,114,178,0,0,0,114,198,0,0,0,114,181,0,0, + 0,90,10,104,97,115,104,95,98,97,115,101,100,90,12,99, + 104,101,99,107,95,115,111,117,114,99,101,114,131,0,0,0, + 218,2,115,116,114,43,0,0,0,114,175,0,0,0,114,22, + 0,0,0,90,10,98,121,116,101,115,95,100,97,116,97,90, + 11,99,111,100,101,95,111,98,106,101,99,116,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,236,0,0,0, + 148,3,0,0,115,152,0,0,0,0,7,10,1,4,1,4, + 1,4,1,4,1,4,1,2,1,12,1,12,1,12,2,2, + 1,14,1,12,1,8,2,12,1,2,1,14,1,12,1,6, + 3,2,1,2,254,6,4,2,1,12,1,16,1,12,1,6, + 1,12,1,12,1,2,255,2,2,8,254,4,3,10,1,4, + 1,2,1,2,254,4,4,8,1,2,255,6,3,2,1,2, + 1,2,1,6,1,2,1,2,251,8,7,18,1,6,2,8, + 1,2,255,4,2,6,1,2,1,2,254,6,3,10,1,10, + 1,12,1,12,1,18,1,6,255,4,2,6,1,10,1,10, + 1,14,2,6,1,6,255,4,2,2,1,18,1,14,1,6, + 1,122,21,83,111,117,114,99,101,76,111,97,100,101,114,46, + 103,101,116,95,99,111,100,101,78,41,10,114,149,0,0,0, + 114,148,0,0,0,114,150,0,0,0,114,246,0,0,0,114, + 247,0,0,0,114,249,0,0,0,114,248,0,0,0,114,252, + 0,0,0,114,0,1,0,0,114,236,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,244,0,0,0,89,3,0,0,115,14,0,0,0,8, + 2,8,8,8,14,8,10,8,7,8,10,14,8,114,244,0, + 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,4,0,0,0,0,0,0,0,115,124,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, + 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, + 132,0,90,6,101,7,135,0,102,1,100,8,100,9,132,8, + 131,1,90,8,101,7,100,10,100,11,132,0,131,1,90,9, + 100,12,100,13,132,0,90,10,101,7,100,14,100,15,132,0, + 131,1,90,11,100,16,100,17,132,0,90,12,100,18,100,19, + 132,0,90,13,100,20,100,21,132,0,90,14,100,22,100,23, + 132,0,90,15,135,0,4,0,90,16,83,0,41,24,218,10, + 70,105,108,101,76,111,97,100,101,114,122,103,66,97,115,101, + 32,102,105,108,101,32,108,111,97,100,101,114,32,99,108,97, + 115,115,32,119,104,105,99,104,32,105,109,112,108,101,109,101, + 110,116,115,32,116,104,101,32,108,111,97,100,101,114,32,112, + 114,111,116,111,99,111,108,32,109,101,116,104,111,100,115,32, + 116,104,97,116,10,32,32,32,32,114,101,113,117,105,114,101, + 32,102,105,108,101,32,115,121,115,116,101,109,32,117,115,97, + 103,101,46,99,3,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0, + 0,124,1,124,0,95,0,124,2,124,0,95,1,100,1,83, + 0,41,2,122,75,67,97,99,104,101,32,116,104,101,32,109, + 111,100,117,108,101,32,110,97,109,101,32,97,110,100,32,116, + 104,101,32,112,97,116,104,32,116,111,32,116,104,101,32,102, + 105,108,101,32,102,111,117,110,100,32,98,121,32,116,104,101, + 10,32,32,32,32,32,32,32,32,102,105,110,100,101,114,46, + 78,114,183,0,0,0,41,3,114,142,0,0,0,114,163,0, + 0,0,114,65,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,232,0,0,0,238,3,0,0,115, + 4,0,0,0,0,3,6,1,122,19,70,105,108,101,76,111, + 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0, + 0,0,67,0,0,0,115,24,0,0,0,124,0,106,0,124, + 1,106,0,107,2,111,22,124,0,106,1,124,1,106,1,107, + 2,83,0,114,69,0,0,0,169,2,218,9,95,95,99,108, + 97,115,115,95,95,114,155,0,0,0,169,2,114,142,0,0, + 0,90,5,111,116,104,101,114,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,6,95,95,101,113,95,95,244, + 3,0,0,115,6,0,0,0,0,1,12,1,10,255,122,17, + 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, + 95,99,1,0,0,0,0,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,20,0,0,0,116, + 0,124,0,106,1,131,1,116,0,124,0,106,2,131,1,65, + 0,83,0,114,69,0,0,0,169,3,218,4,104,97,115,104, + 114,140,0,0,0,114,65,0,0,0,169,1,114,142,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,8,95,95,104,97,115,104,95,95,248,3,0,0,115,2, + 0,0,0,0,1,122,19,70,105,108,101,76,111,97,100,101, + 114,46,95,95,104,97,115,104,95,95,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,3, + 0,0,0,115,16,0,0,0,116,0,116,1,124,0,131,2, + 160,2,124,1,161,1,83,0,41,1,122,100,76,111,97,100, + 32,97,32,109,111,100,117,108,101,32,102,114,111,109,32,97, + 32,102,105,108,101,46,10,10,32,32,32,32,32,32,32,32, + 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, + 101,120,101,99,95,109,111,100,117,108,101,40,41,32,105,110, + 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, + 41,3,218,5,115,117,112,101,114,114,6,1,0,0,114,243, + 0,0,0,114,242,0,0,0,169,1,114,8,1,0,0,114, + 10,0,0,0,114,11,0,0,0,114,243,0,0,0,251,3, + 0,0,115,2,0,0,0,0,10,122,22,70,105,108,101,76, + 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124, + 0,106,0,83,0,169,1,122,58,82,101,116,117,114,110,32, + 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,32, + 115,111,117,114,99,101,32,102,105,108,101,32,97,115,32,102, + 111,117,110,100,32,98,121,32,116,104,101,32,102,105,110,100, + 101,114,46,114,71,0,0,0,114,242,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,203,0,0, + 0,7,4,0,0,115,2,0,0,0,0,3,122,23,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,102,105,108, + 101,110,97,109,101,99,2,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,8,0,0,0,67,0,0,0,115,126, + 0,0,0,116,0,124,0,116,1,116,2,102,2,131,2,114, + 70,116,3,160,4,116,5,124,1,131,1,161,1,143,24,125, + 2,124,2,160,6,161,0,87,0,2,0,100,1,4,0,4, + 0,131,3,1,0,83,0,49,0,115,58,48,0,1,0,1, + 0,1,0,89,0,1,0,110,52,116,3,160,7,124,1,100, + 2,161,2,143,24,125,2,124,2,160,6,161,0,87,0,2, + 0,100,1,4,0,4,0,131,3,1,0,83,0,49,0,115, + 112,48,0,1,0,1,0,1,0,89,0,1,0,100,1,83, + 0,41,3,122,39,82,101,116,117,114,110,32,116,104,101,32, + 100,97,116,97,32,102,114,111,109,32,112,97,116,104,32,97, + 115,32,114,97,119,32,98,121,116,101,115,46,78,218,1,114, + 41,8,114,185,0,0,0,114,244,0,0,0,218,19,69,120, + 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, + 114,114,90,0,0,0,90,9,111,112,101,110,95,99,111,100, + 101,114,108,0,0,0,90,4,114,101,97,100,114,91,0,0, + 0,41,3,114,142,0,0,0,114,65,0,0,0,114,93,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,250,0,0,0,12,4,0,0,115,10,0,0,0,0, + 2,14,1,16,1,40,2,14,1,122,19,70,105,108,101,76, + 111,97,100,101,114,46,103,101,116,95,100,97,116,97,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3, + 0,0,0,67,0,0,0,115,18,0,0,0,124,0,160,0, + 124,1,161,1,114,14,124,0,83,0,100,0,83,0,114,69, + 0,0,0,41,1,114,206,0,0,0,169,2,114,142,0,0, + 0,114,239,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,19,103,101,116,95,114,101,115,111,117, + 114,99,101,95,114,101,97,100,101,114,23,4,0,0,115,6, + 0,0,0,0,2,10,1,4,1,122,30,70,105,108,101,76, + 111,97,100,101,114,46,103,101,116,95,114,101,115,111,117,114, + 99,101,95,114,101,97,100,101,114,99,2,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, + 0,0,115,32,0,0,0,116,0,116,1,124,0,106,2,131, + 1,100,1,25,0,124,1,131,2,125,2,116,3,160,4,124, + 2,100,2,161,2,83,0,41,3,78,114,0,0,0,0,114, + 18,1,0,0,41,5,114,67,0,0,0,114,74,0,0,0, + 114,65,0,0,0,114,90,0,0,0,114,91,0,0,0,169, + 3,114,142,0,0,0,90,8,114,101,115,111,117,114,99,101, + 114,65,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,13,111,112,101,110,95,114,101,115,111,117, + 114,99,101,29,4,0,0,115,4,0,0,0,0,1,20,1, + 122,24,70,105,108,101,76,111,97,100,101,114,46,111,112,101, + 110,95,114,101,115,111,117,114,99,101,99,2,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, + 0,0,0,115,38,0,0,0,124,0,160,0,124,1,161,1, + 115,14,116,1,130,1,116,2,116,3,124,0,106,4,131,1, + 100,1,25,0,124,1,131,2,125,2,124,2,83,0,169,2, + 78,114,0,0,0,0,41,5,218,11,105,115,95,114,101,115, + 111,117,114,99,101,218,17,70,105,108,101,78,111,116,70,111, + 117,110,100,69,114,114,111,114,114,67,0,0,0,114,74,0, + 0,0,114,65,0,0,0,114,22,1,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,13,114,101,115, + 111,117,114,99,101,95,112,97,116,104,33,4,0,0,115,8, + 0,0,0,0,1,10,1,4,1,20,1,122,24,70,105,108, + 101,76,111,97,100,101,114,46,114,101,115,111,117,114,99,101, + 95,112,97,116,104,99,2,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,40, + 0,0,0,116,0,124,1,118,0,114,12,100,1,83,0,116, + 1,116,2,124,0,106,3,131,1,100,2,25,0,124,1,131, + 2,125,2,116,4,124,2,131,1,83,0,41,3,78,70,114, + 0,0,0,0,41,5,114,59,0,0,0,114,67,0,0,0, + 114,74,0,0,0,114,65,0,0,0,114,80,0,0,0,169, + 3,114,142,0,0,0,114,140,0,0,0,114,65,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 25,1,0,0,39,4,0,0,115,8,0,0,0,0,1,8, + 1,4,1,20,1,122,22,70,105,108,101,76,111,97,100,101, + 114,46,105,115,95,114,101,115,111,117,114,99,101,99,1,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0, + 0,0,67,0,0,0,115,24,0,0,0,116,0,116,1,160, + 2,116,3,124,0,106,4,131,1,100,1,25,0,161,1,131, + 1,83,0,114,24,1,0,0,41,5,218,4,105,116,101,114, + 114,24,0,0,0,218,7,108,105,115,116,100,105,114,114,74, + 0,0,0,114,65,0,0,0,114,13,1,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,8,99,111, + 110,116,101,110,116,115,45,4,0,0,115,2,0,0,0,0, + 1,122,19,70,105,108,101,76,111,97,100,101,114,46,99,111, + 110,116,101,110,116,115,41,17,114,149,0,0,0,114,148,0, + 0,0,114,150,0,0,0,114,151,0,0,0,114,232,0,0, + 0,114,10,1,0,0,114,14,1,0,0,114,160,0,0,0, + 114,243,0,0,0,114,203,0,0,0,114,250,0,0,0,114, + 21,1,0,0,114,23,1,0,0,114,27,1,0,0,114,25, + 1,0,0,114,31,1,0,0,90,13,95,95,99,108,97,115, + 115,99,101,108,108,95,95,114,10,0,0,0,114,10,0,0, + 0,114,16,1,0,0,114,11,0,0,0,114,6,1,0,0, + 233,3,0,0,115,30,0,0,0,8,2,4,3,8,6,8, + 4,8,3,2,1,14,11,2,1,10,4,8,11,2,1,10, + 5,8,4,8,6,8,6,114,6,1,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,64,0,0,0,115,46,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, + 100,5,132,0,90,5,100,6,100,7,156,1,100,8,100,9, + 132,2,90,6,100,10,83,0,41,11,218,16,83,111,117,114, + 99,101,70,105,108,101,76,111,97,100,101,114,122,62,67,111, + 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, + 97,116,105,111,110,32,111,102,32,83,111,117,114,99,101,76, + 111,97,100,101,114,32,117,115,105,110,103,32,116,104,101,32, + 102,105,108,101,32,115,121,115,116,101,109,46,99,2,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0, + 0,67,0,0,0,115,22,0,0,0,116,0,124,1,131,1, + 125,2,124,2,106,1,124,2,106,2,100,1,156,2,83,0, + 41,2,122,33,82,101,116,117,114,110,32,116,104,101,32,109, + 101,116,97,100,97,116,97,32,102,111,114,32,116,104,101,32, + 112,97,116,104,46,41,2,114,193,0,0,0,114,1,1,0, + 0,41,3,114,75,0,0,0,218,8,115,116,95,109,116,105, + 109,101,90,7,115,116,95,115,105,122,101,41,3,114,142,0, + 0,0,114,65,0,0,0,114,5,1,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,247,0,0,0, + 53,4,0,0,115,4,0,0,0,0,2,8,1,122,27,83, + 111,117,114,99,101,70,105,108,101,76,111,97,100,101,114,46, + 112,97,116,104,95,115,116,97,116,115,99,4,0,0,0,0, + 0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,67, + 0,0,0,115,24,0,0,0,116,0,124,1,131,1,125,4, + 124,0,106,1,124,2,124,3,124,4,100,1,141,3,83,0, + 41,2,78,169,1,218,5,95,109,111,100,101,41,2,114,138, + 0,0,0,114,248,0,0,0,41,5,114,142,0,0,0,114, + 133,0,0,0,114,131,0,0,0,114,43,0,0,0,114,78, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,249,0,0,0,58,4,0,0,115,4,0,0,0, + 0,2,8,1,122,32,83,111,117,114,99,101,70,105,108,101, + 76,111,97,100,101,114,46,95,99,97,99,104,101,95,98,121, + 116,101,99,111,100,101,114,86,0,0,0,114,34,1,0,0, + 99,3,0,0,0,0,0,0,0,1,0,0,0,9,0,0, + 0,11,0,0,0,67,0,0,0,115,252,0,0,0,116,0, + 124,1,131,1,92,2,125,4,125,5,103,0,125,6,124,4, + 114,52,116,1,124,4,131,1,115,52,116,0,124,4,131,1, + 92,2,125,4,125,7,124,6,160,2,124,7,161,1,1,0, + 113,16,116,3,124,6,131,1,68,0,93,104,125,7,116,4, + 124,4,124,7,131,2,125,4,122,14,116,5,160,6,124,4, + 161,1,1,0,87,0,113,60,4,0,116,7,121,110,1,0, + 1,0,1,0,89,0,113,60,89,0,113,60,4,0,116,8, + 121,162,1,0,125,8,1,0,122,30,116,9,160,10,100,1, + 124,4,124,8,161,3,1,0,87,0,89,0,100,2,125,8, + 126,8,1,0,100,2,83,0,100,2,125,8,126,8,48,0, + 48,0,113,60,122,28,116,11,124,1,124,2,124,3,131,3, + 1,0,116,9,160,10,100,3,124,1,161,2,1,0,87,0, + 110,52,4,0,116,8,144,0,121,246,1,0,125,8,1,0, + 122,26,116,9,160,10,100,1,124,1,124,8,161,3,1,0, + 87,0,89,0,100,2,125,8,126,8,110,10,100,2,125,8, + 126,8,48,0,48,0,100,2,83,0,41,4,122,27,87,114, + 105,116,101,32,98,121,116,101,115,32,100,97,116,97,32,116, + 111,32,97,32,102,105,108,101,46,122,27,99,111,117,108,100, + 32,110,111,116,32,99,114,101,97,116,101,32,123,33,114,125, + 58,32,123,33,114,125,78,122,12,99,114,101,97,116,101,100, + 32,123,33,114,125,41,12,114,74,0,0,0,114,82,0,0, + 0,114,61,0,0,0,218,8,114,101,118,101,114,115,101,100, + 114,67,0,0,0,114,24,0,0,0,90,5,109,107,100,105, + 114,218,15,70,105,108,101,69,120,105,115,116,115,69,114,114, + 111,114,114,76,0,0,0,114,158,0,0,0,114,173,0,0, + 0,114,94,0,0,0,41,9,114,142,0,0,0,114,65,0, + 0,0,114,43,0,0,0,114,35,1,0,0,218,6,112,97, + 114,101,110,116,114,119,0,0,0,114,63,0,0,0,114,68, + 0,0,0,114,251,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,248,0,0,0,63,4,0,0, + 115,46,0,0,0,0,2,12,1,4,2,12,1,12,1,12, + 2,12,1,10,1,2,1,14,1,12,2,8,1,14,3,6, + 1,4,255,4,2,28,1,2,1,12,1,16,1,16,2,8, + 1,2,255,122,25,83,111,117,114,99,101,70,105,108,101,76, + 111,97,100,101,114,46,115,101,116,95,100,97,116,97,78,41, + 7,114,149,0,0,0,114,148,0,0,0,114,150,0,0,0, + 114,151,0,0,0,114,247,0,0,0,114,249,0,0,0,114, + 248,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,32,1,0,0,49,4,0, + 0,115,8,0,0,0,8,2,4,2,8,5,8,5,114,32, + 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,64,0,0,0,115,32,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,83, + 0,41,7,218,20,83,111,117,114,99,101,108,101,115,115,70, + 105,108,101,76,111,97,100,101,114,122,45,76,111,97,100,101, + 114,32,119,104,105,99,104,32,104,97,110,100,108,101,115,32, + 115,111,117,114,99,101,108,101,115,115,32,102,105,108,101,32, + 105,109,112,111,114,116,115,46,99,2,0,0,0,0,0,0, + 0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, + 0,115,68,0,0,0,124,0,160,0,124,1,161,1,125,2, + 124,0,160,1,124,2,161,1,125,3,124,1,124,2,100,1, + 156,2,125,4,116,2,124,3,124,1,124,4,131,3,1,0, + 116,3,116,4,124,3,131,1,100,2,100,0,133,2,25,0, + 124,1,124,2,100,3,141,3,83,0,41,4,78,114,183,0, + 0,0,114,169,0,0,0,41,2,114,140,0,0,0,114,131, + 0,0,0,41,5,114,203,0,0,0,114,250,0,0,0,114, + 176,0,0,0,114,189,0,0,0,114,2,1,0,0,41,5, + 114,142,0,0,0,114,163,0,0,0,114,65,0,0,0,114, + 43,0,0,0,114,175,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,236,0,0,0,98,4,0, + 0,115,22,0,0,0,0,1,10,1,10,4,2,1,2,254, + 6,4,12,1,2,1,14,1,2,1,2,253,122,29,83,111, + 117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100, + 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, + 39,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, + 116,104,101,114,101,32,105,115,32,110,111,32,115,111,117,114, + 99,101,32,99,111,100,101,46,78,114,10,0,0,0,114,242, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,252,0,0,0,114,4,0,0,115,2,0,0,0, + 0,2,122,31,83,111,117,114,99,101,108,101,115,115,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, + 114,99,101,78,41,6,114,149,0,0,0,114,148,0,0,0, + 114,150,0,0,0,114,151,0,0,0,114,236,0,0,0,114, + 252,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,39,1,0,0,94,4,0, + 0,115,6,0,0,0,8,2,4,2,8,16,114,39,1,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,64,0,0,0,115,92,0,0,0,101, + 0,90,1,100,0,90,2,100,1,90,3,100,2,100,3,132, + 0,90,4,100,4,100,5,132,0,90,5,100,6,100,7,132, + 0,90,6,100,8,100,9,132,0,90,7,100,10,100,11,132, + 0,90,8,100,12,100,13,132,0,90,9,100,14,100,15,132, + 0,90,10,100,16,100,17,132,0,90,11,101,12,100,18,100, + 19,132,0,131,1,90,13,100,20,83,0,41,21,114,19,1, + 0,0,122,93,76,111,97,100,101,114,32,102,111,114,32,101, + 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,115, + 46,10,10,32,32,32,32,84,104,101,32,99,111,110,115,116, + 114,117,99,116,111,114,32,105,115,32,100,101,115,105,103,110, + 101,100,32,116,111,32,119,111,114,107,32,119,105,116,104,32, + 70,105,108,101,70,105,110,100,101,114,46,10,10,32,32,32, + 32,99,3,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,8,0,0,0,67,0,0,0,115,62,0,0,0,124, + 1,124,0,95,0,116,1,124,2,131,1,115,52,122,18,116, + 2,116,3,160,4,161,0,124,2,131,2,125,2,87,0,110, + 18,4,0,116,5,121,50,1,0,1,0,1,0,89,0,110, + 2,48,0,124,2,124,0,95,6,100,0,83,0,114,69,0, + 0,0,41,7,114,140,0,0,0,114,85,0,0,0,114,67, + 0,0,0,114,24,0,0,0,114,81,0,0,0,114,76,0, + 0,0,114,65,0,0,0,114,28,1,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,232,0,0,0, + 131,4,0,0,115,14,0,0,0,0,1,6,1,8,1,2, + 1,18,1,12,1,6,1,122,28,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, + 110,105,116,95,95,99,2,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,24, + 0,0,0,124,0,106,0,124,1,106,0,107,2,111,22,124, + 0,106,1,124,1,106,1,107,2,83,0,114,69,0,0,0, + 114,7,1,0,0,114,9,1,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,10,1,0,0,140,4, + 0,0,115,6,0,0,0,0,1,12,1,10,255,122,26,69, + 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, + 101,114,46,95,95,101,113,95,95,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, + 0,0,115,20,0,0,0,116,0,124,0,106,1,131,1,116, + 0,124,0,106,2,131,1,65,0,83,0,114,69,0,0,0, + 114,11,1,0,0,114,13,1,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,14,1,0,0,144,4, + 0,0,115,2,0,0,0,0,1,122,28,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,95, + 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,5,0,0,0,67,0,0,0, + 115,36,0,0,0,116,0,160,1,116,2,106,3,124,1,161, + 2,125,2,116,0,160,4,100,1,124,1,106,5,124,0,106, + 6,161,3,1,0,124,2,83,0,41,2,122,38,67,114,101, + 97,116,101,32,97,110,32,117,110,105,116,105,97,108,105,122, + 101,100,32,101,120,116,101,110,115,105,111,110,32,109,111,100, + 117,108,101,122,38,101,120,116,101,110,115,105,111,110,32,109, + 111,100,117,108,101,32,123,33,114,125,32,108,111,97,100,101, + 100,32,102,114,111,109,32,123,33,114,125,41,7,114,158,0, + 0,0,114,237,0,0,0,114,187,0,0,0,90,14,99,114, + 101,97,116,101,95,100,121,110,97,109,105,99,114,173,0,0, + 0,114,140,0,0,0,114,65,0,0,0,41,3,114,142,0, + 0,0,114,210,0,0,0,114,239,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,235,0,0,0, + 147,4,0,0,115,14,0,0,0,0,2,4,1,6,255,4, + 2,6,1,8,255,4,2,122,33,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,99,114,101, + 97,116,101,95,109,111,100,117,108,101,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,5,0,0,0,67, + 0,0,0,115,36,0,0,0,116,0,160,1,116,2,106,3, + 124,1,161,2,1,0,116,0,160,4,100,1,124,0,106,5, + 124,0,106,6,161,3,1,0,100,2,83,0,41,3,122,30, + 73,110,105,116,105,97,108,105,122,101,32,97,110,32,101,120, + 116,101,110,115,105,111,110,32,109,111,100,117,108,101,122,40, + 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, + 32,123,33,114,125,32,101,120,101,99,117,116,101,100,32,102, + 114,111,109,32,123,33,114,125,78,41,7,114,158,0,0,0, + 114,237,0,0,0,114,187,0,0,0,90,12,101,120,101,99, + 95,100,121,110,97,109,105,99,114,173,0,0,0,114,140,0, + 0,0,114,65,0,0,0,114,20,1,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,240,0,0,0, + 155,4,0,0,115,8,0,0,0,0,2,14,1,6,1,8, + 255,122,31,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, + 108,101,99,2,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,3,0,0,0,115,36,0,0,0, + 116,0,124,0,106,1,131,1,100,1,25,0,137,0,116,2, + 135,0,102,1,100,2,100,3,132,8,116,3,68,0,131,1, + 131,1,83,0,41,4,122,49,82,101,116,117,114,110,32,84, + 114,117,101,32,105,102,32,116,104,101,32,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,32,105,115,32,97, + 32,112,97,99,107,97,103,101,46,114,4,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,51,0,0,0,115,26,0,0,0,124,0,93,18, + 125,1,136,0,100,0,124,1,23,0,107,2,86,0,1,0, + 113,2,100,1,83,0,41,2,114,232,0,0,0,78,114,10, + 0,0,0,169,2,114,8,0,0,0,218,6,115,117,102,102, + 105,120,169,1,90,9,102,105,108,101,95,110,97,109,101,114, + 10,0,0,0,114,11,0,0,0,114,12,0,0,0,164,4, + 0,0,115,4,0,0,0,4,1,2,255,122,49,69,120,116, + 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, + 46,105,115,95,112,97,99,107,97,103,101,46,60,108,111,99, + 97,108,115,62,46,60,103,101,110,101,120,112,114,62,41,4, + 114,74,0,0,0,114,65,0,0,0,218,3,97,110,121,218, + 18,69,88,84,69,78,83,73,79,78,95,83,85,70,70,73, + 88,69,83,114,242,0,0,0,114,10,0,0,0,114,42,1, + 0,0,114,11,0,0,0,114,206,0,0,0,161,4,0,0, + 115,8,0,0,0,0,2,14,1,12,1,2,255,122,30,69, + 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, + 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, + 2,122,63,82,101,116,117,114,110,32,78,111,110,101,32,97, + 115,32,97,110,32,101,120,116,101,110,115,105,111,110,32,109, + 111,100,117,108,101,32,99,97,110,110,111,116,32,99,114,101, + 97,116,101,32,97,32,99,111,100,101,32,111,98,106,101,99, + 116,46,78,114,10,0,0,0,114,242,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,236,0,0, + 0,167,4,0,0,115,2,0,0,0,0,2,122,28,69,120, + 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, + 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,115,4,0,0,0,100,1,83,0,41,2,122,53, + 82,101,116,117,114,110,32,78,111,110,101,32,97,115,32,101, + 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,115, + 32,104,97,118,101,32,110,111,32,115,111,117,114,99,101,32, + 99,111,100,101,46,78,114,10,0,0,0,114,242,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 252,0,0,0,171,4,0,0,115,2,0,0,0,0,2,122, + 30,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,99, + 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, + 0,83,0,114,17,1,0,0,114,71,0,0,0,114,242,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,203,0,0,0,175,4,0,0,115,2,0,0,0,0, + 3,122,32,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, + 97,109,101,78,41,14,114,149,0,0,0,114,148,0,0,0, + 114,150,0,0,0,114,151,0,0,0,114,232,0,0,0,114, + 10,1,0,0,114,14,1,0,0,114,235,0,0,0,114,240, + 0,0,0,114,206,0,0,0,114,236,0,0,0,114,252,0, + 0,0,114,160,0,0,0,114,203,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,19,1,0,0,123,4,0,0,115,22,0,0,0,8,2, + 4,6,8,9,8,4,8,3,8,8,8,6,8,6,8,4, + 8,4,2,1,114,19,1,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, + 0,0,115,104,0,0,0,101,0,90,1,100,0,90,2,100, + 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, + 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, + 0,90,7,100,10,100,11,132,0,90,8,100,12,100,13,132, + 0,90,9,100,14,100,15,132,0,90,10,100,16,100,17,132, + 0,90,11,100,18,100,19,132,0,90,12,100,20,100,21,132, + 0,90,13,100,22,100,23,132,0,90,14,100,24,83,0,41, + 25,218,14,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,97,38,1,0,0,82,101,112,114,101,115,101,110,116,115, + 32,97,32,110,97,109,101,115,112,97,99,101,32,112,97,99, + 107,97,103,101,39,115,32,112,97,116,104,46,32,32,73,116, + 32,117,115,101,115,32,116,104,101,32,109,111,100,117,108,101, + 32,110,97,109,101,10,32,32,32,32,116,111,32,102,105,110, + 100,32,105,116,115,32,112,97,114,101,110,116,32,109,111,100, + 117,108,101,44,32,97,110,100,32,102,114,111,109,32,116,104, + 101,114,101,32,105,116,32,108,111,111,107,115,32,117,112,32, + 116,104,101,32,112,97,114,101,110,116,39,115,10,32,32,32, + 32,95,95,112,97,116,104,95,95,46,32,32,87,104,101,110, + 32,116,104,105,115,32,99,104,97,110,103,101,115,44,32,116, + 104,101,32,109,111,100,117,108,101,39,115,32,111,119,110,32, + 112,97,116,104,32,105,115,32,114,101,99,111,109,112,117,116, + 101,100,44,10,32,32,32,32,117,115,105,110,103,32,112,97, + 116,104,95,102,105,110,100,101,114,46,32,32,70,111,114,32, + 116,111,112,45,108,101,118,101,108,32,109,111,100,117,108,101, + 115,44,32,116,104,101,32,112,97,114,101,110,116,32,109,111, + 100,117,108,101,39,115,32,112,97,116,104,10,32,32,32,32, + 105,115,32,115,121,115,46,112,97,116,104,46,99,4,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,3,0,0, + 0,67,0,0,0,115,36,0,0,0,124,1,124,0,95,0, + 124,2,124,0,95,1,116,2,124,0,160,3,161,0,131,1, + 124,0,95,4,124,3,124,0,95,5,100,0,83,0,114,69, + 0,0,0,41,6,218,5,95,110,97,109,101,218,5,95,112, + 97,116,104,114,135,0,0,0,218,16,95,103,101,116,95,112, + 97,114,101,110,116,95,112,97,116,104,218,17,95,108,97,115, + 116,95,112,97,114,101,110,116,95,112,97,116,104,218,12,95, + 112,97,116,104,95,102,105,110,100,101,114,169,4,114,142,0, + 0,0,114,140,0,0,0,114,65,0,0,0,90,11,112,97, + 116,104,95,102,105,110,100,101,114,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,232,0,0,0,188,4,0, + 0,115,8,0,0,0,0,1,6,1,6,1,14,1,122,23, + 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, + 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, + 0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0, + 115,38,0,0,0,124,0,106,0,160,1,100,1,161,1,92, + 3,125,1,125,2,125,3,124,2,100,2,107,2,114,30,100, + 3,83,0,124,1,100,4,102,2,83,0,41,5,122,62,82, + 101,116,117,114,110,115,32,97,32,116,117,112,108,101,32,111, + 102,32,40,112,97,114,101,110,116,45,109,111,100,117,108,101, + 45,110,97,109,101,44,32,112,97,114,101,110,116,45,112,97, + 116,104,45,97,116,116,114,45,110,97,109,101,41,114,96,0, + 0,0,114,14,0,0,0,41,2,114,21,0,0,0,114,65, + 0,0,0,90,8,95,95,112,97,116,104,95,95,41,2,114, + 46,1,0,0,114,103,0,0,0,41,4,114,142,0,0,0, + 114,38,1,0,0,218,3,100,111,116,90,2,109,101,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,23,95, + 102,105,110,100,95,112,97,114,101,110,116,95,112,97,116,104, + 95,110,97,109,101,115,194,4,0,0,115,8,0,0,0,0, + 2,18,1,8,2,4,3,122,38,95,78,97,109,101,115,112, + 97,99,101,80,97,116,104,46,95,102,105,110,100,95,112,97, + 114,101,110,116,95,112,97,116,104,95,110,97,109,101,115,99, + 1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, + 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, + 1,25,0,124,2,131,2,83,0,114,69,0,0,0,41,4, + 114,53,1,0,0,114,154,0,0,0,114,21,0,0,0,218, + 7,109,111,100,117,108,101,115,41,3,114,142,0,0,0,90, + 18,112,97,114,101,110,116,95,109,111,100,117,108,101,95,110, + 97,109,101,90,14,112,97,116,104,95,97,116,116,114,95,110, + 97,109,101,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,48,1,0,0,204,4,0,0,115,4,0,0,0, + 0,1,12,1,122,31,95,78,97,109,101,115,112,97,99,101, + 80,97,116,104,46,95,103,101,116,95,112,97,114,101,110,116, + 95,112,97,116,104,99,1,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,80, + 0,0,0,116,0,124,0,160,1,161,0,131,1,125,1,124, + 1,124,0,106,2,107,3,114,74,124,0,160,3,124,0,106, + 4,124,1,161,2,125,2,124,2,100,0,117,1,114,68,124, + 2,106,5,100,0,117,0,114,68,124,2,106,6,114,68,124, + 2,106,6,124,0,95,7,124,1,124,0,95,2,124,0,106, + 7,83,0,114,69,0,0,0,41,8,114,135,0,0,0,114, + 48,1,0,0,114,49,1,0,0,114,50,1,0,0,114,46, + 1,0,0,114,164,0,0,0,114,202,0,0,0,114,47,1, + 0,0,41,3,114,142,0,0,0,90,11,112,97,114,101,110, + 116,95,112,97,116,104,114,210,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,12,95,114,101,99, + 97,108,99,117,108,97,116,101,208,4,0,0,115,16,0,0, + 0,0,2,12,1,10,1,14,3,18,1,6,1,8,1,6, + 1,122,27,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,46,95,114,101,99,97,108,99,117,108,97,116,101,99,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,0, + 160,1,161,0,131,1,83,0,114,69,0,0,0,41,2,114, + 29,1,0,0,114,55,1,0,0,114,13,1,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, + 95,105,116,101,114,95,95,221,4,0,0,115,2,0,0,0, + 0,1,122,23,95,78,97,109,101,115,112,97,99,101,80,97, + 116,104,46,95,95,105,116,101,114,95,95,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, + 67,0,0,0,115,12,0,0,0,124,0,160,0,161,0,124, + 1,25,0,83,0,114,69,0,0,0,169,1,114,55,1,0, + 0,41,2,114,142,0,0,0,218,5,105,110,100,101,120,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,11, + 95,95,103,101,116,105,116,101,109,95,95,224,4,0,0,115, + 2,0,0,0,0,1,122,26,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,95,103,101,116,105,116,101,109, + 95,95,99,3,0,0,0,0,0,0,0,0,0,0,0,3, + 0,0,0,3,0,0,0,67,0,0,0,115,14,0,0,0, + 124,2,124,0,106,0,124,1,60,0,100,0,83,0,114,69, + 0,0,0,41,1,114,47,1,0,0,41,3,114,142,0,0, + 0,114,58,1,0,0,114,65,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,11,95,95,115,101, + 116,105,116,101,109,95,95,227,4,0,0,115,2,0,0,0, + 0,1,122,26,95,78,97,109,101,115,112,97,99,101,80,97, + 116,104,46,95,95,115,101,116,105,116,101,109,95,95,99,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,0, + 160,1,161,0,131,1,83,0,114,69,0,0,0,41,2,114, + 6,0,0,0,114,55,1,0,0,114,13,1,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,7,95, + 95,108,101,110,95,95,230,4,0,0,115,2,0,0,0,0, + 1,122,22,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,46,95,95,108,101,110,95,95,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, + 0,0,115,12,0,0,0,100,1,160,0,124,0,106,1,161, + 1,83,0,41,2,78,122,20,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,40,123,33,114,125,41,41,2,114,88, + 0,0,0,114,47,1,0,0,114,13,1,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,8,95,95, + 114,101,112,114,95,95,233,4,0,0,115,2,0,0,0,0, + 1,122,23,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, + 0,0,0,115,12,0,0,0,124,1,124,0,160,0,161,0, + 118,0,83,0,114,69,0,0,0,114,57,1,0,0,169,2, + 114,142,0,0,0,218,4,105,116,101,109,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,12,95,95,99,111, + 110,116,97,105,110,115,95,95,236,4,0,0,115,2,0,0, + 0,0,1,122,27,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,95,95,99,111,110,116,97,105,110,115,95,95, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,67,0,0,0,115,16,0,0,0,124,0, + 106,0,160,1,124,1,161,1,1,0,100,0,83,0,114,69, + 0,0,0,41,2,114,47,1,0,0,114,61,0,0,0,114, + 63,1,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,61,0,0,0,239,4,0,0,115,2,0,0, + 0,0,1,122,21,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,97,112,112,101,110,100,78,41,15,114,149,0, + 0,0,114,148,0,0,0,114,150,0,0,0,114,151,0,0, + 0,114,232,0,0,0,114,53,1,0,0,114,48,1,0,0, + 114,55,1,0,0,114,56,1,0,0,114,59,1,0,0,114, + 60,1,0,0,114,61,1,0,0,114,62,1,0,0,114,65, + 1,0,0,114,61,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,45,1,0, + 0,181,4,0,0,115,24,0,0,0,8,1,4,6,8,6, + 8,10,8,4,8,13,8,3,8,3,8,3,8,3,8,3, + 8,3,114,45,1,0,0,99,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,0, + 115,80,0,0,0,101,0,90,1,100,0,90,2,100,1,100, + 2,132,0,90,3,101,4,100,3,100,4,132,0,131,1,90, + 5,100,5,100,6,132,0,90,6,100,7,100,8,132,0,90, + 7,100,9,100,10,132,0,90,8,100,11,100,12,132,0,90, + 9,100,13,100,14,132,0,90,10,100,15,100,16,132,0,90, + 11,100,17,83,0,41,18,218,16,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,99,4,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0, + 0,0,115,18,0,0,0,116,0,124,1,124,2,124,3,131, + 3,124,0,95,1,100,0,83,0,114,69,0,0,0,41,2, + 114,45,1,0,0,114,47,1,0,0,114,51,1,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,232, + 0,0,0,245,4,0,0,115,2,0,0,0,0,1,122,25, + 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, + 46,95,95,105,110,105,116,95,95,99,2,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,12,0,0,0,100,1,160,0,124,1,106,1,161, + 1,83,0,41,2,122,115,82,101,116,117,114,110,32,114,101, + 112,114,32,102,111,114,32,116,104,101,32,109,111,100,117,108, + 101,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, + 97,116,101,100,46,32,32,84,104,101,32,105,109,112,111,114, + 116,32,109,97,99,104,105,110,101,114,121,32,100,111,101,115, + 32,116,104,101,32,106,111,98,32,105,116,115,101,108,102,46, + 10,10,32,32,32,32,32,32,32,32,122,25,60,109,111,100, + 117,108,101,32,123,33,114,125,32,40,110,97,109,101,115,112, + 97,99,101,41,62,41,2,114,88,0,0,0,114,149,0,0, + 0,41,2,114,216,0,0,0,114,239,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,11,109,111, + 100,117,108,101,95,114,101,112,114,248,4,0,0,115,2,0, + 0,0,0,7,122,28,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,109,111,100,117,108,101,95,114,101, + 112,114,99,2,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, + 100,1,83,0,41,2,78,84,114,10,0,0,0,114,242,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,206,0,0,0,1,5,0,0,115,2,0,0,0,0, + 1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, + 100,101,114,46,105,115,95,112,97,99,107,97,103,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, + 41,2,78,114,14,0,0,0,114,10,0,0,0,114,242,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,252,0,0,0,4,5,0,0,115,2,0,0,0,0, + 1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, + 100,101,114,46,103,101,116,95,115,111,117,114,99,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,6, + 0,0,0,67,0,0,0,115,16,0,0,0,116,0,100,1, + 100,2,100,3,100,4,100,5,141,4,83,0,41,6,78,114, + 14,0,0,0,122,8,60,115,116,114,105,110,103,62,114,238, + 0,0,0,84,41,1,114,254,0,0,0,41,1,114,255,0, + 0,0,114,242,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,236,0,0,0,7,5,0,0,115, + 2,0,0,0,0,1,122,25,95,78,97,109,101,115,112,97, + 99,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, + 1,83,0,114,233,0,0,0,114,10,0,0,0,114,234,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,235,0,0,0,10,5,0,0,115,2,0,0,0,0, + 1,122,30,95,78,97,109,101,115,112,97,99,101,76,111,97, + 100,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, + 0,83,0,114,69,0,0,0,114,10,0,0,0,114,20,1, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,240,0,0,0,13,5,0,0,115,2,0,0,0,0, + 1,122,28,95,78,97,109,101,115,112,97,99,101,76,111,97, + 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,99, + 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 4,0,0,0,67,0,0,0,115,26,0,0,0,116,0,160, + 1,100,1,124,0,106,2,161,2,1,0,116,0,160,3,124, + 0,124,1,161,2,83,0,41,2,122,98,76,111,97,100,32, + 97,32,110,97,109,101,115,112,97,99,101,32,109,111,100,117, + 108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105, + 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, + 101,99,97,116,101,100,46,32,32,85,115,101,32,101,120,101, + 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, + 97,100,46,10,10,32,32,32,32,32,32,32,32,122,38,110, + 97,109,101,115,112,97,99,101,32,109,111,100,117,108,101,32, + 108,111,97,100,101,100,32,119,105,116,104,32,112,97,116,104, + 32,123,33,114,125,41,4,114,158,0,0,0,114,173,0,0, + 0,114,47,1,0,0,114,241,0,0,0,114,242,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 243,0,0,0,16,5,0,0,115,8,0,0,0,0,7,6, + 1,4,255,4,2,122,28,95,78,97,109,101,115,112,97,99, + 101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100, + 117,108,101,78,41,12,114,149,0,0,0,114,148,0,0,0, + 114,150,0,0,0,114,232,0,0,0,114,230,0,0,0,114, + 67,1,0,0,114,206,0,0,0,114,252,0,0,0,114,236, + 0,0,0,114,235,0,0,0,114,240,0,0,0,114,243,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,66,1,0,0,244,4,0,0,115, + 18,0,0,0,8,1,8,3,2,1,10,8,8,3,8,3, + 8,3,8,3,8,3,114,66,1,0,0,99,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 64,0,0,0,115,118,0,0,0,101,0,90,1,100,0,90, + 2,100,1,90,3,101,4,100,2,100,3,132,0,131,1,90, + 5,101,4,100,4,100,5,132,0,131,1,90,6,101,4,100, + 6,100,7,132,0,131,1,90,7,101,4,100,8,100,9,132, + 0,131,1,90,8,101,4,100,19,100,11,100,12,132,1,131, + 1,90,9,101,4,100,20,100,13,100,14,132,1,131,1,90, + 10,101,4,100,21,100,15,100,16,132,1,131,1,90,11,101, + 4,100,17,100,18,132,0,131,1,90,12,100,10,83,0,41, + 22,218,10,80,97,116,104,70,105,110,100,101,114,122,62,77, + 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, + 102,111,114,32,115,121,115,46,112,97,116,104,32,97,110,100, + 32,112,97,99,107,97,103,101,32,95,95,112,97,116,104,95, + 95,32,97,116,116,114,105,98,117,116,101,115,46,99,1,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0, + 0,0,67,0,0,0,115,64,0,0,0,116,0,116,1,106, + 2,160,3,161,0,131,1,68,0,93,44,92,2,125,1,125, + 2,124,2,100,1,117,0,114,40,116,1,106,2,124,1,61, + 0,113,14,116,4,124,2,100,2,131,2,114,14,124,2,160, + 5,161,0,1,0,113,14,100,1,83,0,41,3,122,125,67, + 97,108,108,32,116,104,101,32,105,110,118,97,108,105,100,97, + 116,101,95,99,97,99,104,101,115,40,41,32,109,101,116,104, + 111,100,32,111,110,32,97,108,108,32,112,97,116,104,32,101, + 110,116,114,121,32,102,105,110,100,101,114,115,10,32,32,32, + 32,32,32,32,32,115,116,111,114,101,100,32,105,110,32,115, + 121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,114, + 95,99,97,99,104,101,115,32,40,119,104,101,114,101,32,105, + 109,112,108,101,109,101,110,116,101,100,41,46,78,218,17,105, + 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, + 41,6,218,4,108,105,115,116,114,21,0,0,0,218,19,112, + 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, + 104,101,218,5,105,116,101,109,115,114,152,0,0,0,114,69, + 1,0,0,41,3,114,216,0,0,0,114,140,0,0,0,218, + 6,102,105,110,100,101,114,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,69,1,0,0,34,5,0,0,115, + 10,0,0,0,0,4,22,1,8,1,10,1,10,1,122,28, + 80,97,116,104,70,105,110,100,101,114,46,105,110,118,97,108, + 105,100,97,116,101,95,99,97,99,104,101,115,99,2,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,9,0,0, + 0,67,0,0,0,115,82,0,0,0,116,0,106,1,100,1, + 117,1,114,28,116,0,106,1,115,28,116,2,160,3,100,2, + 116,4,161,2,1,0,116,0,106,1,68,0,93,42,125,2, + 122,14,124,2,124,1,131,1,87,0,2,0,1,0,83,0, + 4,0,116,5,121,74,1,0,1,0,1,0,89,0,113,34, + 89,0,113,34,48,0,113,34,100,1,83,0,41,3,122,46, + 83,101,97,114,99,104,32,115,121,115,46,112,97,116,104,95, + 104,111,111,107,115,32,102,111,114,32,97,32,102,105,110,100, + 101,114,32,102,111,114,32,39,112,97,116,104,39,46,78,122, + 23,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, + 105,115,32,101,109,112,116,121,41,6,114,21,0,0,0,218, + 10,112,97,116,104,95,104,111,111,107,115,114,98,0,0,0, + 114,99,0,0,0,114,162,0,0,0,114,141,0,0,0,41, + 3,114,216,0,0,0,114,65,0,0,0,90,4,104,111,111, + 107,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,11,95,112,97,116,104,95,104,111,111,107,115,44,5,0, + 0,115,16,0,0,0,0,3,16,1,12,1,10,1,2,1, + 14,1,12,1,12,2,122,22,80,97,116,104,70,105,110,100, + 101,114,46,95,112,97,116,104,95,104,111,111,107,115,99,2, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8, + 0,0,0,67,0,0,0,115,100,0,0,0,124,1,100,1, + 107,2,114,42,122,12,116,0,160,1,161,0,125,1,87,0, + 110,20,4,0,116,2,121,40,1,0,1,0,1,0,89,0, + 100,2,83,0,48,0,122,14,116,3,106,4,124,1,25,0, + 125,2,87,0,110,38,4,0,116,5,121,94,1,0,1,0, + 1,0,124,0,160,6,124,1,161,1,125,2,124,2,116,3, + 106,4,124,1,60,0,89,0,110,2,48,0,124,2,83,0, + 41,3,122,210,71,101,116,32,116,104,101,32,102,105,110,100, + 101,114,32,102,111,114,32,116,104,101,32,112,97,116,104,32, + 101,110,116,114,121,32,102,114,111,109,32,115,121,115,46,112, + 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, + 104,101,46,10,10,32,32,32,32,32,32,32,32,73,102,32, + 116,104,101,32,112,97,116,104,32,101,110,116,114,121,32,105, + 115,32,110,111,116,32,105,110,32,116,104,101,32,99,97,99, + 104,101,44,32,102,105,110,100,32,116,104,101,32,97,112,112, + 114,111,112,114,105,97,116,101,32,102,105,110,100,101,114,10, + 32,32,32,32,32,32,32,32,97,110,100,32,99,97,99,104, + 101,32,105,116,46,32,73,102,32,110,111,32,102,105,110,100, + 101,114,32,105,115,32,97,118,97,105,108,97,98,108,101,44, + 32,115,116,111,114,101,32,78,111,110,101,46,10,10,32,32, + 32,32,32,32,32,32,114,14,0,0,0,78,41,7,114,24, + 0,0,0,114,81,0,0,0,114,26,1,0,0,114,21,0, + 0,0,114,71,1,0,0,218,8,75,101,121,69,114,114,111, + 114,114,75,1,0,0,41,3,114,216,0,0,0,114,65,0, + 0,0,114,73,1,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,20,95,112,97,116,104,95,105,109, + 112,111,114,116,101,114,95,99,97,99,104,101,57,5,0,0, + 115,22,0,0,0,0,8,8,1,2,1,12,1,12,3,8, + 1,2,1,14,1,12,1,10,1,16,1,122,31,80,97,116, + 104,70,105,110,100,101,114,46,95,112,97,116,104,95,105,109, + 112,111,114,116,101,114,95,99,97,99,104,101,99,3,0,0, + 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, + 0,67,0,0,0,115,82,0,0,0,116,0,124,2,100,1, + 131,2,114,26,124,2,160,1,124,1,161,1,92,2,125,3, + 125,4,110,14,124,2,160,2,124,1,161,1,125,3,103,0, + 125,4,124,3,100,0,117,1,114,60,116,3,160,4,124,1, + 124,3,161,2,83,0,116,3,160,5,124,1,100,0,161,2, + 125,5,124,4,124,5,95,6,124,5,83,0,41,2,78,114, + 161,0,0,0,41,7,114,152,0,0,0,114,161,0,0,0, + 114,229,0,0,0,114,158,0,0,0,114,224,0,0,0,114, + 207,0,0,0,114,202,0,0,0,41,6,114,216,0,0,0, + 114,163,0,0,0,114,73,1,0,0,114,164,0,0,0,114, + 165,0,0,0,114,210,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,16,95,108,101,103,97,99, + 121,95,103,101,116,95,115,112,101,99,79,5,0,0,115,18, + 0,0,0,0,4,10,1,16,2,10,1,4,1,8,1,12, + 1,12,1,6,1,122,27,80,97,116,104,70,105,110,100,101, + 114,46,95,108,101,103,97,99,121,95,103,101,116,95,115,112, + 101,99,78,99,4,0,0,0,0,0,0,0,0,0,0,0, + 9,0,0,0,5,0,0,0,67,0,0,0,115,166,0,0, + 0,103,0,125,4,124,2,68,0,93,134,125,5,116,0,124, + 5,116,1,116,2,102,2,131,2,115,28,113,8,124,0,160, + 3,124,5,161,1,125,6,124,6,100,1,117,1,114,8,116, + 4,124,6,100,2,131,2,114,70,124,6,160,5,124,1,124, + 3,161,2,125,7,110,12,124,0,160,6,124,1,124,6,161, + 2,125,7,124,7,100,1,117,0,114,92,113,8,124,7,106, + 7,100,1,117,1,114,110,124,7,2,0,1,0,83,0,124, + 7,106,8,125,8,124,8,100,1,117,0,114,132,116,9,100, + 3,131,1,130,1,124,4,160,10,124,8,161,1,1,0,113, + 8,116,11,160,12,124,1,100,1,161,2,125,7,124,4,124, + 7,95,8,124,7,83,0,41,4,122,63,70,105,110,100,32, + 116,104,101,32,108,111,97,100,101,114,32,111,114,32,110,97, + 109,101,115,112,97,99,101,95,112,97,116,104,32,102,111,114, + 32,116,104,105,115,32,109,111,100,117,108,101,47,112,97,99, + 107,97,103,101,32,110,97,109,101,46,78,114,226,0,0,0, + 122,19,115,112,101,99,32,109,105,115,115,105,110,103,32,108, + 111,97,100,101,114,41,13,114,185,0,0,0,114,108,0,0, + 0,218,5,98,121,116,101,115,114,77,1,0,0,114,152,0, + 0,0,114,226,0,0,0,114,78,1,0,0,114,164,0,0, + 0,114,202,0,0,0,114,141,0,0,0,114,191,0,0,0, + 114,158,0,0,0,114,207,0,0,0,41,9,114,216,0,0, + 0,114,163,0,0,0,114,65,0,0,0,114,225,0,0,0, + 218,14,110,97,109,101,115,112,97,99,101,95,112,97,116,104, + 90,5,101,110,116,114,121,114,73,1,0,0,114,210,0,0, + 0,114,165,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,9,95,103,101,116,95,115,112,101,99, + 94,5,0,0,115,40,0,0,0,0,5,4,1,8,1,14, + 1,2,1,10,1,8,1,10,1,14,2,12,1,8,1,2, + 1,10,1,8,1,6,1,8,1,8,5,12,2,12,1,6, + 1,122,20,80,97,116,104,70,105,110,100,101,114,46,95,103, + 101,116,95,115,112,101,99,99,4,0,0,0,0,0,0,0, + 0,0,0,0,6,0,0,0,5,0,0,0,67,0,0,0, + 115,100,0,0,0,124,2,100,1,117,0,114,14,116,0,106, + 1,125,2,124,0,160,2,124,1,124,2,124,3,161,3,125, + 4,124,4,100,1,117,0,114,40,100,1,83,0,124,4,106, + 3,100,1,117,0,114,92,124,4,106,4,125,5,124,5,114, + 86,100,1,124,4,95,5,116,6,124,1,124,5,124,0,106, + 2,131,3,124,4,95,4,124,4,83,0,100,1,83,0,110, + 4,124,4,83,0,100,1,83,0,41,2,122,141,84,114,121, + 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, + 102,111,114,32,39,102,117,108,108,110,97,109,101,39,32,111, + 110,32,115,121,115,46,112,97,116,104,32,111,114,32,39,112, + 97,116,104,39,46,10,10,32,32,32,32,32,32,32,32,84, + 104,101,32,115,101,97,114,99,104,32,105,115,32,98,97,115, + 101,100,32,111,110,32,115,121,115,46,112,97,116,104,95,104, + 111,111,107,115,32,97,110,100,32,115,121,115,46,112,97,116, + 104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,101, + 46,10,32,32,32,32,32,32,32,32,78,41,7,114,21,0, + 0,0,114,65,0,0,0,114,81,1,0,0,114,164,0,0, + 0,114,202,0,0,0,114,205,0,0,0,114,45,1,0,0, + 41,6,114,216,0,0,0,114,163,0,0,0,114,65,0,0, + 0,114,225,0,0,0,114,210,0,0,0,114,80,1,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 226,0,0,0,126,5,0,0,115,26,0,0,0,0,6,8, + 1,6,1,14,1,8,1,4,1,10,1,6,1,4,3,6, + 1,16,1,4,2,6,2,122,20,80,97,116,104,70,105,110, + 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, + 0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0, + 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, + 1,124,2,161,2,125,3,124,3,100,1,117,0,114,24,100, + 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110, + 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, + 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, + 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, + 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, + 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, + 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, + 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, + 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, + 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, + 32,32,32,32,32,32,32,78,114,227,0,0,0,114,228,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,229,0,0,0,150,5,0,0,115,8,0,0,0,0, + 8,12,1,8,1,4,1,122,22,80,97,116,104,70,105,110, + 100,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99, + 1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 4,0,0,0,79,0,0,0,115,28,0,0,0,100,1,100, + 2,108,0,109,1,125,3,1,0,124,3,106,2,124,1,105, + 0,124,2,164,1,142,1,83,0,41,3,97,32,1,0,0, + 10,32,32,32,32,32,32,32,32,70,105,110,100,32,100,105, + 115,116,114,105,98,117,116,105,111,110,115,46,10,10,32,32, + 32,32,32,32,32,32,82,101,116,117,114,110,32,97,110,32, + 105,116,101,114,97,98,108,101,32,111,102,32,97,108,108,32, + 68,105,115,116,114,105,98,117,116,105,111,110,32,105,110,115, + 116,97,110,99,101,115,32,99,97,112,97,98,108,101,32,111, + 102,10,32,32,32,32,32,32,32,32,108,111,97,100,105,110, + 103,32,116,104,101,32,109,101,116,97,100,97,116,97,32,102, + 111,114,32,112,97,99,107,97,103,101,115,32,109,97,116,99, + 104,105,110,103,32,96,96,99,111,110,116,101,120,116,46,110, + 97,109,101,96,96,10,32,32,32,32,32,32,32,32,40,111, + 114,32,97,108,108,32,110,97,109,101,115,32,105,102,32,96, + 96,78,111,110,101,96,96,32,105,110,100,105,99,97,116,101, + 100,41,32,97,108,111,110,103,32,116,104,101,32,112,97,116, + 104,115,32,105,110,32,116,104,101,32,108,105,115,116,10,32, + 32,32,32,32,32,32,32,111,102,32,100,105,114,101,99,116, + 111,114,105,101,115,32,96,96,99,111,110,116,101,120,116,46, + 112,97,116,104,96,96,46,10,32,32,32,32,32,32,32,32, + 114,0,0,0,0,41,1,218,18,77,101,116,97,100,97,116, + 97,80,97,116,104,70,105,110,100,101,114,41,3,90,18,105, + 109,112,111,114,116,108,105,98,46,109,101,116,97,100,97,116, + 97,114,82,1,0,0,218,18,102,105,110,100,95,100,105,115, + 116,114,105,98,117,116,105,111,110,115,41,4,114,216,0,0, + 0,114,143,0,0,0,114,144,0,0,0,114,82,1,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 83,1,0,0,163,5,0,0,115,4,0,0,0,0,10,12, + 1,122,29,80,97,116,104,70,105,110,100,101,114,46,102,105, + 110,100,95,100,105,115,116,114,105,98,117,116,105,111,110,115, + 41,1,78,41,2,78,78,41,1,78,41,13,114,149,0,0, + 0,114,148,0,0,0,114,150,0,0,0,114,151,0,0,0, + 114,230,0,0,0,114,69,1,0,0,114,75,1,0,0,114, + 77,1,0,0,114,78,1,0,0,114,81,1,0,0,114,226, + 0,0,0,114,229,0,0,0,114,83,1,0,0,114,10,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,68,1,0,0,30,5,0,0,115,34,0,0,0,8, + 2,4,2,2,1,10,9,2,1,10,12,2,1,10,21,2, + 1,10,14,2,1,12,31,2,1,12,23,2,1,12,12,2, + 1,114,68,1,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, + 90,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 101,6,90,7,100,6,100,7,132,0,90,8,100,8,100,9, + 132,0,90,9,100,19,100,11,100,12,132,1,90,10,100,13, + 100,14,132,0,90,11,101,12,100,15,100,16,132,0,131,1, + 90,13,100,17,100,18,132,0,90,14,100,10,83,0,41,20, + 218,10,70,105,108,101,70,105,110,100,101,114,122,172,70,105, + 108,101,45,98,97,115,101,100,32,102,105,110,100,101,114,46, + 10,10,32,32,32,32,73,110,116,101,114,97,99,116,105,111, + 110,115,32,119,105,116,104,32,116,104,101,32,102,105,108,101, + 32,115,121,115,116,101,109,32,97,114,101,32,99,97,99,104, + 101,100,32,102,111,114,32,112,101,114,102,111,114,109,97,110, + 99,101,44,32,98,101,105,110,103,10,32,32,32,32,114,101, + 102,114,101,115,104,101,100,32,119,104,101,110,32,116,104,101, + 32,100,105,114,101,99,116,111,114,121,32,116,104,101,32,102, + 105,110,100,101,114,32,105,115,32,104,97,110,100,108,105,110, + 103,32,104,97,115,32,98,101,101,110,32,109,111,100,105,102, + 105,101,100,46,10,10,32,32,32,32,99,2,0,0,0,0, + 0,0,0,0,0,0,0,5,0,0,0,6,0,0,0,7, + 0,0,0,115,112,0,0,0,103,0,125,3,124,2,68,0, + 93,32,92,2,137,0,125,4,124,3,160,0,135,0,102,1, + 100,1,100,2,132,8,124,4,68,0,131,1,161,1,1,0, + 113,8,124,3,124,0,95,1,124,1,112,54,100,3,124,0, + 95,2,116,3,124,0,106,2,131,1,115,86,116,4,116,5, + 160,6,161,0,124,0,106,2,131,2,124,0,95,2,100,4, + 124,0,95,7,116,8,131,0,124,0,95,9,116,8,131,0, + 124,0,95,10,100,5,83,0,41,6,122,154,73,110,105,116, + 105,97,108,105,122,101,32,119,105,116,104,32,116,104,101,32, + 112,97,116,104,32,116,111,32,115,101,97,114,99,104,32,111, + 110,32,97,110,100,32,97,32,118,97,114,105,97,98,108,101, + 32,110,117,109,98,101,114,32,111,102,10,32,32,32,32,32, + 32,32,32,50,45,116,117,112,108,101,115,32,99,111,110,116, + 97,105,110,105,110,103,32,116,104,101,32,108,111,97,100,101, + 114,32,97,110,100,32,116,104,101,32,102,105,108,101,32,115, + 117,102,102,105,120,101,115,32,116,104,101,32,108,111,97,100, + 101,114,10,32,32,32,32,32,32,32,32,114,101,99,111,103, + 110,105,122,101,115,46,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,51,0,0,0,115, + 22,0,0,0,124,0,93,14,125,1,124,1,136,0,102,2, + 86,0,1,0,113,2,100,0,83,0,114,69,0,0,0,114, + 10,0,0,0,114,40,1,0,0,169,1,114,164,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,12,0,0,0,192, + 5,0,0,114,13,0,0,0,122,38,70,105,108,101,70,105, + 110,100,101,114,46,95,95,105,110,105,116,95,95,46,60,108, + 111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,62, + 114,96,0,0,0,114,129,0,0,0,78,41,11,114,191,0, + 0,0,218,8,95,108,111,97,100,101,114,115,114,65,0,0, + 0,114,85,0,0,0,114,67,0,0,0,114,24,0,0,0, + 114,81,0,0,0,218,11,95,112,97,116,104,95,109,116,105, + 109,101,218,3,115,101,116,218,11,95,112,97,116,104,95,99, + 97,99,104,101,218,19,95,114,101,108,97,120,101,100,95,112, + 97,116,104,95,99,97,99,104,101,41,5,114,142,0,0,0, + 114,65,0,0,0,218,14,108,111,97,100,101,114,95,100,101, + 116,97,105,108,115,90,7,108,111,97,100,101,114,115,114,212, + 0,0,0,114,10,0,0,0,114,85,1,0,0,114,11,0, + 0,0,114,232,0,0,0,186,5,0,0,115,20,0,0,0, + 0,4,4,1,12,1,26,1,6,2,10,1,10,1,18,1, + 6,1,8,1,122,19,70,105,108,101,70,105,110,100,101,114, + 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0, + 0,0,115,10,0,0,0,100,1,124,0,95,0,100,2,83, + 0,41,3,122,31,73,110,118,97,108,105,100,97,116,101,32, + 116,104,101,32,100,105,114,101,99,116,111,114,121,32,109,116, + 105,109,101,46,114,129,0,0,0,78,41,1,114,87,1,0, + 0,114,13,1,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,69,1,0,0,202,5,0,0,115,2, + 0,0,0,0,2,122,28,70,105,108,101,70,105,110,100,101, + 114,46,105,110,118,97,108,105,100,97,116,101,95,99,97,99, + 104,101,115,99,2,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,3,0,0,0,67,0,0,0,115,42,0,0, + 0,124,0,160,0,124,1,161,1,125,2,124,2,100,1,117, + 0,114,26,100,1,103,0,102,2,83,0,124,2,106,1,124, + 2,106,2,112,38,103,0,102,2,83,0,41,2,122,197,84, + 114,121,32,116,111,32,102,105,110,100,32,97,32,108,111,97, + 100,101,114,32,102,111,114,32,116,104,101,32,115,112,101,99, + 105,102,105,101,100,32,109,111,100,117,108,101,44,32,111,114, + 32,116,104,101,32,110,97,109,101,115,112,97,99,101,10,32, + 32,32,32,32,32,32,32,112,97,99,107,97,103,101,32,112, + 111,114,116,105,111,110,115,46,32,82,101,116,117,114,110,115, + 32,40,108,111,97,100,101,114,44,32,108,105,115,116,45,111, + 102,45,112,111,114,116,105,111,110,115,41,46,10,10,32,32, + 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, + 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, + 32,32,85,115,101,32,102,105,110,100,95,115,112,101,99,40, + 41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32, + 32,32,32,32,78,41,3,114,226,0,0,0,114,164,0,0, + 0,114,202,0,0,0,41,3,114,142,0,0,0,114,163,0, + 0,0,114,210,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,161,0,0,0,208,5,0,0,115, + 8,0,0,0,0,7,10,1,8,1,8,1,122,22,70,105, + 108,101,70,105,110,100,101,114,46,102,105,110,100,95,108,111, + 97,100,101,114,99,6,0,0,0,0,0,0,0,0,0,0, + 0,7,0,0,0,6,0,0,0,67,0,0,0,115,26,0, + 0,0,124,1,124,2,124,3,131,2,125,6,116,0,124,2, + 124,3,124,6,124,4,100,1,141,4,83,0,41,2,78,114, + 201,0,0,0,41,1,114,213,0,0,0,41,7,114,142,0, + 0,0,114,211,0,0,0,114,163,0,0,0,114,65,0,0, + 0,90,4,115,109,115,108,114,225,0,0,0,114,164,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,81,1,0,0,220,5,0,0,115,8,0,0,0,0,1, + 10,1,8,1,2,255,122,20,70,105,108,101,70,105,110,100, + 101,114,46,95,103,101,116,95,115,112,101,99,78,99,3,0, + 0,0,0,0,0,0,0,0,0,0,14,0,0,0,9,0, + 0,0,67,0,0,0,115,126,1,0,0,100,1,125,3,124, + 1,160,0,100,2,161,1,100,3,25,0,125,4,122,24,116, + 1,124,0,106,2,112,34,116,3,160,4,161,0,131,1,106, + 5,125,5,87,0,110,22,4,0,116,6,121,64,1,0,1, + 0,1,0,100,4,125,5,89,0,110,2,48,0,124,5,124, + 0,106,7,107,3,114,90,124,0,160,8,161,0,1,0,124, + 5,124,0,95,7,116,9,131,0,114,112,124,0,106,10,125, + 6,124,4,160,11,161,0,125,7,110,10,124,0,106,12,125, + 6,124,4,125,7,124,7,124,6,118,0,114,216,116,13,124, + 0,106,2,124,4,131,2,125,8,124,0,106,14,68,0,93, + 58,92,2,125,9,125,10,100,5,124,9,23,0,125,11,116, + 13,124,8,124,11,131,2,125,12,116,15,124,12,131,1,114, + 148,124,0,160,16,124,10,124,1,124,12,124,8,103,1,124, + 2,161,5,2,0,1,0,83,0,113,148,116,17,124,8,131, + 1,125,3,124,0,106,14,68,0,93,112,92,2,125,9,125, + 10,122,20,116,13,124,0,106,2,124,4,124,9,23,0,131, + 2,125,12,87,0,110,24,4,0,116,18,144,1,121,18,1, + 0,1,0,1,0,89,0,1,0,100,6,83,0,48,0,116, + 19,106,20,100,7,124,12,100,3,100,8,141,3,1,0,124, + 7,124,9,23,0,124,6,118,0,114,222,116,15,124,12,131, + 1,114,222,124,0,160,16,124,10,124,1,124,12,100,6,124, + 2,161,5,2,0,1,0,83,0,113,222,124,3,144,1,114, + 122,116,19,160,20,100,9,124,8,161,2,1,0,116,19,160, + 21,124,1,100,6,161,2,125,13,124,8,103,1,124,13,95, + 22,124,13,83,0,100,6,83,0,41,10,122,111,84,114,121, + 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, + 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, + 100,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,82,101,116,117,114,110,115,32,116,104,101,32,109, + 97,116,99,104,105,110,103,32,115,112,101,99,44,32,111,114, + 32,78,111,110,101,32,105,102,32,110,111,116,32,102,111,117, + 110,100,46,10,32,32,32,32,32,32,32,32,70,114,96,0, + 0,0,114,45,0,0,0,114,129,0,0,0,114,232,0,0, + 0,78,122,9,116,114,121,105,110,103,32,123,125,41,1,90, + 9,118,101,114,98,111,115,105,116,121,122,25,112,111,115,115, + 105,98,108,101,32,110,97,109,101,115,112,97,99,101,32,102, + 111,114,32,123,125,41,23,114,103,0,0,0,114,75,0,0, + 0,114,65,0,0,0,114,24,0,0,0,114,81,0,0,0, + 114,33,1,0,0,114,76,0,0,0,114,87,1,0,0,218, + 11,95,102,105,108,108,95,99,97,99,104,101,114,27,0,0, + 0,114,90,1,0,0,114,130,0,0,0,114,89,1,0,0, + 114,67,0,0,0,114,86,1,0,0,114,80,0,0,0,114, + 81,1,0,0,114,82,0,0,0,114,110,0,0,0,114,158, + 0,0,0,114,173,0,0,0,114,207,0,0,0,114,202,0, + 0,0,41,14,114,142,0,0,0,114,163,0,0,0,114,225, + 0,0,0,90,12,105,115,95,110,97,109,101,115,112,97,99, + 101,90,11,116,97,105,108,95,109,111,100,117,108,101,114,193, + 0,0,0,90,5,99,97,99,104,101,90,12,99,97,99,104, + 101,95,109,111,100,117,108,101,90,9,98,97,115,101,95,112, + 97,116,104,114,41,1,0,0,114,211,0,0,0,90,13,105, + 110,105,116,95,102,105,108,101,110,97,109,101,90,9,102,117, + 108,108,95,112,97,116,104,114,210,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,226,0,0,0, + 225,5,0,0,115,78,0,0,0,0,5,4,1,14,1,2, + 1,24,1,12,1,10,1,10,1,8,1,6,2,6,1,6, + 1,10,2,6,1,4,2,8,1,12,1,14,1,8,1,10, + 1,8,1,26,4,8,2,14,1,2,1,20,1,14,1,10, + 1,16,1,12,1,8,1,10,1,4,255,10,2,6,1,12, + 1,12,1,8,1,4,1,122,20,70,105,108,101,70,105,110, + 100,101,114,46,102,105,110,100,95,115,112,101,99,99,1,0, + 0,0,0,0,0,0,0,0,0,0,9,0,0,0,10,0, + 0,0,67,0,0,0,115,188,0,0,0,124,0,106,0,125, + 1,122,22,116,1,160,2,124,1,112,22,116,1,160,3,161, + 0,161,1,125,2,87,0,110,28,4,0,116,4,116,5,116, + 6,102,3,121,56,1,0,1,0,1,0,103,0,125,2,89, + 0,110,2,48,0,116,7,106,8,160,9,100,1,161,1,115, + 82,116,10,124,2,131,1,124,0,95,11,110,74,116,10,131, + 0,125,3,124,2,68,0,93,56,125,4,124,4,160,12,100, + 2,161,1,92,3,125,5,125,6,125,7,124,6,114,134,100, + 3,160,13,124,5,124,7,160,14,161,0,161,2,125,8,110, + 4,124,5,125,8,124,3,160,15,124,8,161,1,1,0,113, + 92,124,3,124,0,95,11,116,7,106,8,160,9,116,16,161, + 1,114,184,100,4,100,5,132,0,124,2,68,0,131,1,124, + 0,95,17,100,6,83,0,41,7,122,68,70,105,108,108,32, + 116,104,101,32,99,97,99,104,101,32,111,102,32,112,111,116, + 101,110,116,105,97,108,32,109,111,100,117,108,101,115,32,97, + 110,100,32,112,97,99,107,97,103,101,115,32,102,111,114,32, + 116,104,105,115,32,100,105,114,101,99,116,111,114,121,46,114, + 20,0,0,0,114,96,0,0,0,114,87,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,83,0,0,0,115,20,0,0,0,104,0,124,0, + 93,12,125,1,124,1,160,0,161,0,146,2,113,4,83,0, + 114,10,0,0,0,41,1,114,130,0,0,0,41,2,114,8, + 0,0,0,90,2,102,110,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,19,0,0,0,49,6,0,0,114, + 13,0,0,0,122,41,70,105,108,101,70,105,110,100,101,114, + 46,95,102,105,108,108,95,99,97,99,104,101,46,60,108,111, + 99,97,108,115,62,46,60,115,101,116,99,111,109,112,62,78, + 41,18,114,65,0,0,0,114,24,0,0,0,114,30,1,0, + 0,114,81,0,0,0,114,26,1,0,0,218,15,80,101,114, + 109,105,115,115,105,111,110,69,114,114,111,114,218,18,78,111, + 116,65,68,105,114,101,99,116,111,114,121,69,114,114,111,114, + 114,21,0,0,0,114,28,0,0,0,114,29,0,0,0,114, + 88,1,0,0,114,89,1,0,0,114,125,0,0,0,114,88, + 0,0,0,114,130,0,0,0,218,3,97,100,100,114,30,0, + 0,0,114,90,1,0,0,41,9,114,142,0,0,0,114,65, + 0,0,0,114,31,1,0,0,90,21,108,111,119,101,114,95, + 115,117,102,102,105,120,95,99,111,110,116,101,110,116,115,114, + 64,1,0,0,114,140,0,0,0,114,52,1,0,0,114,41, + 1,0,0,90,8,110,101,119,95,110,97,109,101,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,92,1,0, + 0,20,6,0,0,115,34,0,0,0,0,2,6,1,2,1, + 22,1,18,3,10,3,12,1,12,7,6,1,8,1,16,1, + 4,1,18,2,4,1,12,1,6,1,12,1,122,22,70,105, + 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, + 97,99,104,101,99,1,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,7,0,0,0,115,18,0, + 0,0,135,0,135,1,102,2,100,1,100,2,132,8,125,2, + 124,2,83,0,41,3,97,20,1,0,0,65,32,99,108,97, + 115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,32, + 114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,114, + 101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,46, + 112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,32, + 32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,116, + 117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,32, + 117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,32, + 116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,32, + 32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99, + 108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,32, + 32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,108, + 108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117, + 114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,101, + 99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,114, + 111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,97, + 105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,99, + 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, + 4,0,0,0,19,0,0,0,115,36,0,0,0,116,0,124, + 0,131,1,115,20,116,1,100,1,124,0,100,2,141,2,130, + 1,136,0,124,0,103,1,136,1,162,1,82,0,142,0,83, + 0,41,3,122,45,80,97,116,104,32,104,111,111,107,32,102, + 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, + 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, + 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, + 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, + 101,100,114,71,0,0,0,41,2,114,82,0,0,0,114,141, + 0,0,0,114,71,0,0,0,169,2,114,216,0,0,0,114, + 91,1,0,0,114,10,0,0,0,114,11,0,0,0,218,24, + 112,97,116,104,95,104,111,111,107,95,102,111,114,95,70,105, + 108,101,70,105,110,100,101,114,61,6,0,0,115,6,0,0, + 0,0,2,8,1,12,1,122,54,70,105,108,101,70,105,110, + 100,101,114,46,112,97,116,104,95,104,111,111,107,46,60,108, + 111,99,97,108,115,62,46,112,97,116,104,95,104,111,111,107, + 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,114, + 10,0,0,0,41,3,114,216,0,0,0,114,91,1,0,0, + 114,97,1,0,0,114,10,0,0,0,114,96,1,0,0,114, + 11,0,0,0,218,9,112,97,116,104,95,104,111,111,107,51, + 6,0,0,115,4,0,0,0,0,10,14,6,122,20,70,105, + 108,101,70,105,110,100,101,114,46,112,97,116,104,95,104,111, + 111,107,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, + 100,1,160,0,124,0,106,1,161,1,83,0,41,2,78,122, + 16,70,105,108,101,70,105,110,100,101,114,40,123,33,114,125, + 41,41,2,114,88,0,0,0,114,65,0,0,0,114,13,1, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,62,1,0,0,69,6,0,0,115,2,0,0,0,0, + 1,122,19,70,105,108,101,70,105,110,100,101,114,46,95,95, + 114,101,112,114,95,95,41,1,78,41,15,114,149,0,0,0, + 114,148,0,0,0,114,150,0,0,0,114,151,0,0,0,114, + 232,0,0,0,114,69,1,0,0,114,167,0,0,0,114,229, + 0,0,0,114,161,0,0,0,114,81,1,0,0,114,226,0, + 0,0,114,92,1,0,0,114,230,0,0,0,114,98,1,0, + 0,114,62,1,0,0,114,10,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,84,1,0,0,177, + 5,0,0,115,22,0,0,0,8,2,4,7,8,16,8,4, + 4,2,8,12,8,5,10,51,8,31,2,1,10,17,114,84, + 1,0,0,99,4,0,0,0,0,0,0,0,0,0,0,0, + 6,0,0,0,8,0,0,0,67,0,0,0,115,144,0,0, + 0,124,0,160,0,100,1,161,1,125,4,124,0,160,0,100, + 2,161,1,125,5,124,4,115,66,124,5,114,36,124,5,106, + 1,125,4,110,30,124,2,124,3,107,2,114,56,116,2,124, + 1,124,2,131,2,125,4,110,10,116,3,124,1,124,2,131, + 2,125,4,124,5,115,84,116,4,124,1,124,2,124,4,100, + 3,141,3,125,5,122,36,124,5,124,0,100,2,60,0,124, + 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, + 3,124,0,100,5,60,0,87,0,110,18,4,0,116,5,121, + 138,1,0,1,0,1,0,89,0,110,2,48,0,100,0,83, + 0,41,6,78,218,10,95,95,108,111,97,100,101,114,95,95, + 218,8,95,95,115,112,101,99,95,95,114,85,1,0,0,90, + 8,95,95,102,105,108,101,95,95,90,10,95,95,99,97,99, + 104,101,100,95,95,41,6,218,3,103,101,116,114,164,0,0, + 0,114,39,1,0,0,114,32,1,0,0,114,213,0,0,0, + 218,9,69,120,99,101,112,116,105,111,110,41,6,90,2,110, + 115,114,140,0,0,0,90,8,112,97,116,104,110,97,109,101, + 90,9,99,112,97,116,104,110,97,109,101,114,164,0,0,0, + 114,210,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,14,95,102,105,120,95,117,112,95,109,111, + 100,117,108,101,75,6,0,0,115,34,0,0,0,0,2,10, + 1,10,1,4,1,4,1,8,1,8,1,12,2,10,1,4, + 1,14,1,2,1,8,1,8,1,8,1,12,1,12,2,114, + 103,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, + 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, + 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, + 124,1,124,2,103,3,83,0,41,1,122,95,82,101,116,117, + 114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,105, + 108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,32, + 108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,97, + 99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,112, + 108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,102, + 105,120,101,115,41,46,10,32,32,32,32,41,7,114,19,1, + 0,0,114,187,0,0,0,218,18,101,120,116,101,110,115,105, + 111,110,95,115,117,102,102,105,120,101,115,114,32,1,0,0, + 114,126,0,0,0,114,39,1,0,0,114,112,0,0,0,41, + 3,90,10,101,120,116,101,110,115,105,111,110,115,90,6,115, + 111,117,114,99,101,90,8,98,121,116,101,99,111,100,101,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,208, + 0,0,0,98,6,0,0,115,8,0,0,0,0,5,12,1, + 8,1,8,1,114,208,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,10,0,0,0,9,0,0,0,67,0, + 0,0,115,132,1,0,0,124,0,97,0,116,0,106,1,97, + 1,116,0,106,2,97,2,116,1,106,3,116,4,25,0,125, + 1,100,1,100,2,103,1,102,2,100,3,100,4,100,2,103, + 2,102,2,102,2,125,2,124,2,68,0,93,108,92,2,125, + 3,125,4,116,5,100,5,100,6,132,0,124,4,68,0,131, + 1,131,1,115,82,74,0,130,1,124,4,100,7,25,0,125, + 5,124,3,116,1,106,3,118,0,114,116,116,1,106,3,124, + 3,25,0,125,6,1,0,113,170,113,52,122,20,116,0,160, + 6,124,3,161,1,125,6,87,0,1,0,113,170,87,0,113, + 52,4,0,116,7,121,158,1,0,1,0,1,0,89,0,113, + 52,89,0,113,52,48,0,113,52,116,7,100,8,131,1,130, + 1,116,8,124,1,100,9,124,6,131,3,1,0,116,8,124, + 1,100,10,124,5,131,3,1,0,116,8,124,1,100,11,100, + 12,160,9,124,4,161,1,131,3,1,0,116,8,124,1,100, + 13,100,14,100,15,132,0,124,4,68,0,131,1,131,3,1, + 0,103,0,100,16,162,1,125,7,124,3,100,3,107,2,144, + 1,114,6,124,7,160,10,100,17,161,1,1,0,124,7,68, + 0,93,52,125,8,124,8,116,1,106,3,118,1,144,1,114, + 38,116,0,160,6,124,8,161,1,125,9,110,10,116,1,106, + 3,124,8,25,0,125,9,116,8,124,1,124,8,124,9,131, + 3,1,0,144,1,113,10,116,8,124,1,100,18,116,11,131, + 0,131,3,1,0,116,12,160,13,116,2,160,14,161,0,161, + 1,1,0,124,3,100,3,107,2,144,1,114,128,116,15,160, + 10,100,19,161,1,1,0,100,20,116,12,118,0,144,1,114, + 128,100,21,116,16,95,17,100,22,83,0,41,23,122,205,83, + 101,116,117,112,32,116,104,101,32,112,97,116,104,45,98,97, + 115,101,100,32,105,109,112,111,114,116,101,114,115,32,102,111, + 114,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, + 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,10, + 32,32,32,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, + 110,103,32,116,104,101,109,32,105,110,116,111,32,116,104,101, + 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, + 101,46,10,10,32,32,32,32,79,116,104,101,114,32,99,111, + 109,112,111,110,101,110,116,115,32,97,114,101,32,101,120,116, + 114,97,99,116,101,100,32,102,114,111,109,32,116,104,101,32, + 99,111,114,101,32,98,111,111,116,115,116,114,97,112,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,218,5,112,111, + 115,105,120,114,2,0,0,0,218,2,110,116,114,1,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,115,0,0,0,115,26,0,0,0,124, + 0,93,18,125,1,116,0,124,1,131,1,100,0,107,2,86, + 0,1,0,113,2,100,1,83,0,114,3,0,0,0,114,5, + 0,0,0,114,7,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,12,0,0,0,127,6,0,0, + 114,13,0,0,0,122,25,95,115,101,116,117,112,46,60,108, + 111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,62, + 114,0,0,0,0,122,30,105,109,112,111,114,116,108,105,98, + 32,114,101,113,117,105,114,101,115,32,112,111,115,105,120,32, + 111,114,32,110,116,114,24,0,0,0,114,59,0,0,0,114, + 50,0,0,0,114,14,0,0,0,218,20,95,112,97,116,104, + 115,101,112,115,95,119,105,116,104,95,99,111,108,111,110,99, + 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 4,0,0,0,83,0,0,0,115,22,0,0,0,104,0,124, + 0,93,14,125,1,100,0,124,1,155,0,157,2,146,2,113, + 4,83,0,114,15,0,0,0,114,10,0,0,0,114,17,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,19,0,0,0,144,6,0,0,114,13,0,0,0,122, + 25,95,115,101,116,117,112,46,60,108,111,99,97,108,115,62, + 46,60,115,101,116,99,111,109,112,62,41,3,114,90,0,0, + 0,114,98,0,0,0,114,184,0,0,0,114,215,0,0,0, + 114,27,0,0,0,122,4,46,112,121,119,122,6,95,100,46, + 112,121,100,84,78,41,18,114,158,0,0,0,114,21,0,0, + 0,114,187,0,0,0,114,54,1,0,0,114,149,0,0,0, + 218,3,97,108,108,90,18,95,98,117,105,108,116,105,110,95, + 102,114,111,109,95,110,97,109,101,114,141,0,0,0,114,153, + 0,0,0,114,62,0,0,0,114,61,0,0,0,114,32,0, + 0,0,114,44,1,0,0,114,191,0,0,0,114,104,1,0, + 0,114,126,0,0,0,114,214,0,0,0,114,218,0,0,0, + 41,10,218,17,95,98,111,111,116,115,116,114,97,112,95,109, + 111,100,117,108,101,90,11,115,101,108,102,95,109,111,100,117, + 108,101,90,10,111,115,95,100,101,116,97,105,108,115,90,10, + 98,117,105,108,116,105,110,95,111,115,114,50,0,0,0,114, + 59,0,0,0,90,9,111,115,95,109,111,100,117,108,101,90, + 13,98,117,105,108,116,105,110,95,110,97,109,101,115,90,12, + 98,117,105,108,116,105,110,95,110,97,109,101,90,14,98,117, + 105,108,116,105,110,95,109,111,100,117,108,101,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,6,95,115,101, + 116,117,112,109,6,0,0,115,70,0,0,0,0,8,4,1, + 6,1,6,2,10,3,22,1,12,2,22,1,8,1,10,1, + 10,1,6,2,2,1,10,1,10,1,12,1,12,2,8,2, + 12,1,12,1,18,1,22,3,8,1,10,1,10,1,8,1, + 12,1,12,2,10,1,16,3,14,1,14,1,10,1,10,1, + 10,1,114,110,1,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, + 115,50,0,0,0,116,0,124,0,131,1,1,0,116,1,131, + 0,125,1,116,2,106,3,160,4,116,5,106,6,124,1,142, + 0,103,1,161,1,1,0,116,2,106,7,160,8,116,9,161, + 1,1,0,100,1,83,0,41,2,122,41,73,110,115,116,97, + 108,108,32,116,104,101,32,112,97,116,104,45,98,97,115,101, + 100,32,105,109,112,111,114,116,32,99,111,109,112,111,110,101, + 110,116,115,46,78,41,10,114,110,1,0,0,114,208,0,0, + 0,114,21,0,0,0,114,74,1,0,0,114,191,0,0,0, + 114,84,1,0,0,114,98,1,0,0,218,9,109,101,116,97, + 95,112,97,116,104,114,61,0,0,0,114,68,1,0,0,41, + 2,114,109,1,0,0,90,17,115,117,112,112,111,114,116,101, + 100,95,108,111,97,100,101,114,115,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,8,95,105,110,115,116,97, + 108,108,166,6,0,0,115,8,0,0,0,0,2,8,1,6, + 1,20,1,114,112,1,0,0,41,1,114,86,0,0,0,41, + 1,78,41,3,78,78,78,41,2,114,0,0,0,0,114,0, + 0,0,0,41,1,84,41,1,78,41,1,78,41,81,114,151, + 0,0,0,114,187,0,0,0,114,90,0,0,0,114,21,0, + 0,0,114,98,0,0,0,114,184,0,0,0,114,28,0,0, + 0,90,11,95,77,83,95,87,73,78,68,79,87,83,114,106, + 1,0,0,114,24,0,0,0,114,215,0,0,0,114,105,1, + 0,0,114,50,0,0,0,114,108,1,0,0,114,59,0,0, + 0,114,135,0,0,0,114,57,0,0,0,114,62,0,0,0, + 114,107,1,0,0,114,31,0,0,0,90,37,95,67,65,83, + 69,95,73,78,83,69,78,83,73,84,73,86,69,95,80,76, + 65,84,70,79,82,77,83,95,66,89,84,69,83,95,75,69, + 89,114,30,0,0,0,114,32,0,0,0,114,39,0,0,0, + 114,44,0,0,0,114,46,0,0,0,114,67,0,0,0,114, + 74,0,0,0,114,75,0,0,0,114,79,0,0,0,114,80, + 0,0,0,114,82,0,0,0,114,85,0,0,0,114,94,0, + 0,0,218,4,116,121,112,101,218,8,95,95,99,111,100,101, + 95,95,114,186,0,0,0,114,37,0,0,0,114,172,0,0, + 0,114,36,0,0,0,114,41,0,0,0,114,3,1,0,0, + 114,115,0,0,0,114,111,0,0,0,114,126,0,0,0,114, + 112,0,0,0,90,23,68,69,66,85,71,95,66,89,84,69, + 67,79,68,69,95,83,85,70,70,73,88,69,83,90,27,79, + 80,84,73,77,73,90,69,68,95,66,89,84,69,67,79,68, + 69,95,83,85,70,70,73,88,69,83,114,120,0,0,0,114, + 127,0,0,0,114,134,0,0,0,114,136,0,0,0,114,138, + 0,0,0,114,160,0,0,0,114,167,0,0,0,114,176,0, + 0,0,114,180,0,0,0,114,182,0,0,0,114,189,0,0, + 0,114,194,0,0,0,114,195,0,0,0,114,200,0,0,0, + 218,6,111,98,106,101,99,116,114,209,0,0,0,114,213,0, + 0,0,114,214,0,0,0,114,231,0,0,0,114,244,0,0, + 0,114,6,1,0,0,114,32,1,0,0,114,39,1,0,0, + 114,44,1,0,0,114,19,1,0,0,114,45,1,0,0,114, + 66,1,0,0,114,68,1,0,0,114,84,1,0,0,114,103, + 1,0,0,114,208,0,0,0,114,110,1,0,0,114,112,1, + 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,8,60,109,111,100,117,108,101,62, + 1,0,0,0,115,170,0,0,0,4,22,8,1,8,1,8, + 1,8,1,8,3,10,1,4,1,8,1,10,2,8,3,4, + 1,10,2,6,2,22,1,8,1,8,1,10,1,14,4,4, + 1,4,1,2,1,2,255,4,4,8,17,8,5,8,5,8, + 6,4,1,10,30,8,6,8,8,8,10,8,9,8,5,8, + 7,6,1,10,8,8,5,10,22,10,127,0,20,16,1,12, + 2,4,1,4,2,6,2,6,2,8,2,16,71,8,40,8, + 19,8,12,8,12,8,28,8,17,8,33,8,28,8,24,10, + 13,10,10,10,11,8,14,6,3,4,1,2,255,12,68,14, + 64,14,29,16,127,0,17,14,72,18,45,18,26,4,3,18, + 58,14,63,14,42,14,127,0,20,14,127,0,27,10,23,8, + 11,8,57, }; diff --git a/contrib/tools/python3/src/Python/importlib_zipimport.h b/contrib/tools/python3/src/Python/importlib_zipimport.h index 1e5790f8a4..373b1366bd 100644 --- a/contrib/tools/python3/src/Python/importlib_zipimport.h +++ b/contrib/tools/python3/src/Python/importlib_zipimport.h @@ -1,1079 +1,1079 @@ -/* Auto-generated by Programs/_freeze_importlib.c */ -const unsigned char _Py_M__zipimport[] = { - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,4,0,0,0,64,0,0,0,115,82,1,0,0,100,0, - 90,0,100,1,100,2,108,1,90,2,100,1,100,3,108,1, - 109,3,90,3,109,4,90,4,1,0,100,1,100,2,108,5, - 90,6,100,1,100,2,108,7,90,7,100,1,100,2,108,8, - 90,8,100,1,100,2,108,9,90,9,100,1,100,2,108,10, - 90,10,100,1,100,2,108,11,90,11,100,4,100,5,103,2, - 90,12,101,2,106,13,90,13,101,2,106,14,100,6,100,2, - 133,2,25,0,90,15,71,0,100,7,100,4,132,0,100,4, - 101,16,131,3,90,17,105,0,90,18,101,19,101,10,131,1, - 90,20,100,8,90,21,100,9,90,22,100,10,90,23,71,0, - 100,11,100,5,132,0,100,5,131,2,90,24,101,13,100,12, - 23,0,100,13,100,13,102,3,101,13,100,14,23,0,100,15, - 100,13,102,3,100,16,100,17,102,4,90,25,100,18,100,19, - 132,0,90,26,100,20,100,21,132,0,90,27,100,22,100,23, - 132,0,90,28,100,24,100,25,132,0,90,29,100,26,90,30, - 100,15,97,31,100,27,100,28,132,0,90,32,100,29,100,30, - 132,0,90,33,100,31,100,32,132,0,90,34,100,33,100,34, - 132,0,90,35,101,19,101,35,106,36,131,1,90,37,100,35, - 100,36,132,0,90,38,100,37,100,38,132,0,90,39,100,39, - 100,40,132,0,90,40,100,41,100,42,132,0,90,41,100,43, - 100,44,132,0,90,42,100,45,100,46,132,0,90,43,71,0, - 100,47,100,48,132,0,100,48,131,2,90,44,100,2,83,0, - 41,49,97,80,2,0,0,122,105,112,105,109,112,111,114,116, - 32,112,114,111,118,105,100,101,115,32,115,117,112,112,111,114, - 116,32,102,111,114,32,105,109,112,111,114,116,105,110,103,32, - 80,121,116,104,111,110,32,109,111,100,117,108,101,115,32,102, - 114,111,109,32,90,105,112,32,97,114,99,104,105,118,101,115, - 46,10,10,84,104,105,115,32,109,111,100,117,108,101,32,101, - 120,112,111,114,116,115,32,116,104,114,101,101,32,111,98,106, - 101,99,116,115,58,10,45,32,122,105,112,105,109,112,111,114, - 116,101,114,58,32,97,32,99,108,97,115,115,59,32,105,116, - 115,32,99,111,110,115,116,114,117,99,116,111,114,32,116,97, - 107,101,115,32,97,32,112,97,116,104,32,116,111,32,97,32, - 90,105,112,32,97,114,99,104,105,118,101,46,10,45,32,90, - 105,112,73,109,112,111,114,116,69,114,114,111,114,58,32,101, - 120,99,101,112,116,105,111,110,32,114,97,105,115,101,100,32, - 98,121,32,122,105,112,105,109,112,111,114,116,101,114,32,111, - 98,106,101,99,116,115,46,32,73,116,39,115,32,97,10,32, - 32,115,117,98,99,108,97,115,115,32,111,102,32,73,109,112, - 111,114,116,69,114,114,111,114,44,32,115,111,32,105,116,32, - 99,97,110,32,98,101,32,99,97,117,103,104,116,32,97,115, - 32,73,109,112,111,114,116,69,114,114,111,114,44,32,116,111, - 111,46,10,45,32,95,122,105,112,95,100,105,114,101,99,116, - 111,114,121,95,99,97,99,104,101,58,32,97,32,100,105,99, - 116,44,32,109,97,112,112,105,110,103,32,97,114,99,104,105, - 118,101,32,112,97,116,104,115,32,116,111,32,122,105,112,32, - 100,105,114,101,99,116,111,114,121,10,32,32,105,110,102,111, - 32,100,105,99,116,115,44,32,97,115,32,117,115,101,100,32, - 105,110,32,122,105,112,105,109,112,111,114,116,101,114,46,95, - 102,105,108,101,115,46,10,10,73,116,32,105,115,32,117,115, - 117,97,108,108,121,32,110,111,116,32,110,101,101,100,101,100, - 32,116,111,32,117,115,101,32,116,104,101,32,122,105,112,105, - 109,112,111,114,116,32,109,111,100,117,108,101,32,101,120,112, - 108,105,99,105,116,108,121,59,32,105,116,32,105,115,10,117, - 115,101,100,32,98,121,32,116,104,101,32,98,117,105,108,116, - 105,110,32,105,109,112,111,114,116,32,109,101,99,104,97,110, - 105,115,109,32,102,111,114,32,115,121,115,46,112,97,116,104, - 32,105,116,101,109,115,32,116,104,97,116,32,97,114,101,32, - 112,97,116,104,115,10,116,111,32,90,105,112,32,97,114,99, - 104,105,118,101,115,46,10,233,0,0,0,0,78,41,2,218, - 14,95,117,110,112,97,99,107,95,117,105,110,116,49,54,218, - 14,95,117,110,112,97,99,107,95,117,105,110,116,51,50,218, - 14,90,105,112,73,109,112,111,114,116,69,114,114,111,114,218, - 11,122,105,112,105,109,112,111,114,116,101,114,233,1,0,0, - 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,64,0,0,0,115,12,0,0,0,101, - 0,90,1,100,0,90,2,100,1,83,0,41,2,114,3,0, - 0,0,78,41,3,218,8,95,95,110,97,109,101,95,95,218, - 10,95,95,109,111,100,117,108,101,95,95,218,12,95,95,113, - 117,97,108,110,97,109,101,95,95,169,0,114,9,0,0,0, - 114,9,0,0,0,250,18,60,102,114,111,122,101,110,32,122, - 105,112,105,109,112,111,114,116,62,114,3,0,0,0,33,0, - 0,0,115,2,0,0,0,8,1,233,22,0,0,0,115,4, - 0,0,0,80,75,5,6,105,255,255,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,64,0,0,0,115,108,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,25, - 100,5,100,6,132,1,90,5,100,26,100,7,100,8,132,1, - 90,6,100,9,100,10,132,0,90,7,100,11,100,12,132,0, - 90,8,100,13,100,14,132,0,90,9,100,15,100,16,132,0, - 90,10,100,17,100,18,132,0,90,11,100,19,100,20,132,0, - 90,12,100,21,100,22,132,0,90,13,100,23,100,24,132,0, - 90,14,100,4,83,0,41,27,114,4,0,0,0,97,255,1, - 0,0,122,105,112,105,109,112,111,114,116,101,114,40,97,114, - 99,104,105,118,101,112,97,116,104,41,32,45,62,32,122,105, - 112,105,109,112,111,114,116,101,114,32,111,98,106,101,99,116, - 10,10,32,32,32,32,67,114,101,97,116,101,32,97,32,110, - 101,119,32,122,105,112,105,109,112,111,114,116,101,114,32,105, - 110,115,116,97,110,99,101,46,32,39,97,114,99,104,105,118, - 101,112,97,116,104,39,32,109,117,115,116,32,98,101,32,97, - 32,112,97,116,104,32,116,111,10,32,32,32,32,97,32,122, - 105,112,102,105,108,101,44,32,111,114,32,116,111,32,97,32, - 115,112,101,99,105,102,105,99,32,112,97,116,104,32,105,110, - 115,105,100,101,32,97,32,122,105,112,102,105,108,101,46,32, - 70,111,114,32,101,120,97,109,112,108,101,44,32,105,116,32, - 99,97,110,32,98,101,10,32,32,32,32,39,47,116,109,112, - 47,109,121,105,109,112,111,114,116,46,122,105,112,39,44,32, - 111,114,32,39,47,116,109,112,47,109,121,105,109,112,111,114, - 116,46,122,105,112,47,109,121,100,105,114,101,99,116,111,114, - 121,39,44,32,105,102,32,109,121,100,105,114,101,99,116,111, - 114,121,32,105,115,32,97,10,32,32,32,32,118,97,108,105, - 100,32,100,105,114,101,99,116,111,114,121,32,105,110,115,105, - 100,101,32,116,104,101,32,97,114,99,104,105,118,101,46,10, - 10,32,32,32,32,39,90,105,112,73,109,112,111,114,116,69, - 114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,105, - 102,32,39,97,114,99,104,105,118,101,112,97,116,104,39,32, - 100,111,101,115,110,39,116,32,112,111,105,110,116,32,116,111, - 32,97,32,118,97,108,105,100,32,90,105,112,10,32,32,32, - 32,97,114,99,104,105,118,101,46,10,10,32,32,32,32,84, - 104,101,32,39,97,114,99,104,105,118,101,39,32,97,116,116, - 114,105,98,117,116,101,32,111,102,32,122,105,112,105,109,112, - 111,114,116,101,114,32,111,98,106,101,99,116,115,32,99,111, - 110,116,97,105,110,115,32,116,104,101,32,110,97,109,101,32, - 111,102,32,116,104,101,10,32,32,32,32,122,105,112,102,105, - 108,101,32,116,97,114,103,101,116,101,100,46,10,32,32,32, - 32,99,2,0,0,0,0,0,0,0,0,0,0,0,8,0, - 0,0,9,0,0,0,67,0,0,0,115,32,1,0,0,116, - 0,124,1,116,1,131,2,115,28,100,1,100,0,108,2,125, - 2,124,2,160,3,124,1,161,1,125,1,124,1,115,44,116, - 4,100,2,124,1,100,3,141,2,130,1,116,5,114,60,124, - 1,160,6,116,5,116,7,161,2,125,1,103,0,125,3,122, - 14,116,8,160,9,124,1,161,1,125,4,87,0,110,70,4, - 0,116,10,116,11,102,2,121,148,1,0,1,0,1,0,116, - 8,160,12,124,1,161,1,92,2,125,5,125,6,124,5,124, - 1,107,2,114,130,116,4,100,4,124,1,100,3,141,2,130, - 1,124,5,125,1,124,3,160,13,124,6,161,1,1,0,89, - 0,113,64,48,0,124,4,106,14,100,5,64,0,100,6,107, - 3,114,180,116,4,100,4,124,1,100,3,141,2,130,1,113, - 180,113,64,122,12,116,15,124,1,25,0,125,7,87,0,110, - 34,4,0,116,16,121,226,1,0,1,0,1,0,116,17,124, - 1,131,1,125,7,124,7,116,15,124,1,60,0,89,0,110, - 2,48,0,124,7,124,0,95,18,124,1,124,0,95,19,116, - 8,106,20,124,3,100,0,100,0,100,7,133,3,25,0,142, - 0,124,0,95,21,124,0,106,21,144,1,114,28,124,0,4, - 0,106,21,116,7,55,0,2,0,95,21,100,0,83,0,41, - 8,78,114,0,0,0,0,122,21,97,114,99,104,105,118,101, - 32,112,97,116,104,32,105,115,32,101,109,112,116,121,169,1, - 218,4,112,97,116,104,122,14,110,111,116,32,97,32,90,105, - 112,32,102,105,108,101,105,0,240,0,0,105,0,128,0,0, - 233,255,255,255,255,41,22,218,10,105,115,105,110,115,116,97, - 110,99,101,218,3,115,116,114,218,2,111,115,90,8,102,115, - 100,101,99,111,100,101,114,3,0,0,0,218,12,97,108,116, - 95,112,97,116,104,95,115,101,112,218,7,114,101,112,108,97, - 99,101,218,8,112,97,116,104,95,115,101,112,218,19,95,98, - 111,111,116,115,116,114,97,112,95,101,120,116,101,114,110,97, - 108,90,10,95,112,97,116,104,95,115,116,97,116,218,7,79, - 83,69,114,114,111,114,218,10,86,97,108,117,101,69,114,114, - 111,114,90,11,95,112,97,116,104,95,115,112,108,105,116,218, - 6,97,112,112,101,110,100,90,7,115,116,95,109,111,100,101, - 218,20,95,122,105,112,95,100,105,114,101,99,116,111,114,121, - 95,99,97,99,104,101,218,8,75,101,121,69,114,114,111,114, - 218,15,95,114,101,97,100,95,100,105,114,101,99,116,111,114, - 121,218,6,95,102,105,108,101,115,218,7,97,114,99,104,105, - 118,101,218,10,95,112,97,116,104,95,106,111,105,110,218,6, - 112,114,101,102,105,120,41,8,218,4,115,101,108,102,114,13, - 0,0,0,114,17,0,0,0,114,31,0,0,0,90,2,115, - 116,90,7,100,105,114,110,97,109,101,90,8,98,97,115,101, - 110,97,109,101,218,5,102,105,108,101,115,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,8,95,95,105,110, - 105,116,95,95,63,0,0,0,115,58,0,0,0,0,1,10, - 1,8,1,10,1,4,1,12,1,4,1,12,2,4,2,2, - 1,14,1,16,3,14,1,8,1,12,1,4,1,16,3,14, - 2,12,1,4,2,2,1,12,1,12,1,8,1,14,1,6, - 1,6,2,22,1,8,1,122,20,122,105,112,105,109,112,111, - 114,116,101,114,46,95,95,105,110,105,116,95,95,78,99,3, - 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4, - 0,0,0,67,0,0,0,115,78,0,0,0,116,0,124,0, - 124,1,131,2,125,3,124,3,100,1,117,1,114,26,124,0, - 103,0,102,2,83,0,116,1,124,0,124,1,131,2,125,4, - 116,2,124,0,124,4,131,2,114,70,100,1,124,0,106,3, - 155,0,116,4,155,0,124,4,155,0,157,3,103,1,102,2, - 83,0,100,1,103,0,102,2,83,0,41,2,97,239,1,0, - 0,102,105,110,100,95,108,111,97,100,101,114,40,102,117,108, - 108,110,97,109,101,44,32,112,97,116,104,61,78,111,110,101, - 41,32,45,62,32,115,101,108,102,44,32,115,116,114,32,111, - 114,32,78,111,110,101,46,10,10,32,32,32,32,32,32,32, - 32,83,101,97,114,99,104,32,102,111,114,32,97,32,109,111, - 100,117,108,101,32,115,112,101,99,105,102,105,101,100,32,98, - 121,32,39,102,117,108,108,110,97,109,101,39,46,32,39,102, - 117,108,108,110,97,109,101,39,32,109,117,115,116,32,98,101, - 32,116,104,101,10,32,32,32,32,32,32,32,32,102,117,108, - 108,121,32,113,117,97,108,105,102,105,101,100,32,40,100,111, - 116,116,101,100,41,32,109,111,100,117,108,101,32,110,97,109, - 101,46,32,73,116,32,114,101,116,117,114,110,115,32,116,104, - 101,32,122,105,112,105,109,112,111,114,116,101,114,10,32,32, - 32,32,32,32,32,32,105,110,115,116,97,110,99,101,32,105, - 116,115,101,108,102,32,105,102,32,116,104,101,32,109,111,100, - 117,108,101,32,119,97,115,32,102,111,117,110,100,44,32,97, - 32,115,116,114,105,110,103,32,99,111,110,116,97,105,110,105, - 110,103,32,116,104,101,10,32,32,32,32,32,32,32,32,102, - 117,108,108,32,112,97,116,104,32,110,97,109,101,32,105,102, - 32,105,116,39,115,32,112,111,115,115,105,98,108,121,32,97, - 32,112,111,114,116,105,111,110,32,111,102,32,97,32,110,97, - 109,101,115,112,97,99,101,32,112,97,99,107,97,103,101,44, - 10,32,32,32,32,32,32,32,32,111,114,32,78,111,110,101, - 32,111,116,104,101,114,119,105,115,101,46,32,84,104,101,32, - 111,112,116,105,111,110,97,108,32,39,112,97,116,104,39,32, - 97,114,103,117,109,101,110,116,32,105,115,32,105,103,110,111, - 114,101,100,32,45,45,32,105,116,39,115,10,32,32,32,32, - 32,32,32,32,116,104,101,114,101,32,102,111,114,32,99,111, - 109,112,97,116,105,98,105,108,105,116,121,32,119,105,116,104, - 32,116,104,101,32,105,109,112,111,114,116,101,114,32,112,114, - 111,116,111,99,111,108,46,10,32,32,32,32,32,32,32,32, - 78,41,5,218,16,95,103,101,116,95,109,111,100,117,108,101, - 95,105,110,102,111,218,16,95,103,101,116,95,109,111,100,117, - 108,101,95,112,97,116,104,218,7,95,105,115,95,100,105,114, - 114,29,0,0,0,114,20,0,0,0,41,5,114,32,0,0, - 0,218,8,102,117,108,108,110,97,109,101,114,13,0,0,0, - 218,2,109,105,218,7,109,111,100,112,97,116,104,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,218,11,102,105, - 110,100,95,108,111,97,100,101,114,109,0,0,0,115,14,0, - 0,0,0,10,10,1,8,2,8,7,10,1,10,4,24,2, - 122,23,122,105,112,105,109,112,111,114,116,101,114,46,102,105, - 110,100,95,108,111,97,100,101,114,99,3,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, - 0,0,115,16,0,0,0,124,0,160,0,124,1,124,2,161, - 2,100,1,25,0,83,0,41,2,97,139,1,0,0,102,105, - 110,100,95,109,111,100,117,108,101,40,102,117,108,108,110,97, - 109,101,44,32,112,97,116,104,61,78,111,110,101,41,32,45, - 62,32,115,101,108,102,32,111,114,32,78,111,110,101,46,10, - 10,32,32,32,32,32,32,32,32,83,101,97,114,99,104,32, - 102,111,114,32,97,32,109,111,100,117,108,101,32,115,112,101, - 99,105,102,105,101,100,32,98,121,32,39,102,117,108,108,110, - 97,109,101,39,46,32,39,102,117,108,108,110,97,109,101,39, - 32,109,117,115,116,32,98,101,32,116,104,101,10,32,32,32, - 32,32,32,32,32,102,117,108,108,121,32,113,117,97,108,105, - 102,105,101,100,32,40,100,111,116,116,101,100,41,32,109,111, - 100,117,108,101,32,110,97,109,101,46,32,73,116,32,114,101, - 116,117,114,110,115,32,116,104,101,32,122,105,112,105,109,112, - 111,114,116,101,114,10,32,32,32,32,32,32,32,32,105,110, - 115,116,97,110,99,101,32,105,116,115,101,108,102,32,105,102, - 32,116,104,101,32,109,111,100,117,108,101,32,119,97,115,32, - 102,111,117,110,100,44,32,111,114,32,78,111,110,101,32,105, - 102,32,105,116,32,119,97,115,110,39,116,46,10,32,32,32, - 32,32,32,32,32,84,104,101,32,111,112,116,105,111,110,97, - 108,32,39,112,97,116,104,39,32,97,114,103,117,109,101,110, - 116,32,105,115,32,105,103,110,111,114,101,100,32,45,45,32, - 105,116,39,115,32,116,104,101,114,101,32,102,111,114,32,99, - 111,109,112,97,116,105,98,105,108,105,116,121,10,32,32,32, - 32,32,32,32,32,119,105,116,104,32,116,104,101,32,105,109, - 112,111,114,116,101,114,32,112,114,111,116,111,99,111,108,46, - 10,32,32,32,32,32,32,32,32,114,0,0,0,0,41,1, - 114,41,0,0,0,41,3,114,32,0,0,0,114,38,0,0, - 0,114,13,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,11,102,105,110,100,95,109,111,100,117, - 108,101,141,0,0,0,115,2,0,0,0,0,9,122,23,122, - 105,112,105,109,112,111,114,116,101,114,46,102,105,110,100,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,5,0,0,0,3,0,0,0,67,0,0,0,115, - 20,0,0,0,116,0,124,0,124,1,131,2,92,3,125,2, - 125,3,125,4,124,2,83,0,41,1,122,163,103,101,116,95, - 99,111,100,101,40,102,117,108,108,110,97,109,101,41,32,45, - 62,32,99,111,100,101,32,111,98,106,101,99,116,46,10,10, - 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,116, - 104,101,32,99,111,100,101,32,111,98,106,101,99,116,32,102, - 111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100, - 32,109,111,100,117,108,101,46,32,82,97,105,115,101,32,90, - 105,112,73,109,112,111,114,116,69,114,114,111,114,10,32,32, - 32,32,32,32,32,32,105,102,32,116,104,101,32,109,111,100, - 117,108,101,32,99,111,117,108,100,110,39,116,32,98,101,32, - 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,169, - 1,218,16,95,103,101,116,95,109,111,100,117,108,101,95,99, - 111,100,101,169,5,114,32,0,0,0,114,38,0,0,0,218, - 4,99,111,100,101,218,9,105,115,112,97,99,107,97,103,101, - 114,40,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,218,8,103,101,116,95,99,111,100,101,153,0, - 0,0,115,4,0,0,0,0,6,16,1,122,20,122,105,112, - 105,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,4,0, - 0,0,8,0,0,0,67,0,0,0,115,116,0,0,0,116, - 0,114,16,124,1,160,1,116,0,116,2,161,2,125,1,124, - 1,125,2,124,1,160,3,124,0,106,4,116,2,23,0,161, - 1,114,58,124,1,116,5,124,0,106,4,116,2,23,0,131, - 1,100,1,133,2,25,0,125,2,122,14,124,0,106,6,124, - 2,25,0,125,3,87,0,110,30,4,0,116,7,121,102,1, - 0,1,0,1,0,116,8,100,2,100,3,124,2,131,3,130, - 1,89,0,110,2,48,0,116,9,124,0,106,4,124,3,131, - 2,83,0,41,4,122,154,103,101,116,95,100,97,116,97,40, - 112,97,116,104,110,97,109,101,41,32,45,62,32,115,116,114, - 105,110,103,32,119,105,116,104,32,102,105,108,101,32,100,97, - 116,97,46,10,10,32,32,32,32,32,32,32,32,82,101,116, - 117,114,110,32,116,104,101,32,100,97,116,97,32,97,115,115, - 111,99,105,97,116,101,100,32,119,105,116,104,32,39,112,97, - 116,104,110,97,109,101,39,46,32,82,97,105,115,101,32,79, - 83,69,114,114,111,114,32,105,102,10,32,32,32,32,32,32, - 32,32,116,104,101,32,102,105,108,101,32,119,97,115,110,39, - 116,32,102,111,117,110,100,46,10,32,32,32,32,32,32,32, - 32,78,114,0,0,0,0,218,0,41,10,114,18,0,0,0, - 114,19,0,0,0,114,20,0,0,0,218,10,115,116,97,114, - 116,115,119,105,116,104,114,29,0,0,0,218,3,108,101,110, - 114,28,0,0,0,114,26,0,0,0,114,22,0,0,0,218, - 9,95,103,101,116,95,100,97,116,97,41,4,114,32,0,0, - 0,218,8,112,97,116,104,110,97,109,101,90,3,107,101,121, - 218,9,116,111,99,95,101,110,116,114,121,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,8,103,101,116,95, - 100,97,116,97,163,0,0,0,115,20,0,0,0,0,6,4, - 1,12,2,4,1,16,1,22,2,2,1,14,1,12,1,18, - 1,122,20,122,105,112,105,109,112,111,114,116,101,114,46,103, - 101,116,95,100,97,116,97,99,2,0,0,0,0,0,0,0, - 0,0,0,0,5,0,0,0,3,0,0,0,67,0,0,0, - 115,20,0,0,0,116,0,124,0,124,1,131,2,92,3,125, - 2,125,3,125,4,124,4,83,0,41,1,122,106,103,101,116, - 95,102,105,108,101,110,97,109,101,40,102,117,108,108,110,97, - 109,101,41,32,45,62,32,102,105,108,101,110,97,109,101,32, - 115,116,114,105,110,103,46,10,10,32,32,32,32,32,32,32, - 32,82,101,116,117,114,110,32,116,104,101,32,102,105,108,101, - 110,97,109,101,32,102,111,114,32,116,104,101,32,115,112,101, - 99,105,102,105,101,100,32,109,111,100,117,108,101,46,10,32, - 32,32,32,32,32,32,32,114,43,0,0,0,114,45,0,0, - 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 218,12,103,101,116,95,102,105,108,101,110,97,109,101,184,0, - 0,0,115,4,0,0,0,0,7,16,1,122,24,122,105,112, - 105,109,112,111,114,116,101,114,46,103,101,116,95,102,105,108, - 101,110,97,109,101,99,2,0,0,0,0,0,0,0,0,0, - 0,0,6,0,0,0,8,0,0,0,67,0,0,0,115,126, - 0,0,0,116,0,124,0,124,1,131,2,125,2,124,2,100, - 1,117,0,114,36,116,1,100,2,124,1,155,2,157,2,124, - 1,100,3,141,2,130,1,116,2,124,0,124,1,131,2,125, - 3,124,2,114,64,116,3,160,4,124,3,100,4,161,2,125, - 4,110,10,124,3,155,0,100,5,157,2,125,4,122,14,124, - 0,106,5,124,4,25,0,125,5,87,0,110,20,4,0,116, - 6,121,108,1,0,1,0,1,0,89,0,100,1,83,0,48, - 0,116,7,124,0,106,8,124,5,131,2,160,9,161,0,83, - 0,41,6,122,253,103,101,116,95,115,111,117,114,99,101,40, - 102,117,108,108,110,97,109,101,41,32,45,62,32,115,111,117, - 114,99,101,32,115,116,114,105,110,103,46,10,10,32,32,32, - 32,32,32,32,32,82,101,116,117,114,110,32,116,104,101,32, - 115,111,117,114,99,101,32,99,111,100,101,32,102,111,114,32, - 116,104,101,32,115,112,101,99,105,102,105,101,100,32,109,111, - 100,117,108,101,46,32,82,97,105,115,101,32,90,105,112,73, - 109,112,111,114,116,69,114,114,111,114,10,32,32,32,32,32, - 32,32,32,105,102,32,116,104,101,32,109,111,100,117,108,101, - 32,99,111,117,108,100,110,39,116,32,98,101,32,102,111,117, - 110,100,44,32,114,101,116,117,114,110,32,78,111,110,101,32, - 105,102,32,116,104,101,32,97,114,99,104,105,118,101,32,100, - 111,101,115,10,32,32,32,32,32,32,32,32,99,111,110,116, - 97,105,110,32,116,104,101,32,109,111,100,117,108,101,44,32, - 98,117,116,32,104,97,115,32,110,111,32,115,111,117,114,99, - 101,32,102,111,114,32,105,116,46,10,32,32,32,32,32,32, - 32,32,78,250,18,99,97,110,39,116,32,102,105,110,100,32, - 109,111,100,117,108,101,32,169,1,218,4,110,97,109,101,250, - 11,95,95,105,110,105,116,95,95,46,112,121,250,3,46,112, - 121,41,10,114,35,0,0,0,114,3,0,0,0,114,36,0, - 0,0,114,21,0,0,0,114,30,0,0,0,114,28,0,0, - 0,114,26,0,0,0,114,52,0,0,0,114,29,0,0,0, - 218,6,100,101,99,111,100,101,41,6,114,32,0,0,0,114, - 38,0,0,0,114,39,0,0,0,114,13,0,0,0,218,8, - 102,117,108,108,112,97,116,104,114,54,0,0,0,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,218,10,103,101, - 116,95,115,111,117,114,99,101,195,0,0,0,115,24,0,0, - 0,0,7,10,1,8,1,18,2,10,1,4,1,14,2,10, - 2,2,1,14,1,12,2,8,1,122,22,122,105,112,105,109, - 112,111,114,116,101,114,46,103,101,116,95,115,111,117,114,99, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, - 0,0,4,0,0,0,67,0,0,0,115,40,0,0,0,116, - 0,124,0,124,1,131,2,125,2,124,2,100,1,117,0,114, - 36,116,1,100,2,124,1,155,2,157,2,124,1,100,3,141, - 2,130,1,124,2,83,0,41,4,122,171,105,115,95,112,97, - 99,107,97,103,101,40,102,117,108,108,110,97,109,101,41,32, - 45,62,32,98,111,111,108,46,10,10,32,32,32,32,32,32, - 32,32,82,101,116,117,114,110,32,84,114,117,101,32,105,102, - 32,116,104,101,32,109,111,100,117,108,101,32,115,112,101,99, - 105,102,105,101,100,32,98,121,32,102,117,108,108,110,97,109, - 101,32,105,115,32,97,32,112,97,99,107,97,103,101,46,10, - 32,32,32,32,32,32,32,32,82,97,105,115,101,32,90,105, - 112,73,109,112,111,114,116,69,114,114,111,114,32,105,102,32, - 116,104,101,32,109,111,100,117,108,101,32,99,111,117,108,100, - 110,39,116,32,98,101,32,102,111,117,110,100,46,10,32,32, - 32,32,32,32,32,32,78,114,57,0,0,0,114,58,0,0, - 0,41,2,114,35,0,0,0,114,3,0,0,0,41,3,114, - 32,0,0,0,114,38,0,0,0,114,39,0,0,0,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,10,105, - 115,95,112,97,99,107,97,103,101,221,0,0,0,115,8,0, - 0,0,0,6,10,1,8,1,18,1,122,22,122,105,112,105, - 109,112,111,114,116,101,114,46,105,115,95,112,97,99,107,97, - 103,101,99,2,0,0,0,0,0,0,0,0,0,0,0,8, - 0,0,0,8,0,0,0,67,0,0,0,115,246,0,0,0, - 116,0,124,0,124,1,131,2,92,3,125,2,125,3,125,4, - 116,1,106,2,160,3,124,1,161,1,125,5,124,5,100,1, - 117,0,115,46,116,4,124,5,116,5,131,2,115,64,116,5, - 124,1,131,1,125,5,124,5,116,1,106,2,124,1,60,0, - 124,0,124,5,95,6,122,84,124,3,114,108,116,7,124,0, - 124,1,131,2,125,6,116,8,160,9,124,0,106,10,124,6, - 161,2,125,7,124,7,103,1,124,5,95,11,116,12,124,5, - 100,2,131,2,115,124,116,13,124,5,95,13,116,8,160,14, - 124,5,106,15,124,1,124,4,161,3,1,0,116,16,124,2, - 124,5,106,15,131,2,1,0,87,0,110,22,1,0,1,0, - 1,0,116,1,106,2,124,1,61,0,130,0,89,0,110,2, - 48,0,122,14,116,1,106,2,124,1,25,0,125,5,87,0, - 110,34,4,0,116,17,121,226,1,0,1,0,1,0,116,18, - 100,3,124,1,155,2,100,4,157,3,131,1,130,1,89,0, - 110,2,48,0,116,19,160,20,100,5,124,1,124,4,161,3, - 1,0,124,5,83,0,41,6,122,245,108,111,97,100,95,109, - 111,100,117,108,101,40,102,117,108,108,110,97,109,101,41,32, - 45,62,32,109,111,100,117,108,101,46,10,10,32,32,32,32, - 32,32,32,32,76,111,97,100,32,116,104,101,32,109,111,100, - 117,108,101,32,115,112,101,99,105,102,105,101,100,32,98,121, - 32,39,102,117,108,108,110,97,109,101,39,46,32,39,102,117, - 108,108,110,97,109,101,39,32,109,117,115,116,32,98,101,32, - 116,104,101,10,32,32,32,32,32,32,32,32,102,117,108,108, - 121,32,113,117,97,108,105,102,105,101,100,32,40,100,111,116, - 116,101,100,41,32,109,111,100,117,108,101,32,110,97,109,101, - 46,32,73,116,32,114,101,116,117,114,110,115,32,116,104,101, - 32,105,109,112,111,114,116,101,100,10,32,32,32,32,32,32, - 32,32,109,111,100,117,108,101,44,32,111,114,32,114,97,105, - 115,101,115,32,90,105,112,73,109,112,111,114,116,69,114,114, - 111,114,32,105,102,32,105,116,32,119,97,115,110,39,116,32, - 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,78, - 218,12,95,95,98,117,105,108,116,105,110,115,95,95,122,14, - 76,111,97,100,101,100,32,109,111,100,117,108,101,32,122,25, - 32,110,111,116,32,102,111,117,110,100,32,105,110,32,115,121, - 115,46,109,111,100,117,108,101,115,122,30,105,109,112,111,114, - 116,32,123,125,32,35,32,108,111,97,100,101,100,32,102,114, - 111,109,32,90,105,112,32,123,125,41,21,114,44,0,0,0, - 218,3,115,121,115,218,7,109,111,100,117,108,101,115,218,3, - 103,101,116,114,15,0,0,0,218,12,95,109,111,100,117,108, - 101,95,116,121,112,101,218,10,95,95,108,111,97,100,101,114, - 95,95,114,36,0,0,0,114,21,0,0,0,114,30,0,0, - 0,114,29,0,0,0,90,8,95,95,112,97,116,104,95,95, - 218,7,104,97,115,97,116,116,114,114,66,0,0,0,90,14, - 95,102,105,120,95,117,112,95,109,111,100,117,108,101,218,8, - 95,95,100,105,99,116,95,95,218,4,101,120,101,99,114,26, - 0,0,0,218,11,73,109,112,111,114,116,69,114,114,111,114, - 218,10,95,98,111,111,116,115,116,114,97,112,218,16,95,118, - 101,114,98,111,115,101,95,109,101,115,115,97,103,101,41,8, - 114,32,0,0,0,114,38,0,0,0,114,46,0,0,0,114, - 47,0,0,0,114,40,0,0,0,90,3,109,111,100,114,13, - 0,0,0,114,63,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,11,108,111,97,100,95,109,111, - 100,117,108,101,234,0,0,0,115,48,0,0,0,0,7,16, - 1,12,1,18,1,8,1,10,1,6,2,2,1,4,3,10, - 1,14,1,8,2,10,1,6,1,16,1,16,1,6,1,8, - 1,8,2,2,1,14,1,12,1,22,1,14,1,122,23,122, - 105,112,105,109,112,111,114,116,101,114,46,108,111,97,100,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,8,0,0,0,67,0,0,0,115, - 86,0,0,0,122,20,124,0,160,0,124,1,161,1,115,18, - 87,0,100,1,83,0,87,0,110,20,4,0,116,1,121,40, - 1,0,1,0,1,0,89,0,100,1,83,0,48,0,116,2, - 106,3,115,76,100,2,100,3,108,4,109,5,125,2,1,0, - 124,2,160,6,116,2,161,1,1,0,100,4,116,2,95,3, - 116,2,124,0,124,1,131,2,83,0,41,5,122,204,82,101, - 116,117,114,110,32,116,104,101,32,82,101,115,111,117,114,99, - 101,82,101,97,100,101,114,32,102,111,114,32,97,32,112,97, - 99,107,97,103,101,32,105,110,32,97,32,122,105,112,32,102, - 105,108,101,46,10,10,32,32,32,32,32,32,32,32,73,102, - 32,39,102,117,108,108,110,97,109,101,39,32,105,115,32,97, - 32,112,97,99,107,97,103,101,32,119,105,116,104,105,110,32, - 116,104,101,32,122,105,112,32,102,105,108,101,44,32,114,101, - 116,117,114,110,32,116,104,101,10,32,32,32,32,32,32,32, - 32,39,82,101,115,111,117,114,99,101,82,101,97,100,101,114, - 39,32,111,98,106,101,99,116,32,102,111,114,32,116,104,101, - 32,112,97,99,107,97,103,101,46,32,32,79,116,104,101,114, - 119,105,115,101,32,114,101,116,117,114,110,32,78,111,110,101, - 46,10,32,32,32,32,32,32,32,32,78,114,0,0,0,0, - 41,1,218,14,82,101,115,111,117,114,99,101,82,101,97,100, - 101,114,84,41,7,114,65,0,0,0,114,3,0,0,0,218, - 24,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, - 114,99,101,82,101,97,100,101,114,218,11,95,114,101,103,105, - 115,116,101,114,101,100,90,13,105,109,112,111,114,116,108,105, - 98,46,97,98,99,114,79,0,0,0,90,8,114,101,103,105, - 115,116,101,114,41,3,114,32,0,0,0,114,38,0,0,0, - 114,79,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,218,19,103,101,116,95,114,101,115,111,117,114, - 99,101,95,114,101,97,100,101,114,16,1,0,0,115,20,0, - 0,0,0,6,2,1,10,1,10,1,12,1,8,1,6,1, - 12,1,10,1,6,1,122,31,122,105,112,105,109,112,111,114, - 116,101,114,46,103,101,116,95,114,101,115,111,117,114,99,101, - 95,114,101,97,100,101,114,99,1,0,0,0,0,0,0,0, - 0,0,0,0,1,0,0,0,5,0,0,0,67,0,0,0, - 115,24,0,0,0,100,1,124,0,106,0,155,0,116,1,155, - 0,124,0,106,2,155,0,100,2,157,5,83,0,41,3,78, - 122,21,60,122,105,112,105,109,112,111,114,116,101,114,32,111, - 98,106,101,99,116,32,34,122,2,34,62,41,3,114,29,0, - 0,0,114,20,0,0,0,114,31,0,0,0,41,1,114,32, - 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,8,95,95,114,101,112,114,95,95,34,1,0,0, - 115,2,0,0,0,0,1,122,20,122,105,112,105,109,112,111, - 114,116,101,114,46,95,95,114,101,112,114,95,95,41,1,78, - 41,1,78,41,15,114,6,0,0,0,114,7,0,0,0,114, - 8,0,0,0,218,7,95,95,100,111,99,95,95,114,34,0, - 0,0,114,41,0,0,0,114,42,0,0,0,114,48,0,0, - 0,114,55,0,0,0,114,56,0,0,0,114,64,0,0,0, - 114,65,0,0,0,114,78,0,0,0,114,82,0,0,0,114, - 83,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,4,0,0,0,45,0,0, - 0,115,24,0,0,0,8,1,4,17,8,46,10,32,10,12, - 8,10,8,21,8,11,8,26,8,13,8,38,8,18,122,12, - 95,95,105,110,105,116,95,95,46,112,121,99,84,114,60,0, - 0,0,70,41,3,122,4,46,112,121,99,84,70,41,3,114, - 61,0,0,0,70,70,99,2,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115, - 20,0,0,0,124,0,106,0,124,1,160,1,100,1,161,1, - 100,2,25,0,23,0,83,0,41,3,78,218,1,46,233,2, - 0,0,0,41,2,114,31,0,0,0,218,10,114,112,97,114, - 116,105,116,105,111,110,41,2,114,32,0,0,0,114,38,0, - 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,36,0,0,0,52,1,0,0,115,2,0,0,0,0, - 1,114,36,0,0,0,99,2,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,2,0,0,0,67,0,0,0,115, - 18,0,0,0,124,1,116,0,23,0,125,2,124,2,124,0, - 106,1,118,0,83,0,169,1,78,41,2,114,20,0,0,0, - 114,28,0,0,0,41,3,114,32,0,0,0,114,13,0,0, - 0,90,7,100,105,114,112,97,116,104,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,37,0,0,0,56,1, - 0,0,115,4,0,0,0,0,4,8,2,114,37,0,0,0, - 99,2,0,0,0,0,0,0,0,0,0,0,0,7,0,0, - 0,4,0,0,0,67,0,0,0,115,56,0,0,0,116,0, - 124,0,124,1,131,2,125,2,116,1,68,0,93,36,92,3, - 125,3,125,4,125,5,124,2,124,3,23,0,125,6,124,6, - 124,0,106,2,118,0,114,14,124,5,2,0,1,0,83,0, - 113,14,100,0,83,0,114,88,0,0,0,41,3,114,36,0, - 0,0,218,16,95,122,105,112,95,115,101,97,114,99,104,111, - 114,100,101,114,114,28,0,0,0,41,7,114,32,0,0,0, - 114,38,0,0,0,114,13,0,0,0,218,6,115,117,102,102, - 105,120,218,10,105,115,98,121,116,101,99,111,100,101,114,47, - 0,0,0,114,63,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,114,35,0,0,0,65,1,0,0, - 115,12,0,0,0,0,1,10,1,14,1,8,1,10,1,10, - 1,114,35,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,26,0,0,0,9,0,0,0,67,0,0,0,115, - 2,5,0,0,122,14,116,0,160,1,124,0,161,1,125,1, - 87,0,110,36,4,0,116,2,121,50,1,0,1,0,1,0, - 116,3,100,1,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,89,0,110,2,48,0,124,1,144,4,143,164,1,0, - 122,36,124,1,160,4,116,5,11,0,100,3,161,2,1,0, - 124,1,160,6,161,0,125,2,124,1,160,7,116,5,161,1, - 125,3,87,0,110,36,4,0,116,2,121,132,1,0,1,0, - 1,0,116,3,100,4,124,0,155,2,157,2,124,0,100,2, - 141,2,130,1,89,0,110,2,48,0,116,8,124,3,131,1, - 116,5,107,3,114,164,116,3,100,4,124,0,155,2,157,2, - 124,0,100,2,141,2,130,1,124,3,100,0,100,5,133,2, - 25,0,116,9,107,3,144,1,114,170,122,24,124,1,160,4, - 100,6,100,3,161,2,1,0,124,1,160,6,161,0,125,4, - 87,0,110,36,4,0,116,2,121,242,1,0,1,0,1,0, - 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,89,0,110,2,48,0,116,10,124,4,116,11,24,0, - 116,5,24,0,100,6,131,2,125,5,122,22,124,1,160,4, - 124,5,161,1,1,0,124,1,160,7,161,0,125,6,87,0, - 110,38,4,0,116,2,144,1,121,66,1,0,1,0,1,0, - 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,89,0,110,2,48,0,124,6,160,12,116,9,161,1, - 125,7,124,7,100,6,107,0,144,1,114,106,116,3,100,7, - 124,0,155,2,157,2,124,0,100,2,141,2,130,1,124,6, - 124,7,124,7,116,5,23,0,133,2,25,0,125,3,116,8, - 124,3,131,1,116,5,107,3,144,1,114,154,116,3,100,8, - 124,0,155,2,157,2,124,0,100,2,141,2,130,1,124,4, - 116,8,124,6,131,1,24,0,124,7,23,0,125,2,116,13, - 124,3,100,9,100,10,133,2,25,0,131,1,125,8,116,13, - 124,3,100,10,100,11,133,2,25,0,131,1,125,9,124,2, - 124,8,107,0,144,1,114,230,116,3,100,12,124,0,155,2, - 157,2,124,0,100,2,141,2,130,1,124,2,124,9,107,0, - 144,2,114,2,116,3,100,13,124,0,155,2,157,2,124,0, - 100,2,141,2,130,1,124,2,124,8,56,0,125,2,124,2, - 124,9,24,0,125,10,124,10,100,6,107,0,144,2,114,46, - 116,3,100,14,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,105,0,125,11,100,6,125,12,122,14,124,1,160,4, - 124,2,161,1,1,0,87,0,110,38,4,0,116,2,144,2, - 121,106,1,0,1,0,1,0,116,3,100,4,124,0,155,2, - 157,2,124,0,100,2,141,2,130,1,89,0,110,2,48,0, - 124,1,160,7,100,15,161,1,125,3,116,8,124,3,131,1, - 100,5,107,0,144,2,114,140,116,14,100,16,131,1,130,1, - 124,3,100,0,100,5,133,2,25,0,100,17,107,3,144,2, - 114,162,144,4,113,208,116,8,124,3,131,1,100,15,107,3, - 144,2,114,184,116,14,100,16,131,1,130,1,116,15,124,3, - 100,18,100,19,133,2,25,0,131,1,125,13,116,15,124,3, - 100,19,100,9,133,2,25,0,131,1,125,14,116,15,124,3, - 100,9,100,20,133,2,25,0,131,1,125,15,116,15,124,3, - 100,20,100,10,133,2,25,0,131,1,125,16,116,13,124,3, - 100,10,100,11,133,2,25,0,131,1,125,17,116,13,124,3, - 100,11,100,21,133,2,25,0,131,1,125,18,116,13,124,3, - 100,21,100,22,133,2,25,0,131,1,125,4,116,15,124,3, - 100,22,100,23,133,2,25,0,131,1,125,19,116,15,124,3, - 100,23,100,24,133,2,25,0,131,1,125,20,116,15,124,3, - 100,24,100,25,133,2,25,0,131,1,125,21,116,13,124,3, - 100,26,100,15,133,2,25,0,131,1,125,22,124,19,124,20, - 23,0,124,21,23,0,125,8,124,22,124,9,107,4,144,3, - 114,144,116,3,100,27,124,0,155,2,157,2,124,0,100,2, - 141,2,130,1,124,22,124,10,55,0,125,22,122,14,124,1, - 160,7,124,19,161,1,125,23,87,0,110,38,4,0,116,2, - 144,3,121,204,1,0,1,0,1,0,116,3,100,4,124,0, - 155,2,157,2,124,0,100,2,141,2,130,1,89,0,110,2, - 48,0,116,8,124,23,131,1,124,19,107,3,144,3,114,238, - 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,122,50,116,8,124,1,160,7,124,8,124,19,24,0, - 161,1,131,1,124,8,124,19,24,0,107,3,144,4,114,30, - 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, - 130,1,87,0,110,38,4,0,116,2,144,4,121,70,1,0, - 1,0,1,0,116,3,100,4,124,0,155,2,157,2,124,0, - 100,2,141,2,130,1,89,0,110,2,48,0,124,13,100,28, - 64,0,144,4,114,92,124,23,160,16,161,0,125,23,110,52, - 122,14,124,23,160,16,100,29,161,1,125,23,87,0,110,36, - 4,0,116,17,144,4,121,142,1,0,1,0,1,0,124,23, - 160,16,100,30,161,1,160,18,116,19,161,1,125,23,89,0, - 110,2,48,0,124,23,160,20,100,31,116,21,161,2,125,23, - 116,22,160,23,124,0,124,23,161,2,125,24,124,24,124,14, - 124,18,124,4,124,22,124,15,124,16,124,17,102,8,125,25, - 124,25,124,11,124,23,60,0,124,12,100,32,55,0,125,12, - 144,2,113,108,87,0,100,0,4,0,4,0,131,3,1,0, - 110,18,49,0,144,4,115,230,48,0,1,0,1,0,1,0, - 89,0,1,0,116,24,160,25,100,33,124,12,124,0,161,3, - 1,0,124,11,83,0,41,34,78,122,21,99,97,110,39,116, - 32,111,112,101,110,32,90,105,112,32,102,105,108,101,58,32, - 114,12,0,0,0,114,86,0,0,0,250,21,99,97,110,39, - 116,32,114,101,97,100,32,90,105,112,32,102,105,108,101,58, - 32,233,4,0,0,0,114,0,0,0,0,122,16,110,111,116, - 32,97,32,90,105,112,32,102,105,108,101,58,32,122,18,99, - 111,114,114,117,112,116,32,90,105,112,32,102,105,108,101,58, - 32,233,12,0,0,0,233,16,0,0,0,233,20,0,0,0, - 122,28,98,97,100,32,99,101,110,116,114,97,108,32,100,105, - 114,101,99,116,111,114,121,32,115,105,122,101,58,32,122,30, - 98,97,100,32,99,101,110,116,114,97,108,32,100,105,114,101, - 99,116,111,114,121,32,111,102,102,115,101,116,58,32,122,38, - 98,97,100,32,99,101,110,116,114,97,108,32,100,105,114,101, - 99,116,111,114,121,32,115,105,122,101,32,111,114,32,111,102, - 102,115,101,116,58,32,233,46,0,0,0,250,27,69,79,70, - 32,114,101,97,100,32,119,104,101,114,101,32,110,111,116,32, - 101,120,112,101,99,116,101,100,115,4,0,0,0,80,75,1, - 2,233,8,0,0,0,233,10,0,0,0,233,14,0,0,0, - 233,24,0,0,0,233,28,0,0,0,233,30,0,0,0,233, - 32,0,0,0,233,34,0,0,0,233,42,0,0,0,122,25, - 98,97,100,32,108,111,99,97,108,32,104,101,97,100,101,114, - 32,111,102,102,115,101,116,58,32,105,0,8,0,0,218,5, - 97,115,99,105,105,90,6,108,97,116,105,110,49,250,1,47, - 114,5,0,0,0,122,33,122,105,112,105,109,112,111,114,116, - 58,32,102,111,117,110,100,32,123,125,32,110,97,109,101,115, - 32,105,110,32,123,33,114,125,41,26,218,3,95,105,111,218, - 9,111,112,101,110,95,99,111,100,101,114,22,0,0,0,114, - 3,0,0,0,218,4,115,101,101,107,218,20,69,78,68,95, - 67,69,78,84,82,65,76,95,68,73,82,95,83,73,90,69, - 90,4,116,101,108,108,218,4,114,101,97,100,114,51,0,0, - 0,218,18,83,84,82,73,78,71,95,69,78,68,95,65,82, - 67,72,73,86,69,218,3,109,97,120,218,15,77,65,88,95, - 67,79,77,77,69,78,84,95,76,69,78,218,5,114,102,105, - 110,100,114,2,0,0,0,218,8,69,79,70,69,114,114,111, - 114,114,1,0,0,0,114,62,0,0,0,218,18,85,110,105, - 99,111,100,101,68,101,99,111,100,101,69,114,114,111,114,218, - 9,116,114,97,110,115,108,97,116,101,218,11,99,112,52,51, - 55,95,116,97,98,108,101,114,19,0,0,0,114,20,0,0, - 0,114,21,0,0,0,114,30,0,0,0,114,76,0,0,0, - 114,77,0,0,0,41,26,114,29,0,0,0,218,2,102,112, - 90,15,104,101,97,100,101,114,95,112,111,115,105,116,105,111, - 110,218,6,98,117,102,102,101,114,218,9,102,105,108,101,95, - 115,105,122,101,90,17,109,97,120,95,99,111,109,109,101,110, - 116,95,115,116,97,114,116,218,4,100,97,116,97,90,3,112, - 111,115,218,11,104,101,97,100,101,114,95,115,105,122,101,90, - 13,104,101,97,100,101,114,95,111,102,102,115,101,116,90,10, - 97,114,99,95,111,102,102,115,101,116,114,33,0,0,0,218, - 5,99,111,117,110,116,218,5,102,108,97,103,115,218,8,99, - 111,109,112,114,101,115,115,218,4,116,105,109,101,218,4,100, - 97,116,101,218,3,99,114,99,218,9,100,97,116,97,95,115, - 105,122,101,218,9,110,97,109,101,95,115,105,122,101,218,10, - 101,120,116,114,97,95,115,105,122,101,90,12,99,111,109,109, - 101,110,116,95,115,105,122,101,218,11,102,105,108,101,95,111, - 102,102,115,101,116,114,59,0,0,0,114,13,0,0,0,218, - 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,27,0,0,0,96,1,0,0,115,212,0,0,0,0, - 1,2,1,14,1,12,1,24,2,8,1,2,1,14,1,8, - 1,14,1,12,1,24,1,12,1,18,1,18,3,2,1,12, - 1,12,1,12,1,10,1,2,255,12,2,8,1,2,255,2, - 1,2,255,4,2,2,1,10,1,12,1,14,1,10,1,2, - 255,12,2,10,1,10,1,10,1,2,255,6,2,16,1,14, - 1,10,1,2,255,6,2,16,2,16,1,16,1,10,1,18, - 1,10,1,18,1,8,1,8,1,10,1,18,2,4,2,4, - 1,2,1,14,1,14,1,24,2,10,1,14,1,8,2,18, - 1,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, - 1,18,1,8,2,2,1,14,1,14,1,24,1,14,1,18, - 4,2,1,28,1,22,1,14,1,24,2,10,2,10,3,2, - 1,14,1,14,1,22,2,12,1,12,1,20,1,8,1,44, - 1,14,1,114,27,0,0,0,117,190,1,0,0,0,1,2, - 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, - 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34, - 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50, - 51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66, - 67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82, - 83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98, - 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114, - 115,116,117,118,119,120,121,122,123,124,125,126,127,195,135,195, - 188,195,169,195,162,195,164,195,160,195,165,195,167,195,170,195, - 171,195,168,195,175,195,174,195,172,195,132,195,133,195,137,195, - 166,195,134,195,180,195,182,195,178,195,187,195,185,195,191,195, - 150,195,156,194,162,194,163,194,165,226,130,167,198,146,195,161, - 195,173,195,179,195,186,195,177,195,145,194,170,194,186,194,191, - 226,140,144,194,172,194,189,194,188,194,161,194,171,194,187,226, - 150,145,226,150,146,226,150,147,226,148,130,226,148,164,226,149, - 161,226,149,162,226,149,150,226,149,149,226,149,163,226,149,145, - 226,149,151,226,149,157,226,149,156,226,149,155,226,148,144,226, - 148,148,226,148,180,226,148,172,226,148,156,226,148,128,226,148, - 188,226,149,158,226,149,159,226,149,154,226,149,148,226,149,169, - 226,149,166,226,149,160,226,149,144,226,149,172,226,149,167,226, - 149,168,226,149,164,226,149,165,226,149,153,226,149,152,226,149, - 146,226,149,147,226,149,171,226,149,170,226,148,152,226,148,140, - 226,150,136,226,150,132,226,150,140,226,150,144,226,150,128,206, - 177,195,159,206,147,207,128,206,163,207,131,194,181,207,132,206, - 166,206,152,206,169,206,180,226,136,158,207,134,206,181,226,136, - 169,226,137,161,194,177,226,137,165,226,137,164,226,140,160,226, - 140,161,195,183,226,137,136,194,176,226,136,153,194,183,226,136, - 154,226,129,191,194,178,226,150,160,194,160,99,0,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0, - 67,0,0,0,115,110,0,0,0,116,0,114,22,116,1,160, - 2,100,1,161,1,1,0,116,3,100,2,131,1,130,1,100, - 3,97,0,122,62,122,16,100,4,100,5,108,4,109,5,125, - 0,1,0,87,0,110,36,4,0,116,6,121,80,1,0,1, - 0,1,0,116,1,160,2,100,1,161,1,1,0,116,3,100, - 2,131,1,130,1,89,0,110,2,48,0,87,0,100,6,97, - 0,110,6,100,6,97,0,48,0,116,1,160,2,100,7,161, - 1,1,0,124,0,83,0,41,8,78,122,27,122,105,112,105, - 109,112,111,114,116,58,32,122,108,105,98,32,85,78,65,86, - 65,73,76,65,66,76,69,250,41,99,97,110,39,116,32,100, - 101,99,111,109,112,114,101,115,115,32,100,97,116,97,59,32, - 122,108,105,98,32,110,111,116,32,97,118,97,105,108,97,98, - 108,101,84,114,0,0,0,0,169,1,218,10,100,101,99,111, - 109,112,114,101,115,115,70,122,25,122,105,112,105,109,112,111, - 114,116,58,32,122,108,105,98,32,97,118,97,105,108,97,98, - 108,101,41,7,218,15,95,105,109,112,111,114,116,105,110,103, - 95,122,108,105,98,114,76,0,0,0,114,77,0,0,0,114, - 3,0,0,0,90,4,122,108,105,98,114,141,0,0,0,218, - 9,69,120,99,101,112,116,105,111,110,114,140,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,20, - 95,103,101,116,95,100,101,99,111,109,112,114,101,115,115,95, - 102,117,110,99,254,1,0,0,115,24,0,0,0,0,2,4, - 3,10,1,8,2,4,1,4,1,16,1,12,1,10,1,16, - 2,12,2,10,1,114,144,0,0,0,99,2,0,0,0,0, - 0,0,0,0,0,0,0,17,0,0,0,9,0,0,0,67, - 0,0,0,115,144,1,0,0,124,1,92,8,125,2,125,3, - 125,4,125,5,125,6,125,7,125,8,125,9,124,4,100,1, - 107,0,114,36,116,0,100,2,131,1,130,1,116,1,160,2, - 124,0,161,1,144,1,143,14,125,10,122,14,124,10,160,3, - 124,6,161,1,1,0,87,0,110,36,4,0,116,4,121,100, - 1,0,1,0,1,0,116,0,100,3,124,0,155,2,157,2, - 124,0,100,4,141,2,130,1,89,0,110,2,48,0,124,10, - 160,5,100,5,161,1,125,11,116,6,124,11,131,1,100,5, - 107,3,114,132,116,7,100,6,131,1,130,1,124,11,100,0, - 100,7,133,2,25,0,100,8,107,3,114,166,116,0,100,9, - 124,0,155,2,157,2,124,0,100,4,141,2,130,1,116,8, - 124,11,100,10,100,11,133,2,25,0,131,1,125,12,116,8, - 124,11,100,11,100,5,133,2,25,0,131,1,125,13,100,5, - 124,12,23,0,124,13,23,0,125,14,124,6,124,14,55,0, - 125,6,122,14,124,10,160,3,124,6,161,1,1,0,87,0, - 110,38,4,0,116,4,144,1,121,14,1,0,1,0,1,0, - 116,0,100,3,124,0,155,2,157,2,124,0,100,4,141,2, - 130,1,89,0,110,2,48,0,124,10,160,5,124,4,161,1, - 125,15,116,6,124,15,131,1,124,4,107,3,144,1,114,48, - 116,4,100,12,131,1,130,1,87,0,100,0,4,0,4,0, - 131,3,1,0,110,18,49,0,144,1,115,70,48,0,1,0, - 1,0,1,0,89,0,1,0,124,3,100,1,107,2,144,1, - 114,94,124,15,83,0,122,10,116,9,131,0,125,16,87,0, - 110,28,4,0,116,10,144,1,121,132,1,0,1,0,1,0, - 116,0,100,13,131,1,130,1,89,0,110,2,48,0,124,16, - 124,15,100,14,131,2,83,0,41,15,78,114,0,0,0,0, - 122,18,110,101,103,97,116,105,118,101,32,100,97,116,97,32, - 115,105,122,101,114,92,0,0,0,114,12,0,0,0,114,104, - 0,0,0,114,98,0,0,0,114,93,0,0,0,115,4,0, - 0,0,80,75,3,4,122,23,98,97,100,32,108,111,99,97, - 108,32,102,105,108,101,32,104,101,97,100,101,114,58,32,233, - 26,0,0,0,114,103,0,0,0,122,26,122,105,112,105,109, - 112,111,114,116,58,32,99,97,110,39,116,32,114,101,97,100, - 32,100,97,116,97,114,139,0,0,0,105,241,255,255,255,41, - 11,114,3,0,0,0,114,110,0,0,0,114,111,0,0,0, - 114,112,0,0,0,114,22,0,0,0,114,114,0,0,0,114, - 51,0,0,0,114,119,0,0,0,114,1,0,0,0,114,144, - 0,0,0,114,143,0,0,0,41,17,114,29,0,0,0,114, - 54,0,0,0,90,8,100,97,116,97,112,97,116,104,114,130, - 0,0,0,114,134,0,0,0,114,125,0,0,0,114,137,0, - 0,0,114,131,0,0,0,114,132,0,0,0,114,133,0,0, - 0,114,123,0,0,0,114,124,0,0,0,114,135,0,0,0, - 114,136,0,0,0,114,127,0,0,0,90,8,114,97,119,95, - 100,97,116,97,114,141,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,52,0,0,0,19,2,0, - 0,115,62,0,0,0,0,1,20,1,8,1,8,2,14,2, - 2,1,14,1,12,1,24,1,10,1,12,1,8,2,16,2, - 18,2,16,1,16,1,12,1,8,1,2,1,14,1,14,1, - 24,1,10,1,14,1,40,2,10,2,4,3,2,1,10,1, - 14,1,14,1,114,52,0,0,0,99,2,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,16,0,0,0,116,0,124,0,124,1,24,0,131, - 1,100,1,107,1,83,0,41,2,78,114,5,0,0,0,41, - 1,218,3,97,98,115,41,2,90,2,116,49,90,2,116,50, - 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, - 9,95,101,113,95,109,116,105,109,101,65,2,0,0,115,2, - 0,0,0,0,2,114,147,0,0,0,99,5,0,0,0,0, - 0,0,0,0,0,0,0,14,0,0,0,8,0,0,0,67, - 0,0,0,115,56,1,0,0,124,3,124,2,100,1,156,2, - 125,5,122,18,116,0,160,1,124,4,124,3,124,5,161,3, - 125,6,87,0,110,20,4,0,116,2,121,48,1,0,1,0, - 1,0,89,0,100,0,83,0,48,0,124,6,100,2,64,0, - 100,3,107,3,125,7,124,7,114,178,124,6,100,4,64,0, - 100,3,107,3,125,8,116,3,106,4,100,5,107,3,114,176, - 124,8,115,102,116,3,106,4,100,6,107,2,114,176,116,5, - 124,0,124,2,131,2,125,9,124,9,100,0,117,1,114,176, - 116,3,160,6,116,0,106,7,124,9,161,2,125,10,122,20, - 116,0,160,8,124,4,124,10,124,3,124,5,161,4,1,0, - 87,0,110,20,4,0,116,2,121,174,1,0,1,0,1,0, - 89,0,100,0,83,0,48,0,110,84,116,9,124,0,124,2, - 131,2,92,2,125,11,125,12,124,11,144,1,114,6,116,10, - 116,11,124,4,100,7,100,8,133,2,25,0,131,1,124,11, - 131,2,114,242,116,11,124,4,100,8,100,9,133,2,25,0, - 131,1,124,12,107,3,144,1,114,6,116,12,160,13,100,10, - 124,3,155,2,157,2,161,1,1,0,100,0,83,0,116,14, - 160,15,124,4,100,9,100,0,133,2,25,0,161,1,125,13, - 116,16,124,13,116,17,131,2,144,1,115,52,116,18,100,11, - 124,1,155,2,100,12,157,3,131,1,130,1,124,13,83,0, - 41,13,78,41,2,114,59,0,0,0,114,13,0,0,0,114, - 5,0,0,0,114,0,0,0,0,114,86,0,0,0,90,5, - 110,101,118,101,114,90,6,97,108,119,97,121,115,114,99,0, - 0,0,114,94,0,0,0,114,95,0,0,0,122,22,98,121, - 116,101,99,111,100,101,32,105,115,32,115,116,97,108,101,32, - 102,111,114,32,122,16,99,111,109,112,105,108,101,100,32,109, - 111,100,117,108,101,32,122,21,32,105,115,32,110,111,116,32, - 97,32,99,111,100,101,32,111,98,106,101,99,116,41,19,114, - 21,0,0,0,90,13,95,99,108,97,115,115,105,102,121,95, - 112,121,99,114,75,0,0,0,218,4,95,105,109,112,90,21, - 99,104,101,99,107,95,104,97,115,104,95,98,97,115,101,100, - 95,112,121,99,115,218,15,95,103,101,116,95,112,121,99,95, - 115,111,117,114,99,101,218,11,115,111,117,114,99,101,95,104, - 97,115,104,90,17,95,82,65,87,95,77,65,71,73,67,95, - 78,85,77,66,69,82,90,18,95,118,97,108,105,100,97,116, - 101,95,104,97,115,104,95,112,121,99,218,29,95,103,101,116, - 95,109,116,105,109,101,95,97,110,100,95,115,105,122,101,95, - 111,102,95,115,111,117,114,99,101,114,147,0,0,0,114,2, - 0,0,0,114,76,0,0,0,114,77,0,0,0,218,7,109, - 97,114,115,104,97,108,90,5,108,111,97,100,115,114,15,0, - 0,0,218,10,95,99,111,100,101,95,116,121,112,101,218,9, - 84,121,112,101,69,114,114,111,114,41,14,114,32,0,0,0, - 114,53,0,0,0,114,63,0,0,0,114,38,0,0,0,114, - 126,0,0,0,90,11,101,120,99,95,100,101,116,97,105,108, - 115,114,129,0,0,0,90,10,104,97,115,104,95,98,97,115, - 101,100,90,12,99,104,101,99,107,95,115,111,117,114,99,101, - 90,12,115,111,117,114,99,101,95,98,121,116,101,115,114,150, - 0,0,0,90,12,115,111,117,114,99,101,95,109,116,105,109, - 101,90,11,115,111,117,114,99,101,95,115,105,122,101,114,46, - 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,15,95,117,110,109,97,114,115,104,97,108,95,99, - 111,100,101,75,2,0,0,115,82,0,0,0,0,2,2,1, - 2,254,6,5,2,1,18,1,12,1,8,2,12,1,4,1, - 12,1,10,1,2,255,2,1,8,255,2,2,10,1,8,1, - 4,1,4,1,2,254,4,5,2,1,4,1,8,255,8,2, - 12,1,10,3,8,255,6,3,6,3,22,1,18,255,4,2, - 4,1,8,255,4,2,4,2,18,1,12,1,16,1,114,155, - 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 1,0,0,0,4,0,0,0,67,0,0,0,115,28,0,0, - 0,124,0,160,0,100,1,100,2,161,2,125,0,124,0,160, - 0,100,3,100,2,161,2,125,0,124,0,83,0,41,4,78, - 115,2,0,0,0,13,10,243,1,0,0,0,10,243,1,0, - 0,0,13,41,1,114,19,0,0,0,41,1,218,6,115,111, - 117,114,99,101,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,218,23,95,110,111,114,109,97,108,105,122,101,95, - 108,105,110,101,95,101,110,100,105,110,103,115,126,2,0,0, - 115,6,0,0,0,0,1,12,1,12,1,114,159,0,0,0, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,6,0,0,0,67,0,0,0,115,24,0,0,0,116,0, - 124,1,131,1,125,1,116,1,124,1,124,0,100,1,100,2, - 100,3,141,4,83,0,41,4,78,114,74,0,0,0,84,41, - 1,90,12,100,111,110,116,95,105,110,104,101,114,105,116,41, - 2,114,159,0,0,0,218,7,99,111,109,112,105,108,101,41, - 2,114,53,0,0,0,114,158,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,15,95,99,111,109, - 112,105,108,101,95,115,111,117,114,99,101,133,2,0,0,115, - 4,0,0,0,0,1,8,1,114,161,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,11,0, - 0,0,67,0,0,0,115,68,0,0,0,116,0,160,1,124, - 0,100,1,63,0,100,2,23,0,124,0,100,3,63,0,100, - 4,64,0,124,0,100,5,64,0,124,1,100,6,63,0,124, - 1,100,3,63,0,100,7,64,0,124,1,100,5,64,0,100, - 8,20,0,100,9,100,9,100,9,102,9,161,1,83,0,41, - 10,78,233,9,0,0,0,105,188,7,0,0,233,5,0,0, - 0,233,15,0,0,0,233,31,0,0,0,233,11,0,0,0, - 233,63,0,0,0,114,86,0,0,0,114,14,0,0,0,41, - 2,114,131,0,0,0,90,6,109,107,116,105,109,101,41,2, - 218,1,100,114,138,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,14,95,112,97,114,115,101,95, - 100,111,115,116,105,109,101,139,2,0,0,115,18,0,0,0, - 0,1,4,1,10,1,10,1,6,1,6,1,10,1,10,1, - 6,249,114,169,0,0,0,99,2,0,0,0,0,0,0,0, - 0,0,0,0,6,0,0,0,10,0,0,0,67,0,0,0, - 115,114,0,0,0,122,82,124,1,100,1,100,0,133,2,25, - 0,100,2,118,0,115,22,74,0,130,1,124,1,100,0,100, - 1,133,2,25,0,125,1,124,0,106,0,124,1,25,0,125, - 2,124,2,100,3,25,0,125,3,124,2,100,4,25,0,125, - 4,124,2,100,5,25,0,125,5,116,1,124,4,124,3,131, - 2,124,5,102,2,87,0,83,0,4,0,116,2,116,3,116, - 4,102,3,121,108,1,0,1,0,1,0,89,0,100,6,83, - 0,48,0,100,0,83,0,41,7,78,114,14,0,0,0,169, - 2,218,1,99,218,1,111,114,163,0,0,0,233,6,0,0, - 0,233,3,0,0,0,41,2,114,0,0,0,0,114,0,0, - 0,0,41,5,114,28,0,0,0,114,169,0,0,0,114,26, - 0,0,0,218,10,73,110,100,101,120,69,114,114,111,114,114, - 154,0,0,0,41,6,114,32,0,0,0,114,13,0,0,0, - 114,54,0,0,0,114,131,0,0,0,114,132,0,0,0,90, - 17,117,110,99,111,109,112,114,101,115,115,101,100,95,115,105, - 122,101,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,151,0,0,0,152,2,0,0,115,20,0,0,0,0, - 1,2,2,20,1,12,1,10,3,8,1,8,1,8,1,16, - 1,18,1,114,151,0,0,0,99,2,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,8,0,0,0,67,0,0, - 0,115,84,0,0,0,124,1,100,1,100,0,133,2,25,0, - 100,2,118,0,115,20,74,0,130,1,124,1,100,0,100,1, - 133,2,25,0,125,1,122,14,124,0,106,0,124,1,25,0, - 125,2,87,0,110,20,4,0,116,1,121,66,1,0,1,0, - 1,0,89,0,100,0,83,0,48,0,116,2,124,0,106,3, - 124,2,131,2,83,0,100,0,83,0,41,3,78,114,14,0, - 0,0,114,170,0,0,0,41,4,114,28,0,0,0,114,26, - 0,0,0,114,52,0,0,0,114,29,0,0,0,41,3,114, - 32,0,0,0,114,13,0,0,0,114,54,0,0,0,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,114,149,0, - 0,0,171,2,0,0,115,14,0,0,0,0,2,20,1,12, - 2,2,1,14,1,12,1,8,2,114,149,0,0,0,99,2, - 0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,9, - 0,0,0,67,0,0,0,115,196,0,0,0,116,0,124,0, - 124,1,131,2,125,2,116,1,68,0,93,158,92,3,125,3, - 125,4,125,5,124,2,124,3,23,0,125,6,116,2,106,3, - 100,1,124,0,106,4,116,5,124,6,100,2,100,3,141,5, - 1,0,122,14,124,0,106,6,124,6,25,0,125,7,87,0, - 110,18,4,0,116,7,121,86,1,0,1,0,1,0,89,0, - 113,14,48,0,124,7,100,4,25,0,125,8,116,8,124,0, - 106,4,124,7,131,2,125,9,124,4,114,130,116,9,124,0, - 124,8,124,6,124,1,124,9,131,5,125,10,110,10,116,10, - 124,8,124,9,131,2,125,10,124,10,100,0,117,0,114,150, - 113,14,124,7,100,4,25,0,125,8,124,10,124,5,124,8, - 102,3,2,0,1,0,83,0,113,14,116,11,100,5,124,1, - 155,2,157,2,124,1,100,6,141,2,130,1,100,0,83,0, - 41,7,78,122,13,116,114,121,105,110,103,32,123,125,123,125, - 123,125,114,86,0,0,0,41,1,90,9,118,101,114,98,111, - 115,105,116,121,114,0,0,0,0,114,57,0,0,0,114,58, - 0,0,0,41,12,114,36,0,0,0,114,89,0,0,0,114, - 76,0,0,0,114,77,0,0,0,114,29,0,0,0,114,20, - 0,0,0,114,28,0,0,0,114,26,0,0,0,114,52,0, - 0,0,114,155,0,0,0,114,161,0,0,0,114,3,0,0, - 0,41,11,114,32,0,0,0,114,38,0,0,0,114,13,0, - 0,0,114,90,0,0,0,114,91,0,0,0,114,47,0,0, - 0,114,63,0,0,0,114,54,0,0,0,114,40,0,0,0, - 114,126,0,0,0,114,46,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,44,0,0,0,186,2, - 0,0,115,36,0,0,0,0,1,10,1,14,1,8,1,22, - 1,2,1,14,1,12,1,6,2,8,1,12,1,4,1,18, - 2,10,1,8,3,2,1,8,1,16,2,114,44,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,64,0,0,0,115,60,0,0,0,101,0, - 90,1,100,0,90,2,100,1,90,3,100,2,90,4,100,3, - 100,4,132,0,90,5,100,5,100,6,132,0,90,6,100,7, - 100,8,132,0,90,7,100,9,100,10,132,0,90,8,100,11, - 100,12,132,0,90,9,100,13,83,0,41,14,114,80,0,0, - 0,122,165,80,114,105,118,97,116,101,32,99,108,97,115,115, - 32,117,115,101,100,32,116,111,32,115,117,112,112,111,114,116, - 32,90,105,112,73,109,112,111,114,116,46,103,101,116,95,114, - 101,115,111,117,114,99,101,95,114,101,97,100,101,114,40,41, - 46,10,10,32,32,32,32,84,104,105,115,32,99,108,97,115, - 115,32,105,115,32,97,108,108,111,119,101,100,32,116,111,32, - 114,101,102,101,114,101,110,99,101,32,97,108,108,32,116,104, - 101,32,105,110,110,97,114,100,115,32,97,110,100,32,112,114, - 105,118,97,116,101,32,112,97,114,116,115,32,111,102,10,32, - 32,32,32,116,104,101,32,122,105,112,105,109,112,111,114,116, - 101,114,46,10,32,32,32,32,70,99,3,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,0, - 0,0,115,16,0,0,0,124,1,124,0,95,0,124,2,124, - 0,95,1,100,0,83,0,114,88,0,0,0,41,2,114,4, - 0,0,0,114,38,0,0,0,41,3,114,32,0,0,0,114, - 4,0,0,0,114,38,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,34,0,0,0,220,2,0, - 0,115,4,0,0,0,0,1,6,1,122,33,95,90,105,112, - 73,109,112,111,114,116,82,101,115,111,117,114,99,101,82,101, - 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, - 0,0,0,0,0,0,0,0,0,0,5,0,0,0,8,0, - 0,0,67,0,0,0,115,90,0,0,0,124,0,106,0,160, - 1,100,1,100,2,161,2,125,2,124,2,155,0,100,2,124, - 1,155,0,157,3,125,3,100,3,100,4,108,2,109,3,125, - 4,1,0,122,18,124,4,124,0,106,4,160,5,124,3,161, - 1,131,1,87,0,83,0,4,0,116,6,121,84,1,0,1, - 0,1,0,116,7,124,3,131,1,130,1,89,0,110,2,48, - 0,100,0,83,0,41,5,78,114,85,0,0,0,114,109,0, - 0,0,114,0,0,0,0,41,1,218,7,66,121,116,101,115, - 73,79,41,8,114,38,0,0,0,114,19,0,0,0,90,2, - 105,111,114,176,0,0,0,114,4,0,0,0,114,55,0,0, - 0,114,22,0,0,0,218,17,70,105,108,101,78,111,116,70, - 111,117,110,100,69,114,114,111,114,41,5,114,32,0,0,0, - 218,8,114,101,115,111,117,114,99,101,218,16,102,117,108,108, - 110,97,109,101,95,97,115,95,112,97,116,104,114,13,0,0, - 0,114,176,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,13,111,112,101,110,95,114,101,115,111, - 117,114,99,101,224,2,0,0,115,14,0,0,0,0,1,14, - 1,14,1,12,1,2,1,18,1,12,1,122,38,95,90,105, - 112,73,109,112,111,114,116,82,101,115,111,117,114,99,101,82, - 101,97,100,101,114,46,111,112,101,110,95,114,101,115,111,117, - 114,99,101,99,2,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, - 0,116,0,130,1,100,0,83,0,114,88,0,0,0,41,1, - 114,177,0,0,0,41,2,114,32,0,0,0,114,178,0,0, - 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 218,13,114,101,115,111,117,114,99,101,95,112,97,116,104,233, - 2,0,0,115,2,0,0,0,0,4,122,38,95,90,105,112, - 73,109,112,111,114,116,82,101,115,111,117,114,99,101,82,101, - 97,100,101,114,46,114,101,115,111,117,114,99,101,95,112,97, - 116,104,99,2,0,0,0,0,0,0,0,0,0,0,0,4, - 0,0,0,8,0,0,0,67,0,0,0,115,70,0,0,0, - 124,0,106,0,160,1,100,1,100,2,161,2,125,2,124,2, - 155,0,100,2,124,1,155,0,157,3,125,3,122,16,124,0, - 106,2,160,3,124,3,161,1,1,0,87,0,110,20,4,0, - 116,4,121,64,1,0,1,0,1,0,89,0,100,3,83,0, - 48,0,100,4,83,0,41,5,78,114,85,0,0,0,114,109, - 0,0,0,70,84,41,5,114,38,0,0,0,114,19,0,0, - 0,114,4,0,0,0,114,55,0,0,0,114,22,0,0,0, - 41,4,114,32,0,0,0,114,59,0,0,0,114,179,0,0, - 0,114,13,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,11,105,115,95,114,101,115,111,117,114, - 99,101,239,2,0,0,115,14,0,0,0,0,3,14,1,14, - 1,2,1,16,1,12,1,8,1,122,36,95,90,105,112,73, - 109,112,111,114,116,82,101,115,111,117,114,99,101,82,101,97, - 100,101,114,46,105,115,95,114,101,115,111,117,114,99,101,99, - 1,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, - 9,0,0,0,99,0,0,0,115,184,0,0,0,100,1,100, - 2,108,0,109,1,125,1,1,0,124,1,124,0,106,2,160, - 3,124,0,106,4,161,1,131,1,125,2,124,2,160,5,124, - 0,106,2,106,6,161,1,125,3,124,3,106,7,100,3,107, - 2,115,58,74,0,130,1,124,3,106,8,125,4,116,9,131, - 0,125,5,124,0,106,2,106,10,68,0,93,100,125,6,122, - 18,124,1,124,6,131,1,160,5,124,4,161,1,125,7,87, - 0,110,22,4,0,116,11,121,122,1,0,1,0,1,0,89, - 0,113,78,89,0,110,2,48,0,124,7,106,8,106,7,125, - 8,116,12,124,8,131,1,100,1,107,2,114,154,124,7,106, - 7,86,0,1,0,113,78,124,8,124,5,118,1,114,78,124, - 5,160,13,124,8,161,1,1,0,124,8,86,0,1,0,113, - 78,100,0,83,0,41,4,78,114,0,0,0,0,41,1,218, - 4,80,97,116,104,114,60,0,0,0,41,14,90,7,112,97, - 116,104,108,105,98,114,183,0,0,0,114,4,0,0,0,114, - 56,0,0,0,114,38,0,0,0,90,11,114,101,108,97,116, - 105,118,101,95,116,111,114,29,0,0,0,114,59,0,0,0, - 90,6,112,97,114,101,110,116,218,3,115,101,116,114,28,0, - 0,0,114,23,0,0,0,114,51,0,0,0,218,3,97,100, - 100,41,9,114,32,0,0,0,114,183,0,0,0,90,13,102, - 117,108,108,110,97,109,101,95,112,97,116,104,90,13,114,101, - 108,97,116,105,118,101,95,112,97,116,104,90,12,112,97,99, - 107,97,103,101,95,112,97,116,104,90,12,115,117,98,100,105, - 114,115,95,115,101,101,110,218,8,102,105,108,101,110,97,109, - 101,90,8,114,101,108,97,116,105,118,101,90,11,112,97,114, - 101,110,116,95,110,97,109,101,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,8,99,111,110,116,101,110,116, - 115,250,2,0,0,115,34,0,0,0,0,8,12,1,18,1, - 14,3,14,1,6,1,6,1,12,1,2,1,18,1,12,1, - 10,5,8,1,12,1,10,1,8,1,10,1,122,33,95,90, - 105,112,73,109,112,111,114,116,82,101,115,111,117,114,99,101, - 82,101,97,100,101,114,46,99,111,110,116,101,110,116,115,78, - 41,10,114,6,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,84,0,0,0,114,81,0,0,0,114,34,0,0,0, - 114,180,0,0,0,114,181,0,0,0,114,182,0,0,0,114, - 187,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,80,0,0,0,212,2,0, - 0,115,14,0,0,0,8,1,4,5,4,2,8,4,8,9, - 8,6,8,11,114,80,0,0,0,41,45,114,84,0,0,0, - 90,26,95,102,114,111,122,101,110,95,105,109,112,111,114,116, - 108,105,98,95,101,120,116,101,114,110,97,108,114,21,0,0, - 0,114,1,0,0,0,114,2,0,0,0,90,17,95,102,114, - 111,122,101,110,95,105,109,112,111,114,116,108,105,98,114,76, - 0,0,0,114,148,0,0,0,114,110,0,0,0,114,152,0, - 0,0,114,67,0,0,0,114,131,0,0,0,90,7,95,95, - 97,108,108,95,95,114,20,0,0,0,90,15,112,97,116,104, - 95,115,101,112,97,114,97,116,111,114,115,114,18,0,0,0, - 114,75,0,0,0,114,3,0,0,0,114,25,0,0,0,218, - 4,116,121,112,101,114,70,0,0,0,114,113,0,0,0,114, - 115,0,0,0,114,117,0,0,0,114,4,0,0,0,114,89, - 0,0,0,114,36,0,0,0,114,37,0,0,0,114,35,0, - 0,0,114,27,0,0,0,114,122,0,0,0,114,142,0,0, - 0,114,144,0,0,0,114,52,0,0,0,114,147,0,0,0, - 114,155,0,0,0,218,8,95,95,99,111,100,101,95,95,114, - 153,0,0,0,114,159,0,0,0,114,161,0,0,0,114,169, - 0,0,0,114,151,0,0,0,114,149,0,0,0,114,44,0, - 0,0,114,80,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,218,8,60,109,111, - 100,117,108,101,62,1,0,0,0,115,88,0,0,0,4,16, - 8,1,16,1,8,1,8,1,8,1,8,1,8,1,8,2, - 8,3,6,1,14,3,16,4,4,2,8,2,4,1,4,1, - 4,2,14,127,0,127,0,1,12,1,12,1,2,1,2,252, - 4,9,8,4,8,9,8,31,8,126,2,254,2,29,4,5, - 8,21,8,46,8,10,8,46,10,5,8,7,8,6,8,13, - 8,19,8,15,8,26, -}; +/* Auto-generated by Programs/_freeze_importlib.c */ +const unsigned char _Py_M__zipimport[] = { + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,4,0,0,0,64,0,0,0,115,82,1,0,0,100,0, + 90,0,100,1,100,2,108,1,90,2,100,1,100,3,108,1, + 109,3,90,3,109,4,90,4,1,0,100,1,100,2,108,5, + 90,6,100,1,100,2,108,7,90,7,100,1,100,2,108,8, + 90,8,100,1,100,2,108,9,90,9,100,1,100,2,108,10, + 90,10,100,1,100,2,108,11,90,11,100,4,100,5,103,2, + 90,12,101,2,106,13,90,13,101,2,106,14,100,6,100,2, + 133,2,25,0,90,15,71,0,100,7,100,4,132,0,100,4, + 101,16,131,3,90,17,105,0,90,18,101,19,101,10,131,1, + 90,20,100,8,90,21,100,9,90,22,100,10,90,23,71,0, + 100,11,100,5,132,0,100,5,131,2,90,24,101,13,100,12, + 23,0,100,13,100,13,102,3,101,13,100,14,23,0,100,15, + 100,13,102,3,100,16,100,17,102,4,90,25,100,18,100,19, + 132,0,90,26,100,20,100,21,132,0,90,27,100,22,100,23, + 132,0,90,28,100,24,100,25,132,0,90,29,100,26,90,30, + 100,15,97,31,100,27,100,28,132,0,90,32,100,29,100,30, + 132,0,90,33,100,31,100,32,132,0,90,34,100,33,100,34, + 132,0,90,35,101,19,101,35,106,36,131,1,90,37,100,35, + 100,36,132,0,90,38,100,37,100,38,132,0,90,39,100,39, + 100,40,132,0,90,40,100,41,100,42,132,0,90,41,100,43, + 100,44,132,0,90,42,100,45,100,46,132,0,90,43,71,0, + 100,47,100,48,132,0,100,48,131,2,90,44,100,2,83,0, + 41,49,97,80,2,0,0,122,105,112,105,109,112,111,114,116, + 32,112,114,111,118,105,100,101,115,32,115,117,112,112,111,114, + 116,32,102,111,114,32,105,109,112,111,114,116,105,110,103,32, + 80,121,116,104,111,110,32,109,111,100,117,108,101,115,32,102, + 114,111,109,32,90,105,112,32,97,114,99,104,105,118,101,115, + 46,10,10,84,104,105,115,32,109,111,100,117,108,101,32,101, + 120,112,111,114,116,115,32,116,104,114,101,101,32,111,98,106, + 101,99,116,115,58,10,45,32,122,105,112,105,109,112,111,114, + 116,101,114,58,32,97,32,99,108,97,115,115,59,32,105,116, + 115,32,99,111,110,115,116,114,117,99,116,111,114,32,116,97, + 107,101,115,32,97,32,112,97,116,104,32,116,111,32,97,32, + 90,105,112,32,97,114,99,104,105,118,101,46,10,45,32,90, + 105,112,73,109,112,111,114,116,69,114,114,111,114,58,32,101, + 120,99,101,112,116,105,111,110,32,114,97,105,115,101,100,32, + 98,121,32,122,105,112,105,109,112,111,114,116,101,114,32,111, + 98,106,101,99,116,115,46,32,73,116,39,115,32,97,10,32, + 32,115,117,98,99,108,97,115,115,32,111,102,32,73,109,112, + 111,114,116,69,114,114,111,114,44,32,115,111,32,105,116,32, + 99,97,110,32,98,101,32,99,97,117,103,104,116,32,97,115, + 32,73,109,112,111,114,116,69,114,114,111,114,44,32,116,111, + 111,46,10,45,32,95,122,105,112,95,100,105,114,101,99,116, + 111,114,121,95,99,97,99,104,101,58,32,97,32,100,105,99, + 116,44,32,109,97,112,112,105,110,103,32,97,114,99,104,105, + 118,101,32,112,97,116,104,115,32,116,111,32,122,105,112,32, + 100,105,114,101,99,116,111,114,121,10,32,32,105,110,102,111, + 32,100,105,99,116,115,44,32,97,115,32,117,115,101,100,32, + 105,110,32,122,105,112,105,109,112,111,114,116,101,114,46,95, + 102,105,108,101,115,46,10,10,73,116,32,105,115,32,117,115, + 117,97,108,108,121,32,110,111,116,32,110,101,101,100,101,100, + 32,116,111,32,117,115,101,32,116,104,101,32,122,105,112,105, + 109,112,111,114,116,32,109,111,100,117,108,101,32,101,120,112, + 108,105,99,105,116,108,121,59,32,105,116,32,105,115,10,117, + 115,101,100,32,98,121,32,116,104,101,32,98,117,105,108,116, + 105,110,32,105,109,112,111,114,116,32,109,101,99,104,97,110, + 105,115,109,32,102,111,114,32,115,121,115,46,112,97,116,104, + 32,105,116,101,109,115,32,116,104,97,116,32,97,114,101,32, + 112,97,116,104,115,10,116,111,32,90,105,112,32,97,114,99, + 104,105,118,101,115,46,10,233,0,0,0,0,78,41,2,218, + 14,95,117,110,112,97,99,107,95,117,105,110,116,49,54,218, + 14,95,117,110,112,97,99,107,95,117,105,110,116,51,50,218, + 14,90,105,112,73,109,112,111,114,116,69,114,114,111,114,218, + 11,122,105,112,105,109,112,111,114,116,101,114,233,1,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,1,0,0,0,64,0,0,0,115,12,0,0,0,101, + 0,90,1,100,0,90,2,100,1,83,0,41,2,114,3,0, + 0,0,78,41,3,218,8,95,95,110,97,109,101,95,95,218, + 10,95,95,109,111,100,117,108,101,95,95,218,12,95,95,113, + 117,97,108,110,97,109,101,95,95,169,0,114,9,0,0,0, + 114,9,0,0,0,250,18,60,102,114,111,122,101,110,32,122, + 105,112,105,109,112,111,114,116,62,114,3,0,0,0,33,0, + 0,0,115,2,0,0,0,8,1,233,22,0,0,0,115,4, + 0,0,0,80,75,5,6,105,255,255,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,64,0,0,0,115,108,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,25, + 100,5,100,6,132,1,90,5,100,26,100,7,100,8,132,1, + 90,6,100,9,100,10,132,0,90,7,100,11,100,12,132,0, + 90,8,100,13,100,14,132,0,90,9,100,15,100,16,132,0, + 90,10,100,17,100,18,132,0,90,11,100,19,100,20,132,0, + 90,12,100,21,100,22,132,0,90,13,100,23,100,24,132,0, + 90,14,100,4,83,0,41,27,114,4,0,0,0,97,255,1, + 0,0,122,105,112,105,109,112,111,114,116,101,114,40,97,114, + 99,104,105,118,101,112,97,116,104,41,32,45,62,32,122,105, + 112,105,109,112,111,114,116,101,114,32,111,98,106,101,99,116, + 10,10,32,32,32,32,67,114,101,97,116,101,32,97,32,110, + 101,119,32,122,105,112,105,109,112,111,114,116,101,114,32,105, + 110,115,116,97,110,99,101,46,32,39,97,114,99,104,105,118, + 101,112,97,116,104,39,32,109,117,115,116,32,98,101,32,97, + 32,112,97,116,104,32,116,111,10,32,32,32,32,97,32,122, + 105,112,102,105,108,101,44,32,111,114,32,116,111,32,97,32, + 115,112,101,99,105,102,105,99,32,112,97,116,104,32,105,110, + 115,105,100,101,32,97,32,122,105,112,102,105,108,101,46,32, + 70,111,114,32,101,120,97,109,112,108,101,44,32,105,116,32, + 99,97,110,32,98,101,10,32,32,32,32,39,47,116,109,112, + 47,109,121,105,109,112,111,114,116,46,122,105,112,39,44,32, + 111,114,32,39,47,116,109,112,47,109,121,105,109,112,111,114, + 116,46,122,105,112,47,109,121,100,105,114,101,99,116,111,114, + 121,39,44,32,105,102,32,109,121,100,105,114,101,99,116,111, + 114,121,32,105,115,32,97,10,32,32,32,32,118,97,108,105, + 100,32,100,105,114,101,99,116,111,114,121,32,105,110,115,105, + 100,101,32,116,104,101,32,97,114,99,104,105,118,101,46,10, + 10,32,32,32,32,39,90,105,112,73,109,112,111,114,116,69, + 114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,105, + 102,32,39,97,114,99,104,105,118,101,112,97,116,104,39,32, + 100,111,101,115,110,39,116,32,112,111,105,110,116,32,116,111, + 32,97,32,118,97,108,105,100,32,90,105,112,10,32,32,32, + 32,97,114,99,104,105,118,101,46,10,10,32,32,32,32,84, + 104,101,32,39,97,114,99,104,105,118,101,39,32,97,116,116, + 114,105,98,117,116,101,32,111,102,32,122,105,112,105,109,112, + 111,114,116,101,114,32,111,98,106,101,99,116,115,32,99,111, + 110,116,97,105,110,115,32,116,104,101,32,110,97,109,101,32, + 111,102,32,116,104,101,10,32,32,32,32,122,105,112,102,105, + 108,101,32,116,97,114,103,101,116,101,100,46,10,32,32,32, + 32,99,2,0,0,0,0,0,0,0,0,0,0,0,8,0, + 0,0,9,0,0,0,67,0,0,0,115,32,1,0,0,116, + 0,124,1,116,1,131,2,115,28,100,1,100,0,108,2,125, + 2,124,2,160,3,124,1,161,1,125,1,124,1,115,44,116, + 4,100,2,124,1,100,3,141,2,130,1,116,5,114,60,124, + 1,160,6,116,5,116,7,161,2,125,1,103,0,125,3,122, + 14,116,8,160,9,124,1,161,1,125,4,87,0,110,70,4, + 0,116,10,116,11,102,2,121,148,1,0,1,0,1,0,116, + 8,160,12,124,1,161,1,92,2,125,5,125,6,124,5,124, + 1,107,2,114,130,116,4,100,4,124,1,100,3,141,2,130, + 1,124,5,125,1,124,3,160,13,124,6,161,1,1,0,89, + 0,113,64,48,0,124,4,106,14,100,5,64,0,100,6,107, + 3,114,180,116,4,100,4,124,1,100,3,141,2,130,1,113, + 180,113,64,122,12,116,15,124,1,25,0,125,7,87,0,110, + 34,4,0,116,16,121,226,1,0,1,0,1,0,116,17,124, + 1,131,1,125,7,124,7,116,15,124,1,60,0,89,0,110, + 2,48,0,124,7,124,0,95,18,124,1,124,0,95,19,116, + 8,106,20,124,3,100,0,100,0,100,7,133,3,25,0,142, + 0,124,0,95,21,124,0,106,21,144,1,114,28,124,0,4, + 0,106,21,116,7,55,0,2,0,95,21,100,0,83,0,41, + 8,78,114,0,0,0,0,122,21,97,114,99,104,105,118,101, + 32,112,97,116,104,32,105,115,32,101,109,112,116,121,169,1, + 218,4,112,97,116,104,122,14,110,111,116,32,97,32,90,105, + 112,32,102,105,108,101,105,0,240,0,0,105,0,128,0,0, + 233,255,255,255,255,41,22,218,10,105,115,105,110,115,116,97, + 110,99,101,218,3,115,116,114,218,2,111,115,90,8,102,115, + 100,101,99,111,100,101,114,3,0,0,0,218,12,97,108,116, + 95,112,97,116,104,95,115,101,112,218,7,114,101,112,108,97, + 99,101,218,8,112,97,116,104,95,115,101,112,218,19,95,98, + 111,111,116,115,116,114,97,112,95,101,120,116,101,114,110,97, + 108,90,10,95,112,97,116,104,95,115,116,97,116,218,7,79, + 83,69,114,114,111,114,218,10,86,97,108,117,101,69,114,114, + 111,114,90,11,95,112,97,116,104,95,115,112,108,105,116,218, + 6,97,112,112,101,110,100,90,7,115,116,95,109,111,100,101, + 218,20,95,122,105,112,95,100,105,114,101,99,116,111,114,121, + 95,99,97,99,104,101,218,8,75,101,121,69,114,114,111,114, + 218,15,95,114,101,97,100,95,100,105,114,101,99,116,111,114, + 121,218,6,95,102,105,108,101,115,218,7,97,114,99,104,105, + 118,101,218,10,95,112,97,116,104,95,106,111,105,110,218,6, + 112,114,101,102,105,120,41,8,218,4,115,101,108,102,114,13, + 0,0,0,114,17,0,0,0,114,31,0,0,0,90,2,115, + 116,90,7,100,105,114,110,97,109,101,90,8,98,97,115,101, + 110,97,109,101,218,5,102,105,108,101,115,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,218,8,95,95,105,110, + 105,116,95,95,63,0,0,0,115,58,0,0,0,0,1,10, + 1,8,1,10,1,4,1,12,1,4,1,12,2,4,2,2, + 1,14,1,16,3,14,1,8,1,12,1,4,1,16,3,14, + 2,12,1,4,2,2,1,12,1,12,1,8,1,14,1,6, + 1,6,2,22,1,8,1,122,20,122,105,112,105,109,112,111, + 114,116,101,114,46,95,95,105,110,105,116,95,95,78,99,3, + 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4, + 0,0,0,67,0,0,0,115,78,0,0,0,116,0,124,0, + 124,1,131,2,125,3,124,3,100,1,117,1,114,26,124,0, + 103,0,102,2,83,0,116,1,124,0,124,1,131,2,125,4, + 116,2,124,0,124,4,131,2,114,70,100,1,124,0,106,3, + 155,0,116,4,155,0,124,4,155,0,157,3,103,1,102,2, + 83,0,100,1,103,0,102,2,83,0,41,2,97,239,1,0, + 0,102,105,110,100,95,108,111,97,100,101,114,40,102,117,108, + 108,110,97,109,101,44,32,112,97,116,104,61,78,111,110,101, + 41,32,45,62,32,115,101,108,102,44,32,115,116,114,32,111, + 114,32,78,111,110,101,46,10,10,32,32,32,32,32,32,32, + 32,83,101,97,114,99,104,32,102,111,114,32,97,32,109,111, + 100,117,108,101,32,115,112,101,99,105,102,105,101,100,32,98, + 121,32,39,102,117,108,108,110,97,109,101,39,46,32,39,102, + 117,108,108,110,97,109,101,39,32,109,117,115,116,32,98,101, + 32,116,104,101,10,32,32,32,32,32,32,32,32,102,117,108, + 108,121,32,113,117,97,108,105,102,105,101,100,32,40,100,111, + 116,116,101,100,41,32,109,111,100,117,108,101,32,110,97,109, + 101,46,32,73,116,32,114,101,116,117,114,110,115,32,116,104, + 101,32,122,105,112,105,109,112,111,114,116,101,114,10,32,32, + 32,32,32,32,32,32,105,110,115,116,97,110,99,101,32,105, + 116,115,101,108,102,32,105,102,32,116,104,101,32,109,111,100, + 117,108,101,32,119,97,115,32,102,111,117,110,100,44,32,97, + 32,115,116,114,105,110,103,32,99,111,110,116,97,105,110,105, + 110,103,32,116,104,101,10,32,32,32,32,32,32,32,32,102, + 117,108,108,32,112,97,116,104,32,110,97,109,101,32,105,102, + 32,105,116,39,115,32,112,111,115,115,105,98,108,121,32,97, + 32,112,111,114,116,105,111,110,32,111,102,32,97,32,110,97, + 109,101,115,112,97,99,101,32,112,97,99,107,97,103,101,44, + 10,32,32,32,32,32,32,32,32,111,114,32,78,111,110,101, + 32,111,116,104,101,114,119,105,115,101,46,32,84,104,101,32, + 111,112,116,105,111,110,97,108,32,39,112,97,116,104,39,32, + 97,114,103,117,109,101,110,116,32,105,115,32,105,103,110,111, + 114,101,100,32,45,45,32,105,116,39,115,10,32,32,32,32, + 32,32,32,32,116,104,101,114,101,32,102,111,114,32,99,111, + 109,112,97,116,105,98,105,108,105,116,121,32,119,105,116,104, + 32,116,104,101,32,105,109,112,111,114,116,101,114,32,112,114, + 111,116,111,99,111,108,46,10,32,32,32,32,32,32,32,32, + 78,41,5,218,16,95,103,101,116,95,109,111,100,117,108,101, + 95,105,110,102,111,218,16,95,103,101,116,95,109,111,100,117, + 108,101,95,112,97,116,104,218,7,95,105,115,95,100,105,114, + 114,29,0,0,0,114,20,0,0,0,41,5,114,32,0,0, + 0,218,8,102,117,108,108,110,97,109,101,114,13,0,0,0, + 218,2,109,105,218,7,109,111,100,112,97,116,104,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,218,11,102,105, + 110,100,95,108,111,97,100,101,114,109,0,0,0,115,14,0, + 0,0,0,10,10,1,8,2,8,7,10,1,10,4,24,2, + 122,23,122,105,112,105,109,112,111,114,116,101,114,46,102,105, + 110,100,95,108,111,97,100,101,114,99,3,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, + 0,0,115,16,0,0,0,124,0,160,0,124,1,124,2,161, + 2,100,1,25,0,83,0,41,2,97,139,1,0,0,102,105, + 110,100,95,109,111,100,117,108,101,40,102,117,108,108,110,97, + 109,101,44,32,112,97,116,104,61,78,111,110,101,41,32,45, + 62,32,115,101,108,102,32,111,114,32,78,111,110,101,46,10, + 10,32,32,32,32,32,32,32,32,83,101,97,114,99,104,32, + 102,111,114,32,97,32,109,111,100,117,108,101,32,115,112,101, + 99,105,102,105,101,100,32,98,121,32,39,102,117,108,108,110, + 97,109,101,39,46,32,39,102,117,108,108,110,97,109,101,39, + 32,109,117,115,116,32,98,101,32,116,104,101,10,32,32,32, + 32,32,32,32,32,102,117,108,108,121,32,113,117,97,108,105, + 102,105,101,100,32,40,100,111,116,116,101,100,41,32,109,111, + 100,117,108,101,32,110,97,109,101,46,32,73,116,32,114,101, + 116,117,114,110,115,32,116,104,101,32,122,105,112,105,109,112, + 111,114,116,101,114,10,32,32,32,32,32,32,32,32,105,110, + 115,116,97,110,99,101,32,105,116,115,101,108,102,32,105,102, + 32,116,104,101,32,109,111,100,117,108,101,32,119,97,115,32, + 102,111,117,110,100,44,32,111,114,32,78,111,110,101,32,105, + 102,32,105,116,32,119,97,115,110,39,116,46,10,32,32,32, + 32,32,32,32,32,84,104,101,32,111,112,116,105,111,110,97, + 108,32,39,112,97,116,104,39,32,97,114,103,117,109,101,110, + 116,32,105,115,32,105,103,110,111,114,101,100,32,45,45,32, + 105,116,39,115,32,116,104,101,114,101,32,102,111,114,32,99, + 111,109,112,97,116,105,98,105,108,105,116,121,10,32,32,32, + 32,32,32,32,32,119,105,116,104,32,116,104,101,32,105,109, + 112,111,114,116,101,114,32,112,114,111,116,111,99,111,108,46, + 10,32,32,32,32,32,32,32,32,114,0,0,0,0,41,1, + 114,41,0,0,0,41,3,114,32,0,0,0,114,38,0,0, + 0,114,13,0,0,0,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,11,102,105,110,100,95,109,111,100,117, + 108,101,141,0,0,0,115,2,0,0,0,0,9,122,23,122, + 105,112,105,109,112,111,114,116,101,114,46,102,105,110,100,95, + 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0, + 0,0,0,5,0,0,0,3,0,0,0,67,0,0,0,115, + 20,0,0,0,116,0,124,0,124,1,131,2,92,3,125,2, + 125,3,125,4,124,2,83,0,41,1,122,163,103,101,116,95, + 99,111,100,101,40,102,117,108,108,110,97,109,101,41,32,45, + 62,32,99,111,100,101,32,111,98,106,101,99,116,46,10,10, + 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,116, + 104,101,32,99,111,100,101,32,111,98,106,101,99,116,32,102, + 111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100, + 32,109,111,100,117,108,101,46,32,82,97,105,115,101,32,90, + 105,112,73,109,112,111,114,116,69,114,114,111,114,10,32,32, + 32,32,32,32,32,32,105,102,32,116,104,101,32,109,111,100, + 117,108,101,32,99,111,117,108,100,110,39,116,32,98,101,32, + 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,169, + 1,218,16,95,103,101,116,95,109,111,100,117,108,101,95,99, + 111,100,101,169,5,114,32,0,0,0,114,38,0,0,0,218, + 4,99,111,100,101,218,9,105,115,112,97,99,107,97,103,101, + 114,40,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,218,8,103,101,116,95,99,111,100,101,153,0, + 0,0,115,4,0,0,0,0,6,16,1,122,20,122,105,112, + 105,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,4,0, + 0,0,8,0,0,0,67,0,0,0,115,116,0,0,0,116, + 0,114,16,124,1,160,1,116,0,116,2,161,2,125,1,124, + 1,125,2,124,1,160,3,124,0,106,4,116,2,23,0,161, + 1,114,58,124,1,116,5,124,0,106,4,116,2,23,0,131, + 1,100,1,133,2,25,0,125,2,122,14,124,0,106,6,124, + 2,25,0,125,3,87,0,110,30,4,0,116,7,121,102,1, + 0,1,0,1,0,116,8,100,2,100,3,124,2,131,3,130, + 1,89,0,110,2,48,0,116,9,124,0,106,4,124,3,131, + 2,83,0,41,4,122,154,103,101,116,95,100,97,116,97,40, + 112,97,116,104,110,97,109,101,41,32,45,62,32,115,116,114, + 105,110,103,32,119,105,116,104,32,102,105,108,101,32,100,97, + 116,97,46,10,10,32,32,32,32,32,32,32,32,82,101,116, + 117,114,110,32,116,104,101,32,100,97,116,97,32,97,115,115, + 111,99,105,97,116,101,100,32,119,105,116,104,32,39,112,97, + 116,104,110,97,109,101,39,46,32,82,97,105,115,101,32,79, + 83,69,114,114,111,114,32,105,102,10,32,32,32,32,32,32, + 32,32,116,104,101,32,102,105,108,101,32,119,97,115,110,39, + 116,32,102,111,117,110,100,46,10,32,32,32,32,32,32,32, + 32,78,114,0,0,0,0,218,0,41,10,114,18,0,0,0, + 114,19,0,0,0,114,20,0,0,0,218,10,115,116,97,114, + 116,115,119,105,116,104,114,29,0,0,0,218,3,108,101,110, + 114,28,0,0,0,114,26,0,0,0,114,22,0,0,0,218, + 9,95,103,101,116,95,100,97,116,97,41,4,114,32,0,0, + 0,218,8,112,97,116,104,110,97,109,101,90,3,107,101,121, + 218,9,116,111,99,95,101,110,116,114,121,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,218,8,103,101,116,95, + 100,97,116,97,163,0,0,0,115,20,0,0,0,0,6,4, + 1,12,2,4,1,16,1,22,2,2,1,14,1,12,1,18, + 1,122,20,122,105,112,105,109,112,111,114,116,101,114,46,103, + 101,116,95,100,97,116,97,99,2,0,0,0,0,0,0,0, + 0,0,0,0,5,0,0,0,3,0,0,0,67,0,0,0, + 115,20,0,0,0,116,0,124,0,124,1,131,2,92,3,125, + 2,125,3,125,4,124,4,83,0,41,1,122,106,103,101,116, + 95,102,105,108,101,110,97,109,101,40,102,117,108,108,110,97, + 109,101,41,32,45,62,32,102,105,108,101,110,97,109,101,32, + 115,116,114,105,110,103,46,10,10,32,32,32,32,32,32,32, + 32,82,101,116,117,114,110,32,116,104,101,32,102,105,108,101, + 110,97,109,101,32,102,111,114,32,116,104,101,32,115,112,101, + 99,105,102,105,101,100,32,109,111,100,117,108,101,46,10,32, + 32,32,32,32,32,32,32,114,43,0,0,0,114,45,0,0, + 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 218,12,103,101,116,95,102,105,108,101,110,97,109,101,184,0, + 0,0,115,4,0,0,0,0,7,16,1,122,24,122,105,112, + 105,109,112,111,114,116,101,114,46,103,101,116,95,102,105,108, + 101,110,97,109,101,99,2,0,0,0,0,0,0,0,0,0, + 0,0,6,0,0,0,8,0,0,0,67,0,0,0,115,126, + 0,0,0,116,0,124,0,124,1,131,2,125,2,124,2,100, + 1,117,0,114,36,116,1,100,2,124,1,155,2,157,2,124, + 1,100,3,141,2,130,1,116,2,124,0,124,1,131,2,125, + 3,124,2,114,64,116,3,160,4,124,3,100,4,161,2,125, + 4,110,10,124,3,155,0,100,5,157,2,125,4,122,14,124, + 0,106,5,124,4,25,0,125,5,87,0,110,20,4,0,116, + 6,121,108,1,0,1,0,1,0,89,0,100,1,83,0,48, + 0,116,7,124,0,106,8,124,5,131,2,160,9,161,0,83, + 0,41,6,122,253,103,101,116,95,115,111,117,114,99,101,40, + 102,117,108,108,110,97,109,101,41,32,45,62,32,115,111,117, + 114,99,101,32,115,116,114,105,110,103,46,10,10,32,32,32, + 32,32,32,32,32,82,101,116,117,114,110,32,116,104,101,32, + 115,111,117,114,99,101,32,99,111,100,101,32,102,111,114,32, + 116,104,101,32,115,112,101,99,105,102,105,101,100,32,109,111, + 100,117,108,101,46,32,82,97,105,115,101,32,90,105,112,73, + 109,112,111,114,116,69,114,114,111,114,10,32,32,32,32,32, + 32,32,32,105,102,32,116,104,101,32,109,111,100,117,108,101, + 32,99,111,117,108,100,110,39,116,32,98,101,32,102,111,117, + 110,100,44,32,114,101,116,117,114,110,32,78,111,110,101,32, + 105,102,32,116,104,101,32,97,114,99,104,105,118,101,32,100, + 111,101,115,10,32,32,32,32,32,32,32,32,99,111,110,116, + 97,105,110,32,116,104,101,32,109,111,100,117,108,101,44,32, + 98,117,116,32,104,97,115,32,110,111,32,115,111,117,114,99, + 101,32,102,111,114,32,105,116,46,10,32,32,32,32,32,32, + 32,32,78,250,18,99,97,110,39,116,32,102,105,110,100,32, + 109,111,100,117,108,101,32,169,1,218,4,110,97,109,101,250, + 11,95,95,105,110,105,116,95,95,46,112,121,250,3,46,112, + 121,41,10,114,35,0,0,0,114,3,0,0,0,114,36,0, + 0,0,114,21,0,0,0,114,30,0,0,0,114,28,0,0, + 0,114,26,0,0,0,114,52,0,0,0,114,29,0,0,0, + 218,6,100,101,99,111,100,101,41,6,114,32,0,0,0,114, + 38,0,0,0,114,39,0,0,0,114,13,0,0,0,218,8, + 102,117,108,108,112,97,116,104,114,54,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,218,10,103,101, + 116,95,115,111,117,114,99,101,195,0,0,0,115,24,0,0, + 0,0,7,10,1,8,1,18,2,10,1,4,1,14,2,10, + 2,2,1,14,1,12,2,8,1,122,22,122,105,112,105,109, + 112,111,114,116,101,114,46,103,101,116,95,115,111,117,114,99, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,4,0,0,0,67,0,0,0,115,40,0,0,0,116, + 0,124,0,124,1,131,2,125,2,124,2,100,1,117,0,114, + 36,116,1,100,2,124,1,155,2,157,2,124,1,100,3,141, + 2,130,1,124,2,83,0,41,4,122,171,105,115,95,112,97, + 99,107,97,103,101,40,102,117,108,108,110,97,109,101,41,32, + 45,62,32,98,111,111,108,46,10,10,32,32,32,32,32,32, + 32,32,82,101,116,117,114,110,32,84,114,117,101,32,105,102, + 32,116,104,101,32,109,111,100,117,108,101,32,115,112,101,99, + 105,102,105,101,100,32,98,121,32,102,117,108,108,110,97,109, + 101,32,105,115,32,97,32,112,97,99,107,97,103,101,46,10, + 32,32,32,32,32,32,32,32,82,97,105,115,101,32,90,105, + 112,73,109,112,111,114,116,69,114,114,111,114,32,105,102,32, + 116,104,101,32,109,111,100,117,108,101,32,99,111,117,108,100, + 110,39,116,32,98,101,32,102,111,117,110,100,46,10,32,32, + 32,32,32,32,32,32,78,114,57,0,0,0,114,58,0,0, + 0,41,2,114,35,0,0,0,114,3,0,0,0,41,3,114, + 32,0,0,0,114,38,0,0,0,114,39,0,0,0,114,9, + 0,0,0,114,9,0,0,0,114,10,0,0,0,218,10,105, + 115,95,112,97,99,107,97,103,101,221,0,0,0,115,8,0, + 0,0,0,6,10,1,8,1,18,1,122,22,122,105,112,105, + 109,112,111,114,116,101,114,46,105,115,95,112,97,99,107,97, + 103,101,99,2,0,0,0,0,0,0,0,0,0,0,0,8, + 0,0,0,8,0,0,0,67,0,0,0,115,246,0,0,0, + 116,0,124,0,124,1,131,2,92,3,125,2,125,3,125,4, + 116,1,106,2,160,3,124,1,161,1,125,5,124,5,100,1, + 117,0,115,46,116,4,124,5,116,5,131,2,115,64,116,5, + 124,1,131,1,125,5,124,5,116,1,106,2,124,1,60,0, + 124,0,124,5,95,6,122,84,124,3,114,108,116,7,124,0, + 124,1,131,2,125,6,116,8,160,9,124,0,106,10,124,6, + 161,2,125,7,124,7,103,1,124,5,95,11,116,12,124,5, + 100,2,131,2,115,124,116,13,124,5,95,13,116,8,160,14, + 124,5,106,15,124,1,124,4,161,3,1,0,116,16,124,2, + 124,5,106,15,131,2,1,0,87,0,110,22,1,0,1,0, + 1,0,116,1,106,2,124,1,61,0,130,0,89,0,110,2, + 48,0,122,14,116,1,106,2,124,1,25,0,125,5,87,0, + 110,34,4,0,116,17,121,226,1,0,1,0,1,0,116,18, + 100,3,124,1,155,2,100,4,157,3,131,1,130,1,89,0, + 110,2,48,0,116,19,160,20,100,5,124,1,124,4,161,3, + 1,0,124,5,83,0,41,6,122,245,108,111,97,100,95,109, + 111,100,117,108,101,40,102,117,108,108,110,97,109,101,41,32, + 45,62,32,109,111,100,117,108,101,46,10,10,32,32,32,32, + 32,32,32,32,76,111,97,100,32,116,104,101,32,109,111,100, + 117,108,101,32,115,112,101,99,105,102,105,101,100,32,98,121, + 32,39,102,117,108,108,110,97,109,101,39,46,32,39,102,117, + 108,108,110,97,109,101,39,32,109,117,115,116,32,98,101,32, + 116,104,101,10,32,32,32,32,32,32,32,32,102,117,108,108, + 121,32,113,117,97,108,105,102,105,101,100,32,40,100,111,116, + 116,101,100,41,32,109,111,100,117,108,101,32,110,97,109,101, + 46,32,73,116,32,114,101,116,117,114,110,115,32,116,104,101, + 32,105,109,112,111,114,116,101,100,10,32,32,32,32,32,32, + 32,32,109,111,100,117,108,101,44,32,111,114,32,114,97,105, + 115,101,115,32,90,105,112,73,109,112,111,114,116,69,114,114, + 111,114,32,105,102,32,105,116,32,119,97,115,110,39,116,32, + 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,78, + 218,12,95,95,98,117,105,108,116,105,110,115,95,95,122,14, + 76,111,97,100,101,100,32,109,111,100,117,108,101,32,122,25, + 32,110,111,116,32,102,111,117,110,100,32,105,110,32,115,121, + 115,46,109,111,100,117,108,101,115,122,30,105,109,112,111,114, + 116,32,123,125,32,35,32,108,111,97,100,101,100,32,102,114, + 111,109,32,90,105,112,32,123,125,41,21,114,44,0,0,0, + 218,3,115,121,115,218,7,109,111,100,117,108,101,115,218,3, + 103,101,116,114,15,0,0,0,218,12,95,109,111,100,117,108, + 101,95,116,121,112,101,218,10,95,95,108,111,97,100,101,114, + 95,95,114,36,0,0,0,114,21,0,0,0,114,30,0,0, + 0,114,29,0,0,0,90,8,95,95,112,97,116,104,95,95, + 218,7,104,97,115,97,116,116,114,114,66,0,0,0,90,14, + 95,102,105,120,95,117,112,95,109,111,100,117,108,101,218,8, + 95,95,100,105,99,116,95,95,218,4,101,120,101,99,114,26, + 0,0,0,218,11,73,109,112,111,114,116,69,114,114,111,114, + 218,10,95,98,111,111,116,115,116,114,97,112,218,16,95,118, + 101,114,98,111,115,101,95,109,101,115,115,97,103,101,41,8, + 114,32,0,0,0,114,38,0,0,0,114,46,0,0,0,114, + 47,0,0,0,114,40,0,0,0,90,3,109,111,100,114,13, + 0,0,0,114,63,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,11,108,111,97,100,95,109,111, + 100,117,108,101,234,0,0,0,115,48,0,0,0,0,7,16, + 1,12,1,18,1,8,1,10,1,6,2,2,1,4,3,10, + 1,14,1,8,2,10,1,6,1,16,1,16,1,6,1,8, + 1,8,2,2,1,14,1,12,1,22,1,14,1,122,23,122, + 105,112,105,109,112,111,114,116,101,114,46,108,111,97,100,95, + 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,8,0,0,0,67,0,0,0,115, + 86,0,0,0,122,20,124,0,160,0,124,1,161,1,115,18, + 87,0,100,1,83,0,87,0,110,20,4,0,116,1,121,40, + 1,0,1,0,1,0,89,0,100,1,83,0,48,0,116,2, + 106,3,115,76,100,2,100,3,108,4,109,5,125,2,1,0, + 124,2,160,6,116,2,161,1,1,0,100,4,116,2,95,3, + 116,2,124,0,124,1,131,2,83,0,41,5,122,204,82,101, + 116,117,114,110,32,116,104,101,32,82,101,115,111,117,114,99, + 101,82,101,97,100,101,114,32,102,111,114,32,97,32,112,97, + 99,107,97,103,101,32,105,110,32,97,32,122,105,112,32,102, + 105,108,101,46,10,10,32,32,32,32,32,32,32,32,73,102, + 32,39,102,117,108,108,110,97,109,101,39,32,105,115,32,97, + 32,112,97,99,107,97,103,101,32,119,105,116,104,105,110,32, + 116,104,101,32,122,105,112,32,102,105,108,101,44,32,114,101, + 116,117,114,110,32,116,104,101,10,32,32,32,32,32,32,32, + 32,39,82,101,115,111,117,114,99,101,82,101,97,100,101,114, + 39,32,111,98,106,101,99,116,32,102,111,114,32,116,104,101, + 32,112,97,99,107,97,103,101,46,32,32,79,116,104,101,114, + 119,105,115,101,32,114,101,116,117,114,110,32,78,111,110,101, + 46,10,32,32,32,32,32,32,32,32,78,114,0,0,0,0, + 41,1,218,14,82,101,115,111,117,114,99,101,82,101,97,100, + 101,114,84,41,7,114,65,0,0,0,114,3,0,0,0,218, + 24,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, + 114,99,101,82,101,97,100,101,114,218,11,95,114,101,103,105, + 115,116,101,114,101,100,90,13,105,109,112,111,114,116,108,105, + 98,46,97,98,99,114,79,0,0,0,90,8,114,101,103,105, + 115,116,101,114,41,3,114,32,0,0,0,114,38,0,0,0, + 114,79,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,218,19,103,101,116,95,114,101,115,111,117,114, + 99,101,95,114,101,97,100,101,114,16,1,0,0,115,20,0, + 0,0,0,6,2,1,10,1,10,1,12,1,8,1,6,1, + 12,1,10,1,6,1,122,31,122,105,112,105,109,112,111,114, + 116,101,114,46,103,101,116,95,114,101,115,111,117,114,99,101, + 95,114,101,97,100,101,114,99,1,0,0,0,0,0,0,0, + 0,0,0,0,1,0,0,0,5,0,0,0,67,0,0,0, + 115,24,0,0,0,100,1,124,0,106,0,155,0,116,1,155, + 0,124,0,106,2,155,0,100,2,157,5,83,0,41,3,78, + 122,21,60,122,105,112,105,109,112,111,114,116,101,114,32,111, + 98,106,101,99,116,32,34,122,2,34,62,41,3,114,29,0, + 0,0,114,20,0,0,0,114,31,0,0,0,41,1,114,32, + 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,218,8,95,95,114,101,112,114,95,95,34,1,0,0, + 115,2,0,0,0,0,1,122,20,122,105,112,105,109,112,111, + 114,116,101,114,46,95,95,114,101,112,114,95,95,41,1,78, + 41,1,78,41,15,114,6,0,0,0,114,7,0,0,0,114, + 8,0,0,0,218,7,95,95,100,111,99,95,95,114,34,0, + 0,0,114,41,0,0,0,114,42,0,0,0,114,48,0,0, + 0,114,55,0,0,0,114,56,0,0,0,114,64,0,0,0, + 114,65,0,0,0,114,78,0,0,0,114,82,0,0,0,114, + 83,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,4,0,0,0,45,0,0, + 0,115,24,0,0,0,8,1,4,17,8,46,10,32,10,12, + 8,10,8,21,8,11,8,26,8,13,8,38,8,18,122,12, + 95,95,105,110,105,116,95,95,46,112,121,99,84,114,60,0, + 0,0,70,41,3,122,4,46,112,121,99,84,70,41,3,114, + 61,0,0,0,70,70,99,2,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115, + 20,0,0,0,124,0,106,0,124,1,160,1,100,1,161,1, + 100,2,25,0,23,0,83,0,41,3,78,218,1,46,233,2, + 0,0,0,41,2,114,31,0,0,0,218,10,114,112,97,114, + 116,105,116,105,111,110,41,2,114,32,0,0,0,114,38,0, + 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,114,36,0,0,0,52,1,0,0,115,2,0,0,0,0, + 1,114,36,0,0,0,99,2,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,2,0,0,0,67,0,0,0,115, + 18,0,0,0,124,1,116,0,23,0,125,2,124,2,124,0, + 106,1,118,0,83,0,169,1,78,41,2,114,20,0,0,0, + 114,28,0,0,0,41,3,114,32,0,0,0,114,13,0,0, + 0,90,7,100,105,114,112,97,116,104,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,37,0,0,0,56,1, + 0,0,115,4,0,0,0,0,4,8,2,114,37,0,0,0, + 99,2,0,0,0,0,0,0,0,0,0,0,0,7,0,0, + 0,4,0,0,0,67,0,0,0,115,56,0,0,0,116,0, + 124,0,124,1,131,2,125,2,116,1,68,0,93,36,92,3, + 125,3,125,4,125,5,124,2,124,3,23,0,125,6,124,6, + 124,0,106,2,118,0,114,14,124,5,2,0,1,0,83,0, + 113,14,100,0,83,0,114,88,0,0,0,41,3,114,36,0, + 0,0,218,16,95,122,105,112,95,115,101,97,114,99,104,111, + 114,100,101,114,114,28,0,0,0,41,7,114,32,0,0,0, + 114,38,0,0,0,114,13,0,0,0,218,6,115,117,102,102, + 105,120,218,10,105,115,98,121,116,101,99,111,100,101,114,47, + 0,0,0,114,63,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,114,35,0,0,0,65,1,0,0, + 115,12,0,0,0,0,1,10,1,14,1,8,1,10,1,10, + 1,114,35,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,26,0,0,0,9,0,0,0,67,0,0,0,115, + 2,5,0,0,122,14,116,0,160,1,124,0,161,1,125,1, + 87,0,110,36,4,0,116,2,121,50,1,0,1,0,1,0, + 116,3,100,1,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,89,0,110,2,48,0,124,1,144,4,143,164,1,0, + 122,36,124,1,160,4,116,5,11,0,100,3,161,2,1,0, + 124,1,160,6,161,0,125,2,124,1,160,7,116,5,161,1, + 125,3,87,0,110,36,4,0,116,2,121,132,1,0,1,0, + 1,0,116,3,100,4,124,0,155,2,157,2,124,0,100,2, + 141,2,130,1,89,0,110,2,48,0,116,8,124,3,131,1, + 116,5,107,3,114,164,116,3,100,4,124,0,155,2,157,2, + 124,0,100,2,141,2,130,1,124,3,100,0,100,5,133,2, + 25,0,116,9,107,3,144,1,114,170,122,24,124,1,160,4, + 100,6,100,3,161,2,1,0,124,1,160,6,161,0,125,4, + 87,0,110,36,4,0,116,2,121,242,1,0,1,0,1,0, + 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,89,0,110,2,48,0,116,10,124,4,116,11,24,0, + 116,5,24,0,100,6,131,2,125,5,122,22,124,1,160,4, + 124,5,161,1,1,0,124,1,160,7,161,0,125,6,87,0, + 110,38,4,0,116,2,144,1,121,66,1,0,1,0,1,0, + 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,89,0,110,2,48,0,124,6,160,12,116,9,161,1, + 125,7,124,7,100,6,107,0,144,1,114,106,116,3,100,7, + 124,0,155,2,157,2,124,0,100,2,141,2,130,1,124,6, + 124,7,124,7,116,5,23,0,133,2,25,0,125,3,116,8, + 124,3,131,1,116,5,107,3,144,1,114,154,116,3,100,8, + 124,0,155,2,157,2,124,0,100,2,141,2,130,1,124,4, + 116,8,124,6,131,1,24,0,124,7,23,0,125,2,116,13, + 124,3,100,9,100,10,133,2,25,0,131,1,125,8,116,13, + 124,3,100,10,100,11,133,2,25,0,131,1,125,9,124,2, + 124,8,107,0,144,1,114,230,116,3,100,12,124,0,155,2, + 157,2,124,0,100,2,141,2,130,1,124,2,124,9,107,0, + 144,2,114,2,116,3,100,13,124,0,155,2,157,2,124,0, + 100,2,141,2,130,1,124,2,124,8,56,0,125,2,124,2, + 124,9,24,0,125,10,124,10,100,6,107,0,144,2,114,46, + 116,3,100,14,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,105,0,125,11,100,6,125,12,122,14,124,1,160,4, + 124,2,161,1,1,0,87,0,110,38,4,0,116,2,144,2, + 121,106,1,0,1,0,1,0,116,3,100,4,124,0,155,2, + 157,2,124,0,100,2,141,2,130,1,89,0,110,2,48,0, + 124,1,160,7,100,15,161,1,125,3,116,8,124,3,131,1, + 100,5,107,0,144,2,114,140,116,14,100,16,131,1,130,1, + 124,3,100,0,100,5,133,2,25,0,100,17,107,3,144,2, + 114,162,144,4,113,208,116,8,124,3,131,1,100,15,107,3, + 144,2,114,184,116,14,100,16,131,1,130,1,116,15,124,3, + 100,18,100,19,133,2,25,0,131,1,125,13,116,15,124,3, + 100,19,100,9,133,2,25,0,131,1,125,14,116,15,124,3, + 100,9,100,20,133,2,25,0,131,1,125,15,116,15,124,3, + 100,20,100,10,133,2,25,0,131,1,125,16,116,13,124,3, + 100,10,100,11,133,2,25,0,131,1,125,17,116,13,124,3, + 100,11,100,21,133,2,25,0,131,1,125,18,116,13,124,3, + 100,21,100,22,133,2,25,0,131,1,125,4,116,15,124,3, + 100,22,100,23,133,2,25,0,131,1,125,19,116,15,124,3, + 100,23,100,24,133,2,25,0,131,1,125,20,116,15,124,3, + 100,24,100,25,133,2,25,0,131,1,125,21,116,13,124,3, + 100,26,100,15,133,2,25,0,131,1,125,22,124,19,124,20, + 23,0,124,21,23,0,125,8,124,22,124,9,107,4,144,3, + 114,144,116,3,100,27,124,0,155,2,157,2,124,0,100,2, + 141,2,130,1,124,22,124,10,55,0,125,22,122,14,124,1, + 160,7,124,19,161,1,125,23,87,0,110,38,4,0,116,2, + 144,3,121,204,1,0,1,0,1,0,116,3,100,4,124,0, + 155,2,157,2,124,0,100,2,141,2,130,1,89,0,110,2, + 48,0,116,8,124,23,131,1,124,19,107,3,144,3,114,238, + 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,122,50,116,8,124,1,160,7,124,8,124,19,24,0, + 161,1,131,1,124,8,124,19,24,0,107,3,144,4,114,30, + 116,3,100,4,124,0,155,2,157,2,124,0,100,2,141,2, + 130,1,87,0,110,38,4,0,116,2,144,4,121,70,1,0, + 1,0,1,0,116,3,100,4,124,0,155,2,157,2,124,0, + 100,2,141,2,130,1,89,0,110,2,48,0,124,13,100,28, + 64,0,144,4,114,92,124,23,160,16,161,0,125,23,110,52, + 122,14,124,23,160,16,100,29,161,1,125,23,87,0,110,36, + 4,0,116,17,144,4,121,142,1,0,1,0,1,0,124,23, + 160,16,100,30,161,1,160,18,116,19,161,1,125,23,89,0, + 110,2,48,0,124,23,160,20,100,31,116,21,161,2,125,23, + 116,22,160,23,124,0,124,23,161,2,125,24,124,24,124,14, + 124,18,124,4,124,22,124,15,124,16,124,17,102,8,125,25, + 124,25,124,11,124,23,60,0,124,12,100,32,55,0,125,12, + 144,2,113,108,87,0,100,0,4,0,4,0,131,3,1,0, + 110,18,49,0,144,4,115,230,48,0,1,0,1,0,1,0, + 89,0,1,0,116,24,160,25,100,33,124,12,124,0,161,3, + 1,0,124,11,83,0,41,34,78,122,21,99,97,110,39,116, + 32,111,112,101,110,32,90,105,112,32,102,105,108,101,58,32, + 114,12,0,0,0,114,86,0,0,0,250,21,99,97,110,39, + 116,32,114,101,97,100,32,90,105,112,32,102,105,108,101,58, + 32,233,4,0,0,0,114,0,0,0,0,122,16,110,111,116, + 32,97,32,90,105,112,32,102,105,108,101,58,32,122,18,99, + 111,114,114,117,112,116,32,90,105,112,32,102,105,108,101,58, + 32,233,12,0,0,0,233,16,0,0,0,233,20,0,0,0, + 122,28,98,97,100,32,99,101,110,116,114,97,108,32,100,105, + 114,101,99,116,111,114,121,32,115,105,122,101,58,32,122,30, + 98,97,100,32,99,101,110,116,114,97,108,32,100,105,114,101, + 99,116,111,114,121,32,111,102,102,115,101,116,58,32,122,38, + 98,97,100,32,99,101,110,116,114,97,108,32,100,105,114,101, + 99,116,111,114,121,32,115,105,122,101,32,111,114,32,111,102, + 102,115,101,116,58,32,233,46,0,0,0,250,27,69,79,70, + 32,114,101,97,100,32,119,104,101,114,101,32,110,111,116,32, + 101,120,112,101,99,116,101,100,115,4,0,0,0,80,75,1, + 2,233,8,0,0,0,233,10,0,0,0,233,14,0,0,0, + 233,24,0,0,0,233,28,0,0,0,233,30,0,0,0,233, + 32,0,0,0,233,34,0,0,0,233,42,0,0,0,122,25, + 98,97,100,32,108,111,99,97,108,32,104,101,97,100,101,114, + 32,111,102,102,115,101,116,58,32,105,0,8,0,0,218,5, + 97,115,99,105,105,90,6,108,97,116,105,110,49,250,1,47, + 114,5,0,0,0,122,33,122,105,112,105,109,112,111,114,116, + 58,32,102,111,117,110,100,32,123,125,32,110,97,109,101,115, + 32,105,110,32,123,33,114,125,41,26,218,3,95,105,111,218, + 9,111,112,101,110,95,99,111,100,101,114,22,0,0,0,114, + 3,0,0,0,218,4,115,101,101,107,218,20,69,78,68,95, + 67,69,78,84,82,65,76,95,68,73,82,95,83,73,90,69, + 90,4,116,101,108,108,218,4,114,101,97,100,114,51,0,0, + 0,218,18,83,84,82,73,78,71,95,69,78,68,95,65,82, + 67,72,73,86,69,218,3,109,97,120,218,15,77,65,88,95, + 67,79,77,77,69,78,84,95,76,69,78,218,5,114,102,105, + 110,100,114,2,0,0,0,218,8,69,79,70,69,114,114,111, + 114,114,1,0,0,0,114,62,0,0,0,218,18,85,110,105, + 99,111,100,101,68,101,99,111,100,101,69,114,114,111,114,218, + 9,116,114,97,110,115,108,97,116,101,218,11,99,112,52,51, + 55,95,116,97,98,108,101,114,19,0,0,0,114,20,0,0, + 0,114,21,0,0,0,114,30,0,0,0,114,76,0,0,0, + 114,77,0,0,0,41,26,114,29,0,0,0,218,2,102,112, + 90,15,104,101,97,100,101,114,95,112,111,115,105,116,105,111, + 110,218,6,98,117,102,102,101,114,218,9,102,105,108,101,95, + 115,105,122,101,90,17,109,97,120,95,99,111,109,109,101,110, + 116,95,115,116,97,114,116,218,4,100,97,116,97,90,3,112, + 111,115,218,11,104,101,97,100,101,114,95,115,105,122,101,90, + 13,104,101,97,100,101,114,95,111,102,102,115,101,116,90,10, + 97,114,99,95,111,102,102,115,101,116,114,33,0,0,0,218, + 5,99,111,117,110,116,218,5,102,108,97,103,115,218,8,99, + 111,109,112,114,101,115,115,218,4,116,105,109,101,218,4,100, + 97,116,101,218,3,99,114,99,218,9,100,97,116,97,95,115, + 105,122,101,218,9,110,97,109,101,95,115,105,122,101,218,10, + 101,120,116,114,97,95,115,105,122,101,90,12,99,111,109,109, + 101,110,116,95,115,105,122,101,218,11,102,105,108,101,95,111, + 102,102,115,101,116,114,59,0,0,0,114,13,0,0,0,218, + 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,114,27,0,0,0,96,1,0,0,115,212,0,0,0,0, + 1,2,1,14,1,12,1,24,2,8,1,2,1,14,1,8, + 1,14,1,12,1,24,1,12,1,18,1,18,3,2,1,12, + 1,12,1,12,1,10,1,2,255,12,2,8,1,2,255,2, + 1,2,255,4,2,2,1,10,1,12,1,14,1,10,1,2, + 255,12,2,10,1,10,1,10,1,2,255,6,2,16,1,14, + 1,10,1,2,255,6,2,16,2,16,1,16,1,10,1,18, + 1,10,1,18,1,8,1,8,1,10,1,18,2,4,2,4, + 1,2,1,14,1,14,1,24,2,10,1,14,1,8,2,18, + 1,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, + 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, + 1,18,1,8,2,2,1,14,1,14,1,24,1,14,1,18, + 4,2,1,28,1,22,1,14,1,24,2,10,2,10,3,2, + 1,14,1,14,1,22,2,12,1,12,1,20,1,8,1,44, + 1,14,1,114,27,0,0,0,117,190,1,0,0,0,1,2, + 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, + 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34, + 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50, + 51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66, + 67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82, + 83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98, + 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114, + 115,116,117,118,119,120,121,122,123,124,125,126,127,195,135,195, + 188,195,169,195,162,195,164,195,160,195,165,195,167,195,170,195, + 171,195,168,195,175,195,174,195,172,195,132,195,133,195,137,195, + 166,195,134,195,180,195,182,195,178,195,187,195,185,195,191,195, + 150,195,156,194,162,194,163,194,165,226,130,167,198,146,195,161, + 195,173,195,179,195,186,195,177,195,145,194,170,194,186,194,191, + 226,140,144,194,172,194,189,194,188,194,161,194,171,194,187,226, + 150,145,226,150,146,226,150,147,226,148,130,226,148,164,226,149, + 161,226,149,162,226,149,150,226,149,149,226,149,163,226,149,145, + 226,149,151,226,149,157,226,149,156,226,149,155,226,148,144,226, + 148,148,226,148,180,226,148,172,226,148,156,226,148,128,226,148, + 188,226,149,158,226,149,159,226,149,154,226,149,148,226,149,169, + 226,149,166,226,149,160,226,149,144,226,149,172,226,149,167,226, + 149,168,226,149,164,226,149,165,226,149,153,226,149,152,226,149, + 146,226,149,147,226,149,171,226,149,170,226,148,152,226,148,140, + 226,150,136,226,150,132,226,150,140,226,150,144,226,150,128,206, + 177,195,159,206,147,207,128,206,163,207,131,194,181,207,132,206, + 166,206,152,206,169,206,180,226,136,158,207,134,206,181,226,136, + 169,226,137,161,194,177,226,137,165,226,137,164,226,140,160,226, + 140,161,195,183,226,137,136,194,176,226,136,153,194,183,226,136, + 154,226,129,191,194,178,226,150,160,194,160,99,0,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0, + 67,0,0,0,115,110,0,0,0,116,0,114,22,116,1,160, + 2,100,1,161,1,1,0,116,3,100,2,131,1,130,1,100, + 3,97,0,122,62,122,16,100,4,100,5,108,4,109,5,125, + 0,1,0,87,0,110,36,4,0,116,6,121,80,1,0,1, + 0,1,0,116,1,160,2,100,1,161,1,1,0,116,3,100, + 2,131,1,130,1,89,0,110,2,48,0,87,0,100,6,97, + 0,110,6,100,6,97,0,48,0,116,1,160,2,100,7,161, + 1,1,0,124,0,83,0,41,8,78,122,27,122,105,112,105, + 109,112,111,114,116,58,32,122,108,105,98,32,85,78,65,86, + 65,73,76,65,66,76,69,250,41,99,97,110,39,116,32,100, + 101,99,111,109,112,114,101,115,115,32,100,97,116,97,59,32, + 122,108,105,98,32,110,111,116,32,97,118,97,105,108,97,98, + 108,101,84,114,0,0,0,0,169,1,218,10,100,101,99,111, + 109,112,114,101,115,115,70,122,25,122,105,112,105,109,112,111, + 114,116,58,32,122,108,105,98,32,97,118,97,105,108,97,98, + 108,101,41,7,218,15,95,105,109,112,111,114,116,105,110,103, + 95,122,108,105,98,114,76,0,0,0,114,77,0,0,0,114, + 3,0,0,0,90,4,122,108,105,98,114,141,0,0,0,218, + 9,69,120,99,101,112,116,105,111,110,114,140,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,20, + 95,103,101,116,95,100,101,99,111,109,112,114,101,115,115,95, + 102,117,110,99,254,1,0,0,115,24,0,0,0,0,2,4, + 3,10,1,8,2,4,1,4,1,16,1,12,1,10,1,16, + 2,12,2,10,1,114,144,0,0,0,99,2,0,0,0,0, + 0,0,0,0,0,0,0,17,0,0,0,9,0,0,0,67, + 0,0,0,115,144,1,0,0,124,1,92,8,125,2,125,3, + 125,4,125,5,125,6,125,7,125,8,125,9,124,4,100,1, + 107,0,114,36,116,0,100,2,131,1,130,1,116,1,160,2, + 124,0,161,1,144,1,143,14,125,10,122,14,124,10,160,3, + 124,6,161,1,1,0,87,0,110,36,4,0,116,4,121,100, + 1,0,1,0,1,0,116,0,100,3,124,0,155,2,157,2, + 124,0,100,4,141,2,130,1,89,0,110,2,48,0,124,10, + 160,5,100,5,161,1,125,11,116,6,124,11,131,1,100,5, + 107,3,114,132,116,7,100,6,131,1,130,1,124,11,100,0, + 100,7,133,2,25,0,100,8,107,3,114,166,116,0,100,9, + 124,0,155,2,157,2,124,0,100,4,141,2,130,1,116,8, + 124,11,100,10,100,11,133,2,25,0,131,1,125,12,116,8, + 124,11,100,11,100,5,133,2,25,0,131,1,125,13,100,5, + 124,12,23,0,124,13,23,0,125,14,124,6,124,14,55,0, + 125,6,122,14,124,10,160,3,124,6,161,1,1,0,87,0, + 110,38,4,0,116,4,144,1,121,14,1,0,1,0,1,0, + 116,0,100,3,124,0,155,2,157,2,124,0,100,4,141,2, + 130,1,89,0,110,2,48,0,124,10,160,5,124,4,161,1, + 125,15,116,6,124,15,131,1,124,4,107,3,144,1,114,48, + 116,4,100,12,131,1,130,1,87,0,100,0,4,0,4,0, + 131,3,1,0,110,18,49,0,144,1,115,70,48,0,1,0, + 1,0,1,0,89,0,1,0,124,3,100,1,107,2,144,1, + 114,94,124,15,83,0,122,10,116,9,131,0,125,16,87,0, + 110,28,4,0,116,10,144,1,121,132,1,0,1,0,1,0, + 116,0,100,13,131,1,130,1,89,0,110,2,48,0,124,16, + 124,15,100,14,131,2,83,0,41,15,78,114,0,0,0,0, + 122,18,110,101,103,97,116,105,118,101,32,100,97,116,97,32, + 115,105,122,101,114,92,0,0,0,114,12,0,0,0,114,104, + 0,0,0,114,98,0,0,0,114,93,0,0,0,115,4,0, + 0,0,80,75,3,4,122,23,98,97,100,32,108,111,99,97, + 108,32,102,105,108,101,32,104,101,97,100,101,114,58,32,233, + 26,0,0,0,114,103,0,0,0,122,26,122,105,112,105,109, + 112,111,114,116,58,32,99,97,110,39,116,32,114,101,97,100, + 32,100,97,116,97,114,139,0,0,0,105,241,255,255,255,41, + 11,114,3,0,0,0,114,110,0,0,0,114,111,0,0,0, + 114,112,0,0,0,114,22,0,0,0,114,114,0,0,0,114, + 51,0,0,0,114,119,0,0,0,114,1,0,0,0,114,144, + 0,0,0,114,143,0,0,0,41,17,114,29,0,0,0,114, + 54,0,0,0,90,8,100,97,116,97,112,97,116,104,114,130, + 0,0,0,114,134,0,0,0,114,125,0,0,0,114,137,0, + 0,0,114,131,0,0,0,114,132,0,0,0,114,133,0,0, + 0,114,123,0,0,0,114,124,0,0,0,114,135,0,0,0, + 114,136,0,0,0,114,127,0,0,0,90,8,114,97,119,95, + 100,97,116,97,114,141,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,52,0,0,0,19,2,0, + 0,115,62,0,0,0,0,1,20,1,8,1,8,2,14,2, + 2,1,14,1,12,1,24,1,10,1,12,1,8,2,16,2, + 18,2,16,1,16,1,12,1,8,1,2,1,14,1,14,1, + 24,1,10,1,14,1,40,2,10,2,4,3,2,1,10,1, + 14,1,14,1,114,52,0,0,0,99,2,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,16,0,0,0,116,0,124,0,124,1,24,0,131, + 1,100,1,107,1,83,0,41,2,78,114,5,0,0,0,41, + 1,218,3,97,98,115,41,2,90,2,116,49,90,2,116,50, + 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, + 9,95,101,113,95,109,116,105,109,101,65,2,0,0,115,2, + 0,0,0,0,2,114,147,0,0,0,99,5,0,0,0,0, + 0,0,0,0,0,0,0,14,0,0,0,8,0,0,0,67, + 0,0,0,115,56,1,0,0,124,3,124,2,100,1,156,2, + 125,5,122,18,116,0,160,1,124,4,124,3,124,5,161,3, + 125,6,87,0,110,20,4,0,116,2,121,48,1,0,1,0, + 1,0,89,0,100,0,83,0,48,0,124,6,100,2,64,0, + 100,3,107,3,125,7,124,7,114,178,124,6,100,4,64,0, + 100,3,107,3,125,8,116,3,106,4,100,5,107,3,114,176, + 124,8,115,102,116,3,106,4,100,6,107,2,114,176,116,5, + 124,0,124,2,131,2,125,9,124,9,100,0,117,1,114,176, + 116,3,160,6,116,0,106,7,124,9,161,2,125,10,122,20, + 116,0,160,8,124,4,124,10,124,3,124,5,161,4,1,0, + 87,0,110,20,4,0,116,2,121,174,1,0,1,0,1,0, + 89,0,100,0,83,0,48,0,110,84,116,9,124,0,124,2, + 131,2,92,2,125,11,125,12,124,11,144,1,114,6,116,10, + 116,11,124,4,100,7,100,8,133,2,25,0,131,1,124,11, + 131,2,114,242,116,11,124,4,100,8,100,9,133,2,25,0, + 131,1,124,12,107,3,144,1,114,6,116,12,160,13,100,10, + 124,3,155,2,157,2,161,1,1,0,100,0,83,0,116,14, + 160,15,124,4,100,9,100,0,133,2,25,0,161,1,125,13, + 116,16,124,13,116,17,131,2,144,1,115,52,116,18,100,11, + 124,1,155,2,100,12,157,3,131,1,130,1,124,13,83,0, + 41,13,78,41,2,114,59,0,0,0,114,13,0,0,0,114, + 5,0,0,0,114,0,0,0,0,114,86,0,0,0,90,5, + 110,101,118,101,114,90,6,97,108,119,97,121,115,114,99,0, + 0,0,114,94,0,0,0,114,95,0,0,0,122,22,98,121, + 116,101,99,111,100,101,32,105,115,32,115,116,97,108,101,32, + 102,111,114,32,122,16,99,111,109,112,105,108,101,100,32,109, + 111,100,117,108,101,32,122,21,32,105,115,32,110,111,116,32, + 97,32,99,111,100,101,32,111,98,106,101,99,116,41,19,114, + 21,0,0,0,90,13,95,99,108,97,115,115,105,102,121,95, + 112,121,99,114,75,0,0,0,218,4,95,105,109,112,90,21, + 99,104,101,99,107,95,104,97,115,104,95,98,97,115,101,100, + 95,112,121,99,115,218,15,95,103,101,116,95,112,121,99,95, + 115,111,117,114,99,101,218,11,115,111,117,114,99,101,95,104, + 97,115,104,90,17,95,82,65,87,95,77,65,71,73,67,95, + 78,85,77,66,69,82,90,18,95,118,97,108,105,100,97,116, + 101,95,104,97,115,104,95,112,121,99,218,29,95,103,101,116, + 95,109,116,105,109,101,95,97,110,100,95,115,105,122,101,95, + 111,102,95,115,111,117,114,99,101,114,147,0,0,0,114,2, + 0,0,0,114,76,0,0,0,114,77,0,0,0,218,7,109, + 97,114,115,104,97,108,90,5,108,111,97,100,115,114,15,0, + 0,0,218,10,95,99,111,100,101,95,116,121,112,101,218,9, + 84,121,112,101,69,114,114,111,114,41,14,114,32,0,0,0, + 114,53,0,0,0,114,63,0,0,0,114,38,0,0,0,114, + 126,0,0,0,90,11,101,120,99,95,100,101,116,97,105,108, + 115,114,129,0,0,0,90,10,104,97,115,104,95,98,97,115, + 101,100,90,12,99,104,101,99,107,95,115,111,117,114,99,101, + 90,12,115,111,117,114,99,101,95,98,121,116,101,115,114,150, + 0,0,0,90,12,115,111,117,114,99,101,95,109,116,105,109, + 101,90,11,115,111,117,114,99,101,95,115,105,122,101,114,46, + 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,218,15,95,117,110,109,97,114,115,104,97,108,95,99, + 111,100,101,75,2,0,0,115,82,0,0,0,0,2,2,1, + 2,254,6,5,2,1,18,1,12,1,8,2,12,1,4,1, + 12,1,10,1,2,255,2,1,8,255,2,2,10,1,8,1, + 4,1,4,1,2,254,4,5,2,1,4,1,8,255,8,2, + 12,1,10,3,8,255,6,3,6,3,22,1,18,255,4,2, + 4,1,8,255,4,2,4,2,18,1,12,1,16,1,114,155, + 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,4,0,0,0,67,0,0,0,115,28,0,0, + 0,124,0,160,0,100,1,100,2,161,2,125,0,124,0,160, + 0,100,3,100,2,161,2,125,0,124,0,83,0,41,4,78, + 115,2,0,0,0,13,10,243,1,0,0,0,10,243,1,0, + 0,0,13,41,1,114,19,0,0,0,41,1,218,6,115,111, + 117,114,99,101,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,218,23,95,110,111,114,109,97,108,105,122,101,95, + 108,105,110,101,95,101,110,100,105,110,103,115,126,2,0,0, + 115,6,0,0,0,0,1,12,1,12,1,114,159,0,0,0, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,6,0,0,0,67,0,0,0,115,24,0,0,0,116,0, + 124,1,131,1,125,1,116,1,124,1,124,0,100,1,100,2, + 100,3,141,4,83,0,41,4,78,114,74,0,0,0,84,41, + 1,90,12,100,111,110,116,95,105,110,104,101,114,105,116,41, + 2,114,159,0,0,0,218,7,99,111,109,112,105,108,101,41, + 2,114,53,0,0,0,114,158,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,218,15,95,99,111,109, + 112,105,108,101,95,115,111,117,114,99,101,133,2,0,0,115, + 4,0,0,0,0,1,8,1,114,161,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,11,0, + 0,0,67,0,0,0,115,68,0,0,0,116,0,160,1,124, + 0,100,1,63,0,100,2,23,0,124,0,100,3,63,0,100, + 4,64,0,124,0,100,5,64,0,124,1,100,6,63,0,124, + 1,100,3,63,0,100,7,64,0,124,1,100,5,64,0,100, + 8,20,0,100,9,100,9,100,9,102,9,161,1,83,0,41, + 10,78,233,9,0,0,0,105,188,7,0,0,233,5,0,0, + 0,233,15,0,0,0,233,31,0,0,0,233,11,0,0,0, + 233,63,0,0,0,114,86,0,0,0,114,14,0,0,0,41, + 2,114,131,0,0,0,90,6,109,107,116,105,109,101,41,2, + 218,1,100,114,138,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,14,95,112,97,114,115,101,95, + 100,111,115,116,105,109,101,139,2,0,0,115,18,0,0,0, + 0,1,4,1,10,1,10,1,6,1,6,1,10,1,10,1, + 6,249,114,169,0,0,0,99,2,0,0,0,0,0,0,0, + 0,0,0,0,6,0,0,0,10,0,0,0,67,0,0,0, + 115,114,0,0,0,122,82,124,1,100,1,100,0,133,2,25, + 0,100,2,118,0,115,22,74,0,130,1,124,1,100,0,100, + 1,133,2,25,0,125,1,124,0,106,0,124,1,25,0,125, + 2,124,2,100,3,25,0,125,3,124,2,100,4,25,0,125, + 4,124,2,100,5,25,0,125,5,116,1,124,4,124,3,131, + 2,124,5,102,2,87,0,83,0,4,0,116,2,116,3,116, + 4,102,3,121,108,1,0,1,0,1,0,89,0,100,6,83, + 0,48,0,100,0,83,0,41,7,78,114,14,0,0,0,169, + 2,218,1,99,218,1,111,114,163,0,0,0,233,6,0,0, + 0,233,3,0,0,0,41,2,114,0,0,0,0,114,0,0, + 0,0,41,5,114,28,0,0,0,114,169,0,0,0,114,26, + 0,0,0,218,10,73,110,100,101,120,69,114,114,111,114,114, + 154,0,0,0,41,6,114,32,0,0,0,114,13,0,0,0, + 114,54,0,0,0,114,131,0,0,0,114,132,0,0,0,90, + 17,117,110,99,111,109,112,114,101,115,115,101,100,95,115,105, + 122,101,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,114,151,0,0,0,152,2,0,0,115,20,0,0,0,0, + 1,2,2,20,1,12,1,10,3,8,1,8,1,8,1,16, + 1,18,1,114,151,0,0,0,99,2,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,8,0,0,0,67,0,0, + 0,115,84,0,0,0,124,1,100,1,100,0,133,2,25,0, + 100,2,118,0,115,20,74,0,130,1,124,1,100,0,100,1, + 133,2,25,0,125,1,122,14,124,0,106,0,124,1,25,0, + 125,2,87,0,110,20,4,0,116,1,121,66,1,0,1,0, + 1,0,89,0,100,0,83,0,48,0,116,2,124,0,106,3, + 124,2,131,2,83,0,100,0,83,0,41,3,78,114,14,0, + 0,0,114,170,0,0,0,41,4,114,28,0,0,0,114,26, + 0,0,0,114,52,0,0,0,114,29,0,0,0,41,3,114, + 32,0,0,0,114,13,0,0,0,114,54,0,0,0,114,9, + 0,0,0,114,9,0,0,0,114,10,0,0,0,114,149,0, + 0,0,171,2,0,0,115,14,0,0,0,0,2,20,1,12, + 2,2,1,14,1,12,1,8,2,114,149,0,0,0,99,2, + 0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,9, + 0,0,0,67,0,0,0,115,196,0,0,0,116,0,124,0, + 124,1,131,2,125,2,116,1,68,0,93,158,92,3,125,3, + 125,4,125,5,124,2,124,3,23,0,125,6,116,2,106,3, + 100,1,124,0,106,4,116,5,124,6,100,2,100,3,141,5, + 1,0,122,14,124,0,106,6,124,6,25,0,125,7,87,0, + 110,18,4,0,116,7,121,86,1,0,1,0,1,0,89,0, + 113,14,48,0,124,7,100,4,25,0,125,8,116,8,124,0, + 106,4,124,7,131,2,125,9,124,4,114,130,116,9,124,0, + 124,8,124,6,124,1,124,9,131,5,125,10,110,10,116,10, + 124,8,124,9,131,2,125,10,124,10,100,0,117,0,114,150, + 113,14,124,7,100,4,25,0,125,8,124,10,124,5,124,8, + 102,3,2,0,1,0,83,0,113,14,116,11,100,5,124,1, + 155,2,157,2,124,1,100,6,141,2,130,1,100,0,83,0, + 41,7,78,122,13,116,114,121,105,110,103,32,123,125,123,125, + 123,125,114,86,0,0,0,41,1,90,9,118,101,114,98,111, + 115,105,116,121,114,0,0,0,0,114,57,0,0,0,114,58, + 0,0,0,41,12,114,36,0,0,0,114,89,0,0,0,114, + 76,0,0,0,114,77,0,0,0,114,29,0,0,0,114,20, + 0,0,0,114,28,0,0,0,114,26,0,0,0,114,52,0, + 0,0,114,155,0,0,0,114,161,0,0,0,114,3,0,0, + 0,41,11,114,32,0,0,0,114,38,0,0,0,114,13,0, + 0,0,114,90,0,0,0,114,91,0,0,0,114,47,0,0, + 0,114,63,0,0,0,114,54,0,0,0,114,40,0,0,0, + 114,126,0,0,0,114,46,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,44,0,0,0,186,2, + 0,0,115,36,0,0,0,0,1,10,1,14,1,8,1,22, + 1,2,1,14,1,12,1,6,2,8,1,12,1,4,1,18, + 2,10,1,8,3,2,1,8,1,16,2,114,44,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,64,0,0,0,115,60,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,90,4,100,3, + 100,4,132,0,90,5,100,5,100,6,132,0,90,6,100,7, + 100,8,132,0,90,7,100,9,100,10,132,0,90,8,100,11, + 100,12,132,0,90,9,100,13,83,0,41,14,114,80,0,0, + 0,122,165,80,114,105,118,97,116,101,32,99,108,97,115,115, + 32,117,115,101,100,32,116,111,32,115,117,112,112,111,114,116, + 32,90,105,112,73,109,112,111,114,116,46,103,101,116,95,114, + 101,115,111,117,114,99,101,95,114,101,97,100,101,114,40,41, + 46,10,10,32,32,32,32,84,104,105,115,32,99,108,97,115, + 115,32,105,115,32,97,108,108,111,119,101,100,32,116,111,32, + 114,101,102,101,114,101,110,99,101,32,97,108,108,32,116,104, + 101,32,105,110,110,97,114,100,115,32,97,110,100,32,112,114, + 105,118,97,116,101,32,112,97,114,116,115,32,111,102,10,32, + 32,32,32,116,104,101,32,122,105,112,105,109,112,111,114,116, + 101,114,46,10,32,32,32,32,70,99,3,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,0, + 0,0,115,16,0,0,0,124,1,124,0,95,0,124,2,124, + 0,95,1,100,0,83,0,114,88,0,0,0,41,2,114,4, + 0,0,0,114,38,0,0,0,41,3,114,32,0,0,0,114, + 4,0,0,0,114,38,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,34,0,0,0,220,2,0, + 0,115,4,0,0,0,0,1,6,1,122,33,95,90,105,112, + 73,109,112,111,114,116,82,101,115,111,117,114,99,101,82,101, + 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, + 0,0,0,0,0,0,0,0,0,0,5,0,0,0,8,0, + 0,0,67,0,0,0,115,90,0,0,0,124,0,106,0,160, + 1,100,1,100,2,161,2,125,2,124,2,155,0,100,2,124, + 1,155,0,157,3,125,3,100,3,100,4,108,2,109,3,125, + 4,1,0,122,18,124,4,124,0,106,4,160,5,124,3,161, + 1,131,1,87,0,83,0,4,0,116,6,121,84,1,0,1, + 0,1,0,116,7,124,3,131,1,130,1,89,0,110,2,48, + 0,100,0,83,0,41,5,78,114,85,0,0,0,114,109,0, + 0,0,114,0,0,0,0,41,1,218,7,66,121,116,101,115, + 73,79,41,8,114,38,0,0,0,114,19,0,0,0,90,2, + 105,111,114,176,0,0,0,114,4,0,0,0,114,55,0,0, + 0,114,22,0,0,0,218,17,70,105,108,101,78,111,116,70, + 111,117,110,100,69,114,114,111,114,41,5,114,32,0,0,0, + 218,8,114,101,115,111,117,114,99,101,218,16,102,117,108,108, + 110,97,109,101,95,97,115,95,112,97,116,104,114,13,0,0, + 0,114,176,0,0,0,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,13,111,112,101,110,95,114,101,115,111, + 117,114,99,101,224,2,0,0,115,14,0,0,0,0,1,14, + 1,14,1,12,1,2,1,18,1,12,1,122,38,95,90,105, + 112,73,109,112,111,114,116,82,101,115,111,117,114,99,101,82, + 101,97,100,101,114,46,111,112,101,110,95,114,101,115,111,117, + 114,99,101,99,2,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, + 0,116,0,130,1,100,0,83,0,114,88,0,0,0,41,1, + 114,177,0,0,0,41,2,114,32,0,0,0,114,178,0,0, + 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 218,13,114,101,115,111,117,114,99,101,95,112,97,116,104,233, + 2,0,0,115,2,0,0,0,0,4,122,38,95,90,105,112, + 73,109,112,111,114,116,82,101,115,111,117,114,99,101,82,101, + 97,100,101,114,46,114,101,115,111,117,114,99,101,95,112,97, + 116,104,99,2,0,0,0,0,0,0,0,0,0,0,0,4, + 0,0,0,8,0,0,0,67,0,0,0,115,70,0,0,0, + 124,0,106,0,160,1,100,1,100,2,161,2,125,2,124,2, + 155,0,100,2,124,1,155,0,157,3,125,3,122,16,124,0, + 106,2,160,3,124,3,161,1,1,0,87,0,110,20,4,0, + 116,4,121,64,1,0,1,0,1,0,89,0,100,3,83,0, + 48,0,100,4,83,0,41,5,78,114,85,0,0,0,114,109, + 0,0,0,70,84,41,5,114,38,0,0,0,114,19,0,0, + 0,114,4,0,0,0,114,55,0,0,0,114,22,0,0,0, + 41,4,114,32,0,0,0,114,59,0,0,0,114,179,0,0, + 0,114,13,0,0,0,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,11,105,115,95,114,101,115,111,117,114, + 99,101,239,2,0,0,115,14,0,0,0,0,3,14,1,14, + 1,2,1,16,1,12,1,8,1,122,36,95,90,105,112,73, + 109,112,111,114,116,82,101,115,111,117,114,99,101,82,101,97, + 100,101,114,46,105,115,95,114,101,115,111,117,114,99,101,99, + 1,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, + 9,0,0,0,99,0,0,0,115,184,0,0,0,100,1,100, + 2,108,0,109,1,125,1,1,0,124,1,124,0,106,2,160, + 3,124,0,106,4,161,1,131,1,125,2,124,2,160,5,124, + 0,106,2,106,6,161,1,125,3,124,3,106,7,100,3,107, + 2,115,58,74,0,130,1,124,3,106,8,125,4,116,9,131, + 0,125,5,124,0,106,2,106,10,68,0,93,100,125,6,122, + 18,124,1,124,6,131,1,160,5,124,4,161,1,125,7,87, + 0,110,22,4,0,116,11,121,122,1,0,1,0,1,0,89, + 0,113,78,89,0,110,2,48,0,124,7,106,8,106,7,125, + 8,116,12,124,8,131,1,100,1,107,2,114,154,124,7,106, + 7,86,0,1,0,113,78,124,8,124,5,118,1,114,78,124, + 5,160,13,124,8,161,1,1,0,124,8,86,0,1,0,113, + 78,100,0,83,0,41,4,78,114,0,0,0,0,41,1,218, + 4,80,97,116,104,114,60,0,0,0,41,14,90,7,112,97, + 116,104,108,105,98,114,183,0,0,0,114,4,0,0,0,114, + 56,0,0,0,114,38,0,0,0,90,11,114,101,108,97,116, + 105,118,101,95,116,111,114,29,0,0,0,114,59,0,0,0, + 90,6,112,97,114,101,110,116,218,3,115,101,116,114,28,0, + 0,0,114,23,0,0,0,114,51,0,0,0,218,3,97,100, + 100,41,9,114,32,0,0,0,114,183,0,0,0,90,13,102, + 117,108,108,110,97,109,101,95,112,97,116,104,90,13,114,101, + 108,97,116,105,118,101,95,112,97,116,104,90,12,112,97,99, + 107,97,103,101,95,112,97,116,104,90,12,115,117,98,100,105, + 114,115,95,115,101,101,110,218,8,102,105,108,101,110,97,109, + 101,90,8,114,101,108,97,116,105,118,101,90,11,112,97,114, + 101,110,116,95,110,97,109,101,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,8,99,111,110,116,101,110,116, + 115,250,2,0,0,115,34,0,0,0,0,8,12,1,18,1, + 14,3,14,1,6,1,6,1,12,1,2,1,18,1,12,1, + 10,5,8,1,12,1,10,1,8,1,10,1,122,33,95,90, + 105,112,73,109,112,111,114,116,82,101,115,111,117,114,99,101, + 82,101,97,100,101,114,46,99,111,110,116,101,110,116,115,78, + 41,10,114,6,0,0,0,114,7,0,0,0,114,8,0,0, + 0,114,84,0,0,0,114,81,0,0,0,114,34,0,0,0, + 114,180,0,0,0,114,181,0,0,0,114,182,0,0,0,114, + 187,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,80,0,0,0,212,2,0, + 0,115,14,0,0,0,8,1,4,5,4,2,8,4,8,9, + 8,6,8,11,114,80,0,0,0,41,45,114,84,0,0,0, + 90,26,95,102,114,111,122,101,110,95,105,109,112,111,114,116, + 108,105,98,95,101,120,116,101,114,110,97,108,114,21,0,0, + 0,114,1,0,0,0,114,2,0,0,0,90,17,95,102,114, + 111,122,101,110,95,105,109,112,111,114,116,108,105,98,114,76, + 0,0,0,114,148,0,0,0,114,110,0,0,0,114,152,0, + 0,0,114,67,0,0,0,114,131,0,0,0,90,7,95,95, + 97,108,108,95,95,114,20,0,0,0,90,15,112,97,116,104, + 95,115,101,112,97,114,97,116,111,114,115,114,18,0,0,0, + 114,75,0,0,0,114,3,0,0,0,114,25,0,0,0,218, + 4,116,121,112,101,114,70,0,0,0,114,113,0,0,0,114, + 115,0,0,0,114,117,0,0,0,114,4,0,0,0,114,89, + 0,0,0,114,36,0,0,0,114,37,0,0,0,114,35,0, + 0,0,114,27,0,0,0,114,122,0,0,0,114,142,0,0, + 0,114,144,0,0,0,114,52,0,0,0,114,147,0,0,0, + 114,155,0,0,0,218,8,95,95,99,111,100,101,95,95,114, + 153,0,0,0,114,159,0,0,0,114,161,0,0,0,114,169, + 0,0,0,114,151,0,0,0,114,149,0,0,0,114,44,0, + 0,0,114,80,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,8,60,109,111, + 100,117,108,101,62,1,0,0,0,115,88,0,0,0,4,16, + 8,1,16,1,8,1,8,1,8,1,8,1,8,1,8,2, + 8,3,6,1,14,3,16,4,4,2,8,2,4,1,4,1, + 4,2,14,127,0,127,0,1,12,1,12,1,2,1,2,252, + 4,9,8,4,8,9,8,31,8,126,2,254,2,29,4,5, + 8,21,8,46,8,10,8,46,10,5,8,7,8,6,8,13, + 8,19,8,15,8,26, +}; diff --git a/contrib/tools/python3/src/Python/initconfig.c b/contrib/tools/python3/src/Python/initconfig.c index f14983abd0..9c109cef2c 100644 --- a/contrib/tools/python3/src/Python/initconfig.c +++ b/contrib/tools/python3/src/Python/initconfig.c @@ -1,2765 +1,2765 @@ -#include "Python.h" -#include "pycore_fileutils.h" // _Py_HasFileSystemDefaultEncodeErrors -#include "pycore_getopt.h" // _PyOS_GetOpt() -#include "pycore_initconfig.h" // _PyStatus_OK() -#include "pycore_interp.h" // _PyInterpreterState.runtime -#include "pycore_pathconfig.h" // _Py_path_config -#include "pycore_pyerrors.h" // _PyErr_Fetch() -#include "pycore_pylifecycle.h" // _Py_PreInitializeFromConfig() -#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() -#include "pycore_pystate.h" // _PyThreadState_GET() - -#include "osdefs.h" // DELIM -#include <locale.h> // setlocale() -#ifdef HAVE_LANGINFO_H -# include <langinfo.h> // nl_langinfo(CODESET) -#endif -#if defined(MS_WINDOWS) || defined(__CYGWIN__) -# include <windows.h> // GetACP() -# ifdef HAVE_IO_H -# include <io.h> -# endif -# ifdef HAVE_FCNTL_H -# include <fcntl.h> // O_BINARY -# endif -#endif - -#ifndef PLATLIBDIR -# error "PLATLIBDIR macro must be defined" -#endif - - -/* --- Command line options --------------------------------------- */ - -/* Short usage message (with %s for argv0) */ -static const char usage_line[] = -"usage: %ls [option] ... [-c cmd | -m mod | file | -] [arg] ...\n"; - -/* Long usage message, split into parts < 512 bytes */ -static const char usage_1[] = "\ -Options and arguments (and corresponding environment variables):\n\ --b : issue warnings about str(bytes_instance), str(bytearray_instance)\n\ - and comparing bytes/bytearray with str. (-bb: issue errors)\n\ --B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\ --c cmd : program passed in as string (terminates option list)\n\ --d : turn on parser debugging output (for experts only, only works on\n\ - debug builds); also PYTHONDEBUG=x\n\ --E : ignore PYTHON* environment variables (such as PYTHONPATH)\n\ --h : print this help message and exit (also --help)\n\ -"; -static const char usage_2[] = "\ --i : inspect interactively after running script; forces a prompt even\n\ - if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\ --I : isolate Python from the user's environment (implies -E and -s)\n\ --m mod : run library module as a script (terminates option list)\n\ --O : remove assert and __debug__-dependent statements; add .opt-1 before\n\ - .pyc extension; also PYTHONOPTIMIZE=x\n\ --OO : do -O changes and also discard docstrings; add .opt-2 before\n\ - .pyc extension\n\ --q : don't print version and copyright messages on interactive startup\n\ --s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ --S : don't imply 'import site' on initialization\n\ -"; -static const char usage_3[] = "\ --u : force the stdout and stderr streams to be unbuffered;\n\ - this option has no effect on stdin; also PYTHONUNBUFFERED=x\n\ --v : verbose (trace import statements); also PYTHONVERBOSE=x\n\ - can be supplied multiple times to increase verbosity\n\ --V : print the Python version number and exit (also --version)\n\ - when given twice, print more information about the build\n\ --W arg : warning control; arg is action:message:category:module:lineno\n\ - also PYTHONWARNINGS=arg\n\ --x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ --X opt : set implementation-specific option. The following options are available:\n\ -\n\ - -X faulthandler: enable faulthandler\n\ - -X oldparser: enable the traditional LL(1) parser; also PYTHONOLDPARSER\n\ - -X showrefcount: output the total reference count and number of used\n\ - memory blocks when the program finishes or after each statement in the\n\ - interactive interpreter. This only works on debug builds\n\ - -X tracemalloc: start tracing Python memory allocations using the\n\ - tracemalloc module. By default, only the most recent frame is stored in a\n\ - traceback of a trace. Use -X tracemalloc=NFRAME to start tracing with a\n\ - traceback limit of NFRAME frames\n\ - -X importtime: show how long each import takes. It shows module name,\n\ - cumulative time (including nested imports) and self time (excluding\n\ - nested imports). Note that its output may be broken in multi-threaded\n\ - application. Typical usage is python3 -X importtime -c 'import asyncio'\n\ - -X dev: enable CPython's \"development mode\", introducing additional runtime\n\ - checks which are too expensive to be enabled by default. Effect of the\n\ - developer mode:\n\ - * Add default warning filter, as -W default\n\ - * Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks() C function\n\ - * Enable the faulthandler module to dump the Python traceback on a crash\n\ - * Enable asyncio debug mode\n\ - * Set the dev_mode attribute of sys.flags to True\n\ - * io.IOBase destructor logs close() exceptions\n\ - -X utf8: enable UTF-8 mode for operating system interfaces, overriding the default\n\ - locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode (even when it would\n\ - otherwise activate automatically)\n\ - -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\ - given directory instead of to the code tree\n\ -\n\ ---check-hash-based-pycs always|default|never:\n\ - control how Python invalidates hash-based .pyc files\n\ -"; -static const char usage_4[] = "\ -file : program read from script file\n\ -- : program read from stdin (default; interactive mode if a tty)\n\ -arg ...: arguments passed to program in sys.argv[1:]\n\n\ -Other environment variables:\n\ -PYTHONSTARTUP: file executed on interactive startup (no default)\n\ -PYTHONPATH : '%lc'-separated list of directories prefixed to the\n\ - default module search path. The result is sys.path.\n\ -"; -static const char usage_5[] = -"PYTHONHOME : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n" -" The default module search path uses %s.\n" -"PYTHONPLATLIBDIR : override sys.platlibdir.\n" -"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n" -"PYTHONUTF8: if set to 1, enable the UTF-8 mode.\n" -"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n" -"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"; -static const char usage_6[] = -"PYTHONHASHSEED: if this variable is set to 'random', a random value is used\n" -" to seed the hashes of str and bytes objects. It can also be set to an\n" -" integer in the range [0,4294967295] to get hash values with a\n" -" predictable seed.\n" -"PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" -" on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" -" hooks.\n" -"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" -" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" -" locale coercion and locale compatibility warnings on stderr.\n" -"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n" -" debugger. It can be set to the callable of your debugger of choice.\n" -"PYTHONDEVMODE: enable the development mode.\n" -"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"; - -#if defined(MS_WINDOWS) -# define PYTHONHOMEHELP "<prefix>\\python{major}{minor}" -#else -# define PYTHONHOMEHELP "<prefix>/lib/pythonX.X" -#endif - - -/* --- Global configuration variables ----------------------------- */ - -/* UTF-8 mode (PEP 540): if equals to 1, use the UTF-8 encoding, and change - stdin and stdout error handler to "surrogateescape". */ -int Py_UTF8Mode = 0; -int Py_DebugFlag = 0; /* Needed by parser.c */ -int Py_VerboseFlag = 0; /* Needed by import.c */ -int Py_QuietFlag = 0; /* Needed by sysmodule.c */ -int Py_InteractiveFlag = 0; /* Needed by Py_FdIsInteractive() below */ -int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */ -int Py_OptimizeFlag = 0; /* Needed by compile.c */ -int Py_NoSiteFlag = 0; /* Suppress 'import site' */ -int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ -int Py_FrozenFlag = 1; /* Needed by getpath.c */ -int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */ -int Py_DontWriteBytecodeFlag = 0; /* Suppress writing bytecode files (*.pyc) */ -int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ -int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ -int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */ -int Py_IsolatedFlag = 0; /* for -I, isolate from user's env */ -#ifdef MS_WINDOWS -int Py_LegacyWindowsFSEncodingFlag = 0; /* Uses mbcs instead of utf-8 */ -int Py_LegacyWindowsStdioFlag = 0; /* Uses FileIO instead of WindowsConsoleIO */ -#endif - - -static PyObject * -_Py_GetGlobalVariablesAsDict(void) -{ - PyObject *dict, *obj; - - dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - -#define SET_ITEM(KEY, EXPR) \ - do { \ - obj = (EXPR); \ - if (obj == NULL) { \ - return NULL; \ - } \ - int res = PyDict_SetItemString(dict, (KEY), obj); \ - Py_DECREF(obj); \ - if (res < 0) { \ - goto fail; \ - } \ - } while (0) -#define SET_ITEM_INT(VAR) \ - SET_ITEM(#VAR, PyLong_FromLong(VAR)) -#define FROM_STRING(STR) \ - ((STR != NULL) ? \ - PyUnicode_FromString(STR) \ - : (Py_INCREF(Py_None), Py_None)) -#define SET_ITEM_STR(VAR) \ - SET_ITEM(#VAR, FROM_STRING(VAR)) - - SET_ITEM_STR(Py_FileSystemDefaultEncoding); - SET_ITEM_INT(Py_HasFileSystemDefaultEncoding); - SET_ITEM_STR(Py_FileSystemDefaultEncodeErrors); - SET_ITEM_INT(_Py_HasFileSystemDefaultEncodeErrors); - - SET_ITEM_INT(Py_UTF8Mode); - SET_ITEM_INT(Py_DebugFlag); - SET_ITEM_INT(Py_VerboseFlag); - SET_ITEM_INT(Py_QuietFlag); - SET_ITEM_INT(Py_InteractiveFlag); - SET_ITEM_INT(Py_InspectFlag); - - SET_ITEM_INT(Py_OptimizeFlag); - SET_ITEM_INT(Py_NoSiteFlag); - SET_ITEM_INT(Py_BytesWarningFlag); - SET_ITEM_INT(Py_FrozenFlag); - SET_ITEM_INT(Py_IgnoreEnvironmentFlag); - SET_ITEM_INT(Py_DontWriteBytecodeFlag); - SET_ITEM_INT(Py_NoUserSiteDirectory); - SET_ITEM_INT(Py_UnbufferedStdioFlag); - SET_ITEM_INT(Py_HashRandomizationFlag); - SET_ITEM_INT(Py_IsolatedFlag); - -#ifdef MS_WINDOWS - SET_ITEM_INT(Py_LegacyWindowsFSEncodingFlag); - SET_ITEM_INT(Py_LegacyWindowsStdioFlag); -#endif - - return dict; - -fail: - Py_DECREF(dict); - return NULL; - -#undef FROM_STRING -#undef SET_ITEM -#undef SET_ITEM_INT -#undef SET_ITEM_STR -} - - -/* --- PyStatus ----------------------------------------------- */ - -PyStatus PyStatus_Ok(void) -{ return _PyStatus_OK(); } - -PyStatus PyStatus_Error(const char *err_msg) -{ - return (PyStatus){._type = _PyStatus_TYPE_ERROR, - .err_msg = err_msg}; -} - -PyStatus PyStatus_NoMemory(void) -{ return PyStatus_Error("memory allocation failed"); } - -PyStatus PyStatus_Exit(int exitcode) -{ return _PyStatus_EXIT(exitcode); } - - -int PyStatus_IsError(PyStatus status) -{ return _PyStatus_IS_ERROR(status); } - -int PyStatus_IsExit(PyStatus status) -{ return _PyStatus_IS_EXIT(status); } - -int PyStatus_Exception(PyStatus status) -{ return _PyStatus_EXCEPTION(status); } - - -/* --- PyWideStringList ------------------------------------------------ */ - -#ifndef NDEBUG -int -_PyWideStringList_CheckConsistency(const PyWideStringList *list) -{ - assert(list->length >= 0); - if (list->length != 0) { - assert(list->items != NULL); - } - for (Py_ssize_t i = 0; i < list->length; i++) { - assert(list->items[i] != NULL); - } - return 1; -} -#endif /* Py_DEBUG */ - - -void -_PyWideStringList_Clear(PyWideStringList *list) -{ - assert(_PyWideStringList_CheckConsistency(list)); - for (Py_ssize_t i=0; i < list->length; i++) { - PyMem_RawFree(list->items[i]); - } - PyMem_RawFree(list->items); - list->length = 0; - list->items = NULL; -} - - -int -_PyWideStringList_Copy(PyWideStringList *list, const PyWideStringList *list2) -{ - assert(_PyWideStringList_CheckConsistency(list)); - assert(_PyWideStringList_CheckConsistency(list2)); - - if (list2->length == 0) { - _PyWideStringList_Clear(list); - return 0; - } - - PyWideStringList copy = _PyWideStringList_INIT; - - size_t size = list2->length * sizeof(list2->items[0]); - copy.items = PyMem_RawMalloc(size); - if (copy.items == NULL) { - return -1; - } - - for (Py_ssize_t i=0; i < list2->length; i++) { - wchar_t *item = _PyMem_RawWcsdup(list2->items[i]); - if (item == NULL) { - _PyWideStringList_Clear(©); - return -1; - } - copy.items[i] = item; - copy.length = i + 1; - } - - _PyWideStringList_Clear(list); - *list = copy; - return 0; -} - - -PyStatus -PyWideStringList_Insert(PyWideStringList *list, - Py_ssize_t index, const wchar_t *item) -{ - Py_ssize_t len = list->length; - if (len == PY_SSIZE_T_MAX) { - /* length+1 would overflow */ - return _PyStatus_NO_MEMORY(); - } - if (index < 0) { - return _PyStatus_ERR("PyWideStringList_Insert index must be >= 0"); - } - if (index > len) { - index = len; - } - - wchar_t *item2 = _PyMem_RawWcsdup(item); - if (item2 == NULL) { - return _PyStatus_NO_MEMORY(); - } - - size_t size = (len + 1) * sizeof(list->items[0]); - wchar_t **items2 = (wchar_t **)PyMem_RawRealloc(list->items, size); - if (items2 == NULL) { - PyMem_RawFree(item2); - return _PyStatus_NO_MEMORY(); - } - - if (index < len) { - memmove(&items2[index + 1], - &items2[index], - (len - index) * sizeof(items2[0])); - } - - items2[index] = item2; - list->items = items2; - list->length++; - return _PyStatus_OK(); -} - - -PyStatus -PyWideStringList_Append(PyWideStringList *list, const wchar_t *item) -{ - return PyWideStringList_Insert(list, list->length, item); -} - - -PyStatus -_PyWideStringList_Extend(PyWideStringList *list, const PyWideStringList *list2) -{ - for (Py_ssize_t i = 0; i < list2->length; i++) { - PyStatus status = PyWideStringList_Append(list, list2->items[i]); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - return _PyStatus_OK(); -} - - -static int -_PyWideStringList_Find(PyWideStringList *list, const wchar_t *item) -{ - for (Py_ssize_t i = 0; i < list->length; i++) { - if (wcscmp(list->items[i], item) == 0) { - return 1; - } - } - return 0; -} - - -PyObject* -_PyWideStringList_AsList(const PyWideStringList *list) -{ - assert(_PyWideStringList_CheckConsistency(list)); - - PyObject *pylist = PyList_New(list->length); - if (pylist == NULL) { - return NULL; - } - - for (Py_ssize_t i = 0; i < list->length; i++) { - PyObject *item = PyUnicode_FromWideChar(list->items[i], -1); - if (item == NULL) { - Py_DECREF(pylist); - return NULL; - } - PyList_SET_ITEM(pylist, i, item); - } - return pylist; -} - - -/* --- Py_SetStandardStreamEncoding() ----------------------------- */ - -/* Helper to allow an embedding application to override the normal - * mechanism that attempts to figure out an appropriate IO encoding - */ - -static char *_Py_StandardStreamEncoding = NULL; -static char *_Py_StandardStreamErrors = NULL; - -int -Py_SetStandardStreamEncoding(const char *encoding, const char *errors) -{ - if (Py_IsInitialized()) { - /* This is too late to have any effect */ - return -1; - } - - int res = 0; - - /* Py_SetStandardStreamEncoding() can be called before Py_Initialize(), - but Py_Initialize() can change the allocator. Use a known allocator - to be able to release the memory later. */ - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - /* Can't call PyErr_NoMemory() on errors, as Python hasn't been - * initialised yet. - * - * However, the raw memory allocators are initialised appropriately - * as C static variables, so _PyMem_RawStrdup is OK even though - * Py_Initialize hasn't been called yet. - */ - if (encoding) { - PyMem_RawFree(_Py_StandardStreamEncoding); - _Py_StandardStreamEncoding = _PyMem_RawStrdup(encoding); - if (!_Py_StandardStreamEncoding) { - res = -2; - goto done; - } - } - if (errors) { - PyMem_RawFree(_Py_StandardStreamErrors); - _Py_StandardStreamErrors = _PyMem_RawStrdup(errors); - if (!_Py_StandardStreamErrors) { - PyMem_RawFree(_Py_StandardStreamEncoding); - _Py_StandardStreamEncoding = NULL; - res = -3; - goto done; - } - } -#ifdef MS_WINDOWS - if (_Py_StandardStreamEncoding) { - /* Overriding the stream encoding implies legacy streams */ - Py_LegacyWindowsStdioFlag = 1; - } -#endif - -done: - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - return res; -} - - -void -_Py_ClearStandardStreamEncoding(void) -{ - /* Use the same allocator than Py_SetStandardStreamEncoding() */ - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - /* We won't need them anymore. */ - if (_Py_StandardStreamEncoding) { - PyMem_RawFree(_Py_StandardStreamEncoding); - _Py_StandardStreamEncoding = NULL; - } - if (_Py_StandardStreamErrors) { - PyMem_RawFree(_Py_StandardStreamErrors); - _Py_StandardStreamErrors = NULL; - } - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); -} - - -/* --- Py_GetArgcArgv() ------------------------------------------- */ - -/* For Py_GetArgcArgv(); set by _Py_SetArgcArgv() */ -static PyWideStringList orig_argv = {.length = 0, .items = NULL}; - - -void -_Py_ClearArgcArgv(void) -{ - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - _PyWideStringList_Clear(&orig_argv); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); -} - - -static int -_Py_SetArgcArgv(Py_ssize_t argc, wchar_t * const *argv) -{ - const PyWideStringList argv_list = {.length = argc, .items = (wchar_t **)argv}; - int res; - - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - res = _PyWideStringList_Copy(&orig_argv, &argv_list); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - return res; -} - - -void -Py_GetArgcArgv(int *argc, wchar_t ***argv) -{ - *argc = (int)orig_argv.length; - *argv = orig_argv.items; -} - - -void -Py_InitArgcArgv(int argc, wchar_t **argv) -{ - _Py_SetArgcArgv((Py_ssize_t)argc, argv); -} - -/* --- PyConfig ---------------------------------------------- */ - -#define DECODE_LOCALE_ERR(NAME, LEN) \ - (((LEN) == -2) \ - ? _PyStatus_ERR("cannot decode " NAME) \ - : _PyStatus_NO_MEMORY()) - - -/* Free memory allocated in config, but don't clear all attributes */ -void -PyConfig_Clear(PyConfig *config) -{ -#define CLEAR(ATTR) \ - do { \ - PyMem_RawFree(ATTR); \ - ATTR = NULL; \ - } while (0) - - CLEAR(config->pycache_prefix); - CLEAR(config->pythonpath_env); - CLEAR(config->home); - CLEAR(config->program_name); - - _PyWideStringList_Clear(&config->argv); - _PyWideStringList_Clear(&config->warnoptions); - _PyWideStringList_Clear(&config->xoptions); - _PyWideStringList_Clear(&config->module_search_paths); - config->module_search_paths_set = 0; - - CLEAR(config->executable); - CLEAR(config->base_executable); - CLEAR(config->prefix); - CLEAR(config->base_prefix); - CLEAR(config->exec_prefix); - CLEAR(config->base_exec_prefix); - CLEAR(config->platlibdir); - - CLEAR(config->filesystem_encoding); - CLEAR(config->filesystem_errors); - CLEAR(config->stdio_encoding); - CLEAR(config->stdio_errors); - CLEAR(config->run_command); - CLEAR(config->run_module); - CLEAR(config->run_filename); - CLEAR(config->check_hash_pycs_mode); - - _PyWideStringList_Clear(&config->_orig_argv); -#undef CLEAR -} - - -void -_PyConfig_InitCompatConfig(PyConfig *config) -{ - memset(config, 0, sizeof(*config)); - - config->_config_init = (int)_PyConfig_INIT_COMPAT; - config->isolated = -1; - config->use_environment = -1; - config->dev_mode = -1; - config->install_signal_handlers = 1; - config->use_hash_seed = -1; - config->faulthandler = -1; - config->tracemalloc = -1; - config->module_search_paths_set = 0; - config->parse_argv = 0; - config->site_import = -1; - config->bytes_warning = -1; - config->inspect = -1; - config->interactive = -1; - config->optimization_level = -1; - config->parser_debug= -1; - config->write_bytecode = -1; - config->verbose = -1; - config->quiet = -1; - config->user_site_directory = -1; - config->configure_c_stdio = 0; - config->buffered_stdio = -1; - config->_install_importlib = 1; - config->check_hash_pycs_mode = NULL; - config->pathconfig_warnings = -1; - config->_init_main = 1; - config->_isolated_interpreter = 0; -#ifdef MS_WINDOWS - config->legacy_windows_stdio = -1; -#endif - config->_use_peg_parser = 1; -} - - -static void -config_init_defaults(PyConfig *config) -{ - _PyConfig_InitCompatConfig(config); - - config->isolated = 0; - config->use_environment = 1; - config->site_import = 1; - config->bytes_warning = 0; - config->inspect = 0; - config->interactive = 0; - config->optimization_level = 0; - config->parser_debug= 0; - config->write_bytecode = 1; - config->verbose = 0; - config->quiet = 0; - config->user_site_directory = 1; - config->buffered_stdio = 1; - config->pathconfig_warnings = 1; -#ifdef MS_WINDOWS - config->legacy_windows_stdio = 0; -#endif -} - - -void -PyConfig_InitPythonConfig(PyConfig *config) -{ - config_init_defaults(config); - - config->_config_init = (int)_PyConfig_INIT_PYTHON; - config->configure_c_stdio = 1; - config->parse_argv = 1; -} - - -void -PyConfig_InitIsolatedConfig(PyConfig *config) -{ - config_init_defaults(config); - - config->_config_init = (int)_PyConfig_INIT_ISOLATED; - config->isolated = 1; - config->use_environment = 0; - config->user_site_directory = 0; - config->dev_mode = 0; - config->install_signal_handlers = 0; - config->use_hash_seed = 0; - config->faulthandler = 0; - config->tracemalloc = 0; - config->pathconfig_warnings = 0; -#ifdef MS_WINDOWS - config->legacy_windows_stdio = 0; -#endif -} - - -/* Copy str into *config_str (duplicate the string) */ -PyStatus -PyConfig_SetString(PyConfig *config, wchar_t **config_str, const wchar_t *str) -{ - PyStatus status = _Py_PreInitializeFromConfig(config, NULL); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - wchar_t *str2; - if (str != NULL) { - str2 = _PyMem_RawWcsdup(str); - if (str2 == NULL) { - return _PyStatus_NO_MEMORY(); - } - } - else { - str2 = NULL; - } - PyMem_RawFree(*config_str); - *config_str = str2; - return _PyStatus_OK(); -} - - -static PyStatus -config_set_bytes_string(PyConfig *config, wchar_t **config_str, - const char *str, const char *decode_err_msg) -{ - PyStatus status = _Py_PreInitializeFromConfig(config, NULL); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - wchar_t *str2; - if (str != NULL) { - size_t len; - str2 = Py_DecodeLocale(str, &len); - if (str2 == NULL) { - if (len == (size_t)-2) { - return _PyStatus_ERR(decode_err_msg); - } - else { - return _PyStatus_NO_MEMORY(); - } - } - } - else { - str2 = NULL; - } - PyMem_RawFree(*config_str); - *config_str = str2; - return _PyStatus_OK(); -} - - -#define CONFIG_SET_BYTES_STR(config, config_str, str, NAME) \ - config_set_bytes_string(config, config_str, str, "cannot decode " NAME) - - -/* Decode str using Py_DecodeLocale() and set the result into *config_str. - Pre-initialize Python if needed to ensure that encodings are properly - configured. */ -PyStatus -PyConfig_SetBytesString(PyConfig *config, wchar_t **config_str, - const char *str) -{ - return CONFIG_SET_BYTES_STR(config, config_str, str, "string"); -} - - -PyStatus -_PyConfig_Copy(PyConfig *config, const PyConfig *config2) -{ - PyStatus status; - - PyConfig_Clear(config); - -#define COPY_ATTR(ATTR) config->ATTR = config2->ATTR -#define COPY_WSTR_ATTR(ATTR) \ - do { \ - status = PyConfig_SetString(config, &config->ATTR, config2->ATTR); \ - if (_PyStatus_EXCEPTION(status)) { \ - return status; \ - } \ - } while (0) -#define COPY_WSTRLIST(LIST) \ - do { \ - if (_PyWideStringList_Copy(&config->LIST, &config2->LIST) < 0) { \ - return _PyStatus_NO_MEMORY(); \ - } \ - } while (0) - - COPY_ATTR(_config_init); - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(dev_mode); - COPY_ATTR(_use_peg_parser); - COPY_ATTR(install_signal_handlers); - COPY_ATTR(use_hash_seed); - COPY_ATTR(hash_seed); - COPY_ATTR(_install_importlib); - COPY_ATTR(faulthandler); - COPY_ATTR(tracemalloc); - COPY_ATTR(import_time); - COPY_ATTR(show_ref_count); - COPY_ATTR(dump_refs); - COPY_ATTR(malloc_stats); - - COPY_WSTR_ATTR(pycache_prefix); - COPY_WSTR_ATTR(pythonpath_env); - COPY_WSTR_ATTR(home); - COPY_WSTR_ATTR(program_name); - - COPY_ATTR(parse_argv); - COPY_WSTRLIST(argv); - COPY_WSTRLIST(warnoptions); - COPY_WSTRLIST(xoptions); - COPY_WSTRLIST(module_search_paths); - COPY_ATTR(module_search_paths_set); - - COPY_WSTR_ATTR(executable); - COPY_WSTR_ATTR(base_executable); - COPY_WSTR_ATTR(prefix); - COPY_WSTR_ATTR(base_prefix); - COPY_WSTR_ATTR(exec_prefix); - COPY_WSTR_ATTR(base_exec_prefix); - COPY_WSTR_ATTR(platlibdir); - - COPY_ATTR(site_import); - COPY_ATTR(bytes_warning); - COPY_ATTR(inspect); - COPY_ATTR(interactive); - COPY_ATTR(optimization_level); - COPY_ATTR(parser_debug); - COPY_ATTR(write_bytecode); - COPY_ATTR(verbose); - COPY_ATTR(quiet); - COPY_ATTR(user_site_directory); - COPY_ATTR(configure_c_stdio); - COPY_ATTR(buffered_stdio); - COPY_WSTR_ATTR(filesystem_encoding); - COPY_WSTR_ATTR(filesystem_errors); - COPY_WSTR_ATTR(stdio_encoding); - COPY_WSTR_ATTR(stdio_errors); -#ifdef MS_WINDOWS - COPY_ATTR(legacy_windows_stdio); -#endif - COPY_ATTR(skip_source_first_line); - COPY_WSTR_ATTR(run_command); - COPY_WSTR_ATTR(run_module); - COPY_WSTR_ATTR(run_filename); - COPY_WSTR_ATTR(check_hash_pycs_mode); - COPY_ATTR(pathconfig_warnings); - COPY_ATTR(_init_main); - COPY_ATTR(_isolated_interpreter); - COPY_WSTRLIST(_orig_argv); - -#undef COPY_ATTR -#undef COPY_WSTR_ATTR -#undef COPY_WSTRLIST - return _PyStatus_OK(); -} - - -static PyObject * -config_as_dict(const PyConfig *config) -{ - PyObject *dict; - - dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - -#define SET_ITEM(KEY, EXPR) \ - do { \ - PyObject *obj = (EXPR); \ - if (obj == NULL) { \ - goto fail; \ - } \ - int res = PyDict_SetItemString(dict, (KEY), obj); \ - Py_DECREF(obj); \ - if (res < 0) { \ - goto fail; \ - } \ - } while (0) -#define SET_ITEM_INT(ATTR) \ - SET_ITEM(#ATTR, PyLong_FromLong(config->ATTR)) -#define SET_ITEM_UINT(ATTR) \ - SET_ITEM(#ATTR, PyLong_FromUnsignedLong(config->ATTR)) -#define FROM_WSTRING(STR) \ - ((STR != NULL) ? \ - PyUnicode_FromWideChar(STR, -1) \ - : (Py_INCREF(Py_None), Py_None)) -#define SET_ITEM_WSTR(ATTR) \ - SET_ITEM(#ATTR, FROM_WSTRING(config->ATTR)) -#define SET_ITEM_WSTRLIST(LIST) \ - SET_ITEM(#LIST, _PyWideStringList_AsList(&config->LIST)) - - SET_ITEM_INT(_config_init); - SET_ITEM_INT(isolated); - SET_ITEM_INT(use_environment); - SET_ITEM_INT(dev_mode); - SET_ITEM_INT(_use_peg_parser); - SET_ITEM_INT(install_signal_handlers); - SET_ITEM_INT(use_hash_seed); - SET_ITEM_UINT(hash_seed); - SET_ITEM_INT(faulthandler); - SET_ITEM_INT(tracemalloc); - SET_ITEM_INT(import_time); - SET_ITEM_INT(show_ref_count); - SET_ITEM_INT(dump_refs); - SET_ITEM_INT(malloc_stats); - SET_ITEM_WSTR(filesystem_encoding); - SET_ITEM_WSTR(filesystem_errors); - SET_ITEM_WSTR(pycache_prefix); - SET_ITEM_WSTR(program_name); - SET_ITEM_INT(parse_argv); - SET_ITEM_WSTRLIST(argv); - SET_ITEM_WSTRLIST(xoptions); - SET_ITEM_WSTRLIST(warnoptions); - SET_ITEM_WSTR(pythonpath_env); - SET_ITEM_WSTR(home); - SET_ITEM_WSTRLIST(module_search_paths); - SET_ITEM_WSTR(executable); - SET_ITEM_WSTR(base_executable); - SET_ITEM_WSTR(prefix); - SET_ITEM_WSTR(base_prefix); - SET_ITEM_WSTR(exec_prefix); - SET_ITEM_WSTR(base_exec_prefix); - SET_ITEM_WSTR(platlibdir); - SET_ITEM_INT(site_import); - SET_ITEM_INT(bytes_warning); - SET_ITEM_INT(inspect); - SET_ITEM_INT(interactive); - SET_ITEM_INT(optimization_level); - SET_ITEM_INT(parser_debug); - SET_ITEM_INT(write_bytecode); - SET_ITEM_INT(verbose); - SET_ITEM_INT(quiet); - SET_ITEM_INT(user_site_directory); - SET_ITEM_INT(configure_c_stdio); - SET_ITEM_INT(buffered_stdio); - SET_ITEM_WSTR(stdio_encoding); - SET_ITEM_WSTR(stdio_errors); -#ifdef MS_WINDOWS - SET_ITEM_INT(legacy_windows_stdio); -#endif - SET_ITEM_INT(skip_source_first_line); - SET_ITEM_WSTR(run_command); - SET_ITEM_WSTR(run_module); - SET_ITEM_WSTR(run_filename); - SET_ITEM_INT(_install_importlib); - SET_ITEM_WSTR(check_hash_pycs_mode); - SET_ITEM_INT(pathconfig_warnings); - SET_ITEM_INT(_init_main); - SET_ITEM_INT(_isolated_interpreter); - SET_ITEM_WSTRLIST(_orig_argv); - - return dict; - -fail: - Py_DECREF(dict); - return NULL; - -#undef FROM_WSTRING -#undef SET_ITEM -#undef SET_ITEM_INT -#undef SET_ITEM_UINT -#undef SET_ITEM_WSTR -#undef SET_ITEM_WSTRLIST -} - - -static const char* -config_get_env(const PyConfig *config, const char *name) -{ - return _Py_GetEnv(config->use_environment, name); -} - - -/* Get a copy of the environment variable as wchar_t*. - Return 0 on success, but *dest can be NULL. - Return -1 on memory allocation failure. Return -2 on decoding error. */ -static PyStatus -config_get_env_dup(PyConfig *config, - wchar_t **dest, - wchar_t *wname, char *name, - const char *decode_err_msg) -{ - assert(*dest == NULL); - assert(config->use_environment >= 0); - - if (!config->use_environment) { - *dest = NULL; - return _PyStatus_OK(); - } - -#ifdef MS_WINDOWS - const wchar_t *var = _wgetenv(wname); - if (!var || var[0] == '\0') { - *dest = NULL; - return _PyStatus_OK(); - } - - return PyConfig_SetString(config, dest, var); -#else - const char *var = getenv(name); - if (!var || var[0] == '\0') { - *dest = NULL; - return _PyStatus_OK(); - } - - return config_set_bytes_string(config, dest, var, decode_err_msg); -#endif -} - - -#define CONFIG_GET_ENV_DUP(CONFIG, DEST, WNAME, NAME) \ - config_get_env_dup(CONFIG, DEST, WNAME, NAME, "cannot decode " NAME) - - -static void -config_get_global_vars(PyConfig *config) -{ - if (config->_config_init != _PyConfig_INIT_COMPAT) { - /* Python and Isolated configuration ignore global variables */ - return; - } - -#define COPY_FLAG(ATTR, VALUE) \ - if (config->ATTR == -1) { \ - config->ATTR = VALUE; \ - } -#define COPY_NOT_FLAG(ATTR, VALUE) \ - if (config->ATTR == -1) { \ - config->ATTR = !(VALUE); \ - } - - COPY_FLAG(isolated, Py_IsolatedFlag); - COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); - COPY_FLAG(bytes_warning, Py_BytesWarningFlag); - COPY_FLAG(inspect, Py_InspectFlag); - COPY_FLAG(interactive, Py_InteractiveFlag); - COPY_FLAG(optimization_level, Py_OptimizeFlag); - COPY_FLAG(parser_debug, Py_DebugFlag); - COPY_FLAG(verbose, Py_VerboseFlag); - COPY_FLAG(quiet, Py_QuietFlag); -#ifdef MS_WINDOWS - COPY_FLAG(legacy_windows_stdio, Py_LegacyWindowsStdioFlag); -#endif - COPY_NOT_FLAG(pathconfig_warnings, Py_FrozenFlag); - - COPY_NOT_FLAG(buffered_stdio, Py_UnbufferedStdioFlag); - COPY_NOT_FLAG(site_import, Py_NoSiteFlag); - COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); - COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); - -#undef COPY_FLAG -#undef COPY_NOT_FLAG -} - - -/* Set Py_xxx global configuration variables from 'config' configuration. */ -static void -config_set_global_vars(const PyConfig *config) -{ -#define COPY_FLAG(ATTR, VAR) \ - if (config->ATTR != -1) { \ - VAR = config->ATTR; \ - } -#define COPY_NOT_FLAG(ATTR, VAR) \ - if (config->ATTR != -1) { \ - VAR = !config->ATTR; \ - } - - COPY_FLAG(isolated, Py_IsolatedFlag); - COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); - COPY_FLAG(bytes_warning, Py_BytesWarningFlag); - COPY_FLAG(inspect, Py_InspectFlag); - COPY_FLAG(interactive, Py_InteractiveFlag); - COPY_FLAG(optimization_level, Py_OptimizeFlag); - COPY_FLAG(parser_debug, Py_DebugFlag); - COPY_FLAG(verbose, Py_VerboseFlag); - COPY_FLAG(quiet, Py_QuietFlag); -#ifdef MS_WINDOWS - COPY_FLAG(legacy_windows_stdio, Py_LegacyWindowsStdioFlag); -#endif - COPY_NOT_FLAG(pathconfig_warnings, Py_FrozenFlag); - - COPY_NOT_FLAG(buffered_stdio, Py_UnbufferedStdioFlag); - COPY_NOT_FLAG(site_import, Py_NoSiteFlag); - COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); - COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); - - /* Random or non-zero hash seed */ - Py_HashRandomizationFlag = (config->use_hash_seed == 0 || - config->hash_seed != 0); - -#undef COPY_FLAG -#undef COPY_NOT_FLAG -} - - -/* Get the program name: use PYTHONEXECUTABLE and __PYVENV_LAUNCHER__ - environment variables on macOS if available. */ -static PyStatus -config_init_program_name(PyConfig *config) -{ - PyStatus status; - - /* If Py_SetProgramName() was called, use its value */ - const wchar_t *program_name = _Py_path_config.program_name; - if (program_name != NULL) { - config->program_name = _PyMem_RawWcsdup(program_name); - if (config->program_name == NULL) { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); - } - -#ifdef __APPLE__ - /* On MacOS X, when the Python interpreter is embedded in an - application bundle, it gets executed by a bootstrapping script - that does os.execve() with an argv[0] that's different from the - actual Python executable. This is needed to keep the Finder happy, - or rather, to work around Apple's overly strict requirements of - the process name. However, we still need a usable sys.executable, - so the actual executable path is passed in an environment variable. - See Lib/plat-mac/bundlebuilder.py for details about the bootstrap - script. */ - const char *p = config_get_env(config, "PYTHONEXECUTABLE"); - if (p != NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->program_name, p, - "PYTHONEXECUTABLE environment variable"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); - } -#ifdef WITH_NEXT_FRAMEWORK - else { - const char* pyvenv_launcher = getenv("__PYVENV_LAUNCHER__"); - if (pyvenv_launcher && *pyvenv_launcher) { - /* Used by Mac/Tools/pythonw.c to forward - * the argv0 of the stub executable - */ - status = CONFIG_SET_BYTES_STR(config, - &config->program_name, - pyvenv_launcher, - "__PYVENV_LAUNCHER__ environment variable"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* - * This environment variable is used to communicate between - * the stub launcher and the real interpreter and isn't needed - * beyond this point. - * - * Clean up to avoid problems when launching other programs - * later on. - */ - (void)unsetenv("__PYVENV_LAUNCHER__"); - - return _PyStatus_OK(); - } - } -#endif /* WITH_NEXT_FRAMEWORK */ -#endif /* __APPLE__ */ - - /* Use argv[0] if available and non-empty */ - const PyWideStringList *argv = &config->argv; - if (argv->length >= 1 && argv->items[0][0] != L'\0') { - config->program_name = _PyMem_RawWcsdup(argv->items[0]); - if (config->program_name == NULL) { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); - } - - /* Last fall back: hardcoded name */ -#ifdef MS_WINDOWS - const wchar_t *default_program_name = L"python"; -#else - const wchar_t *default_program_name = L"python3"; -#endif - status = PyConfig_SetString(config, &config->program_name, - default_program_name); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); -} - -static PyStatus -config_init_executable(PyConfig *config) -{ - assert(config->executable == NULL); - - /* If Py_SetProgramFullPath() was called, use its value */ - const wchar_t *program_full_path = _Py_path_config.program_full_path; - if (program_full_path != NULL) { - PyStatus status = PyConfig_SetString(config, - &config->executable, - program_full_path); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); - } - return _PyStatus_OK(); -} - - -static const wchar_t* -config_get_xoption(const PyConfig *config, wchar_t *name) -{ - return _Py_get_xoption(&config->xoptions, name); -} - - -static PyStatus -config_init_home(PyConfig *config) -{ - assert(config->home == NULL); - - /* If Py_SetPythonHome() was called, use its value */ - wchar_t *home = _Py_path_config.home; - if (home) { - PyStatus status = PyConfig_SetString(config, &config->home, home); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); - } - - return CONFIG_GET_ENV_DUP(config, &config->home, - L"PYTHONHOME", "PYTHONHOME"); -} - - -static PyStatus -config_init_hash_seed(PyConfig *config) -{ - const char *seed_text = config_get_env(config, "PYTHONHASHSEED"); - - Py_BUILD_ASSERT(sizeof(_Py_HashSecret_t) == sizeof(_Py_HashSecret.uc)); - /* Convert a text seed to a numeric one */ - if (seed_text && strcmp(seed_text, "random") != 0) { - const char *endptr = seed_text; - unsigned long seed; - errno = 0; - seed = strtoul(seed_text, (char **)&endptr, 10); - if (*endptr != '\0' - || seed > 4294967295UL - || (errno == ERANGE && seed == ULONG_MAX)) - { - return _PyStatus_ERR("PYTHONHASHSEED must be \"random\" " - "or an integer in range [0; 4294967295]"); - } - /* Use a specific hash */ - config->use_hash_seed = 1; - config->hash_seed = seed; - } - else { - /* Use a random hash */ - config->use_hash_seed = 0; - config->hash_seed = 0; - } - return _PyStatus_OK(); -} - - -static int -config_wstr_to_int(const wchar_t *wstr, int *result) -{ - const wchar_t *endptr = wstr; - errno = 0; - long value = wcstol(wstr, (wchar_t **)&endptr, 10); - if (*endptr != '\0' || errno == ERANGE) { - return -1; - } - if (value < INT_MIN || value > INT_MAX) { - return -1; - } - - *result = (int)value; - return 0; -} - - -static PyStatus -config_read_env_vars(PyConfig *config) -{ - PyStatus status; - int use_env = config->use_environment; - - /* Get environment variables */ - _Py_get_env_flag(use_env, &config->parser_debug, "PYTHONDEBUG"); - _Py_get_env_flag(use_env, &config->verbose, "PYTHONVERBOSE"); - _Py_get_env_flag(use_env, &config->optimization_level, "PYTHONOPTIMIZE"); - _Py_get_env_flag(use_env, &config->inspect, "PYTHONINSPECT"); - - int dont_write_bytecode = 0; - _Py_get_env_flag(use_env, &dont_write_bytecode, "PYTHONDONTWRITEBYTECODE"); - if (dont_write_bytecode) { - config->write_bytecode = 0; - } - - int no_user_site_directory = 0; - _Py_get_env_flag(use_env, &no_user_site_directory, "PYTHONNOUSERSITE"); - if (no_user_site_directory) { - config->user_site_directory = 0; - } - - int unbuffered_stdio = 0; - _Py_get_env_flag(use_env, &unbuffered_stdio, "PYTHONUNBUFFERED"); - if (unbuffered_stdio) { - config->buffered_stdio = 0; - } - -#ifdef MS_WINDOWS - _Py_get_env_flag(use_env, &config->legacy_windows_stdio, - "PYTHONLEGACYWINDOWSSTDIO"); -#endif - - if (config_get_env(config, "PYTHONDUMPREFS")) { - config->dump_refs = 1; - } - if (config_get_env(config, "PYTHONMALLOCSTATS")) { - config->malloc_stats = 1; - } - - if (config->pythonpath_env == NULL) { - status = CONFIG_GET_ENV_DUP(config, &config->pythonpath_env, - L"PYTHONPATH", "PYTHONPATH"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if(config->platlibdir == NULL) { - status = CONFIG_GET_ENV_DUP(config, &config->platlibdir, - L"PYTHONPLATLIBDIR", "PYTHONPLATLIBDIR"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->use_hash_seed < 0) { - status = config_init_hash_seed(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - return _PyStatus_OK(); -} - - -static PyStatus -config_init_tracemalloc(PyConfig *config) -{ - int nframe; - int valid; - - const char *env = config_get_env(config, "PYTHONTRACEMALLOC"); - if (env) { - if (!_Py_str_to_int(env, &nframe)) { - valid = (nframe >= 0); - } - else { - valid = 0; - } - if (!valid) { - return _PyStatus_ERR("PYTHONTRACEMALLOC: invalid number of frames"); - } - config->tracemalloc = nframe; - } - - const wchar_t *xoption = config_get_xoption(config, L"tracemalloc"); - if (xoption) { - const wchar_t *sep = wcschr(xoption, L'='); - if (sep) { - if (!config_wstr_to_int(sep + 1, &nframe)) { - valid = (nframe >= 0); - } - else { - valid = 0; - } - if (!valid) { - return _PyStatus_ERR("-X tracemalloc=NFRAME: " - "invalid number of frames"); - } - } - else { - /* -X tracemalloc behaves as -X tracemalloc=1 */ - nframe = 1; - } - config->tracemalloc = nframe; - } - return _PyStatus_OK(); -} - - -static PyStatus -config_init_pycache_prefix(PyConfig *config) -{ - assert(config->pycache_prefix == NULL); - - const wchar_t *xoption = config_get_xoption(config, L"pycache_prefix"); - if (xoption) { - const wchar_t *sep = wcschr(xoption, L'='); - if (sep && wcslen(sep) > 1) { - config->pycache_prefix = _PyMem_RawWcsdup(sep + 1); - if (config->pycache_prefix == NULL) { - return _PyStatus_NO_MEMORY(); - } - } - else { - // PYTHONPYCACHEPREFIX env var ignored - // if "-X pycache_prefix=" option is used - config->pycache_prefix = NULL; - } - return _PyStatus_OK(); - } - - return CONFIG_GET_ENV_DUP(config, &config->pycache_prefix, - L"PYTHONPYCACHEPREFIX", - "PYTHONPYCACHEPREFIX"); -} - - -static PyStatus -config_read_complex_options(PyConfig *config) -{ - /* More complex options configured by env var and -X option */ - if (config->faulthandler < 0) { - if (config_get_env(config, "PYTHONFAULTHANDLER") - || config_get_xoption(config, L"faulthandler")) { - config->faulthandler = 1; - } - } - if (config_get_env(config, "PYTHONPROFILEIMPORTTIME") - || config_get_xoption(config, L"importtime")) { - config->import_time = 1; - } - - if (config_get_env(config, "PYTHONOLDPARSER") - || config_get_xoption(config, L"oldparser")) { - config->_use_peg_parser = 0; - } - - PyStatus status; - if (config->tracemalloc < 0) { - status = config_init_tracemalloc(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->pycache_prefix == NULL) { - status = config_init_pycache_prefix(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - return _PyStatus_OK(); -} - - -static const wchar_t * -config_get_stdio_errors(void) -{ -#ifndef MS_WINDOWS - const char *loc = setlocale(LC_CTYPE, NULL); - if (loc != NULL) { - /* surrogateescape is the default in the legacy C and POSIX locales */ - if (strcmp(loc, "C") == 0 || strcmp(loc, "POSIX") == 0) { - return L"surrogateescape"; - } - -#ifdef PY_COERCE_C_LOCALE - /* surrogateescape is the default in locale coercion target locales */ - if (_Py_IsLocaleCoercionTarget(loc)) { - return L"surrogateescape"; - } -#endif - } - - return L"strict"; -#else - /* On Windows, always use surrogateescape by default */ - return L"surrogateescape"; -#endif -} - - -static PyStatus -config_get_locale_encoding(PyConfig *config, wchar_t **locale_encoding) -{ -#ifdef MS_WINDOWS - char encoding[20]; - PyOS_snprintf(encoding, sizeof(encoding), "cp%u", GetACP()); - return PyConfig_SetBytesString(config, locale_encoding, encoding); -#elif defined(_Py_FORCE_UTF8_LOCALE) - return PyConfig_SetString(config, locale_encoding, L"utf-8"); -#else - const char *encoding = nl_langinfo(CODESET); - if (!encoding || encoding[0] == '\0') { - return _PyStatus_ERR("failed to get the locale encoding: " - "nl_langinfo(CODESET) failed"); - } - /* nl_langinfo(CODESET) is decoded by Py_DecodeLocale() */ - return CONFIG_SET_BYTES_STR(config, - locale_encoding, encoding, - "nl_langinfo(CODESET)"); -#endif -} - - -static PyStatus -config_init_stdio_encoding(PyConfig *config, - const PyPreConfig *preconfig) -{ - PyStatus status; - - /* If Py_SetStandardStreamEncoding() have been called, use these - parameters. */ - if (config->stdio_encoding == NULL && _Py_StandardStreamEncoding != NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, - _Py_StandardStreamEncoding, - "_Py_StandardStreamEncoding"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->stdio_errors == NULL && _Py_StandardStreamErrors != NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, - _Py_StandardStreamErrors, - "_Py_StandardStreamErrors"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->stdio_encoding != NULL && config->stdio_errors != NULL) { - return _PyStatus_OK(); - } - - /* PYTHONIOENCODING environment variable */ - const char *opt = config_get_env(config, "PYTHONIOENCODING"); - if (opt) { - char *pythonioencoding = _PyMem_RawStrdup(opt); - if (pythonioencoding == NULL) { - return _PyStatus_NO_MEMORY(); - } - - char *errors = strchr(pythonioencoding, ':'); - if (errors) { - *errors = '\0'; - errors++; - if (!errors[0]) { - errors = NULL; - } - } - - /* Does PYTHONIOENCODING contain an encoding? */ - if (pythonioencoding[0]) { - if (config->stdio_encoding == NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, - pythonioencoding, - "PYTHONIOENCODING environment variable"); - if (_PyStatus_EXCEPTION(status)) { - PyMem_RawFree(pythonioencoding); - return status; - } - } - - /* If the encoding is set but not the error handler, - use "strict" error handler by default. - PYTHONIOENCODING=latin1 behaves as - PYTHONIOENCODING=latin1:strict. */ - if (!errors) { - errors = "strict"; - } - } - - if (config->stdio_errors == NULL && errors != NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, - errors, - "PYTHONIOENCODING environment variable"); - if (_PyStatus_EXCEPTION(status)) { - PyMem_RawFree(pythonioencoding); - return status; - } - } - - PyMem_RawFree(pythonioencoding); - } - - /* UTF-8 Mode uses UTF-8/surrogateescape */ - if (preconfig->utf8_mode) { - if (config->stdio_encoding == NULL) { - status = PyConfig_SetString(config, &config->stdio_encoding, - L"utf-8"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - if (config->stdio_errors == NULL) { - status = PyConfig_SetString(config, &config->stdio_errors, - L"surrogateescape"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - } - - /* Choose the default error handler based on the current locale. */ - if (config->stdio_encoding == NULL) { - status = config_get_locale_encoding(config, &config->stdio_encoding); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - if (config->stdio_errors == NULL) { - const wchar_t *errors = config_get_stdio_errors(); - assert(errors != NULL); - - status = PyConfig_SetString(config, &config->stdio_errors, errors); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - return _PyStatus_OK(); -} - - -static PyStatus -config_init_fs_encoding(PyConfig *config, const PyPreConfig *preconfig) -{ - PyStatus status; - - if (config->filesystem_encoding == NULL) { -#ifdef _Py_FORCE_UTF8_FS_ENCODING - status = PyConfig_SetString(config, &config->filesystem_encoding, L"utf-8"); -#else - -#ifdef MS_WINDOWS - if (preconfig->legacy_windows_fs_encoding) { - /* Legacy Windows filesystem encoding: mbcs/replace */ - status = PyConfig_SetString(config, &config->filesystem_encoding, - L"mbcs"); - } - else -#endif - if (preconfig->utf8_mode) { - status = PyConfig_SetString(config, &config->filesystem_encoding, - L"utf-8"); - } -#ifndef MS_WINDOWS - else if (_Py_GetForceASCII()) { - status = PyConfig_SetString(config, &config->filesystem_encoding, - L"ascii"); - } -#endif - else { -#ifdef MS_WINDOWS - /* Windows defaults to utf-8/surrogatepass (PEP 529). */ - status = PyConfig_SetString(config, &config->filesystem_encoding, - L"utf-8"); -#else - status = config_get_locale_encoding(config, - &config->filesystem_encoding); -#endif - } -#endif /* !_Py_FORCE_UTF8_FS_ENCODING */ - - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->filesystem_errors == NULL) { - const wchar_t *errors; -#ifdef MS_WINDOWS - if (preconfig->legacy_windows_fs_encoding) { - errors = L"replace"; - } - else { - errors = L"surrogatepass"; - } -#else - errors = L"surrogateescape"; -#endif - status = PyConfig_SetString(config, &config->filesystem_errors, errors); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - return _PyStatus_OK(); -} - - -static PyStatus -config_read(PyConfig *config) -{ - PyStatus status; - const PyPreConfig *preconfig = &_PyRuntime.preconfig; - - if (config->use_environment) { - status = config_read_env_vars(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - /* -X options */ - if (config_get_xoption(config, L"showrefcount")) { - config->show_ref_count = 1; - } - - status = config_read_complex_options(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (config->home == NULL) { - status = config_init_home(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->executable == NULL) { - status = config_init_executable(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if(config->platlibdir == NULL) { - status = CONFIG_SET_BYTES_STR(config, &config->platlibdir, PLATLIBDIR, - "PLATLIBDIR macro"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->_install_importlib) { - status = _PyConfig_InitPathConfig(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - /* default values */ - if (config->dev_mode) { - if (config->faulthandler < 0) { - config->faulthandler = 1; - } - } - if (config->faulthandler < 0) { - config->faulthandler = 0; - } - if (config->tracemalloc < 0) { - config->tracemalloc = 0; - } - if (config->use_hash_seed < 0) { - config->use_hash_seed = 0; - config->hash_seed = 0; - } - - if (config->filesystem_encoding == NULL || config->filesystem_errors == NULL) { - status = config_init_fs_encoding(config, preconfig); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - status = config_init_stdio_encoding(config, preconfig); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (config->argv.length < 1) { - /* Ensure at least one (empty) argument is seen */ - status = PyWideStringList_Append(&config->argv, L""); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->check_hash_pycs_mode == NULL) { - status = PyConfig_SetString(config, &config->check_hash_pycs_mode, - L"default"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->configure_c_stdio < 0) { - config->configure_c_stdio = 1; - } - - return _PyStatus_OK(); -} - - -static void -config_init_stdio(const PyConfig *config) -{ -#if defined(MS_WINDOWS) || defined(__CYGWIN__) - /* don't translate newlines (\r\n <=> \n) */ - _setmode(fileno(stdin), O_BINARY); - _setmode(fileno(stdout), O_BINARY); - _setmode(fileno(stderr), O_BINARY); -#endif - - if (!config->buffered_stdio) { -#ifdef HAVE_SETVBUF - setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); - setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); - setvbuf(stderr, (char *)NULL, _IONBF, BUFSIZ); -#else /* !HAVE_SETVBUF */ - setbuf(stdin, (char *)NULL); - setbuf(stdout, (char *)NULL); - setbuf(stderr, (char *)NULL); -#endif /* !HAVE_SETVBUF */ - } - else if (config->interactive) { -#ifdef MS_WINDOWS - /* Doesn't have to have line-buffered -- use unbuffered */ - /* Any set[v]buf(stdin, ...) screws up Tkinter :-( */ - setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); -#else /* !MS_WINDOWS */ -#ifdef HAVE_SETVBUF - setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); - setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); -#endif /* HAVE_SETVBUF */ -#endif /* !MS_WINDOWS */ - /* Leave stderr alone - it should be unbuffered anyway. */ - } -} - - -/* Write the configuration: - - - set Py_xxx global configuration variables - - initialize C standard streams (stdin, stdout, stderr) */ -PyStatus -_PyConfig_Write(const PyConfig *config, _PyRuntimeState *runtime) -{ - config_set_global_vars(config); - - if (config->configure_c_stdio) { - config_init_stdio(config); - } - - /* Write the new pre-configuration into _PyRuntime */ - PyPreConfig *preconfig = &runtime->preconfig; - preconfig->isolated = config->isolated; - preconfig->use_environment = config->use_environment; - preconfig->dev_mode = config->dev_mode; - - if (_Py_SetArgcArgv(config->_orig_argv.length, - config->_orig_argv.items) < 0) - { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); -} - - -/* --- PyConfig command line parser -------------------------- */ - -static void -config_usage(int error, const wchar_t* program) -{ - FILE *f = error ? stderr : stdout; - - fprintf(f, usage_line, program); - if (error) - fprintf(f, "Try `python -h' for more information.\n"); - else { - fputs(usage_1, f); - fputs(usage_2, f); - fputs(usage_3, f); - fprintf(f, usage_4, (wint_t)DELIM); - fprintf(f, usage_5, (wint_t)DELIM, PYTHONHOMEHELP); - fputs(usage_6, f); - } -} - - -/* Parse the command line arguments */ -static PyStatus -config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions, - Py_ssize_t *opt_index) -{ - PyStatus status; - const PyWideStringList *argv = &config->argv; - int print_version = 0; - const wchar_t* program = config->program_name; - - _PyOS_ResetGetOpt(); - do { - int longindex = -1; - int c = _PyOS_GetOpt(argv->length, argv->items, &longindex); - if (c == EOF) { - break; - } - - if (c == 'c') { - if (config->run_command == NULL) { - /* -c is the last option; following arguments - that look like options are left for the - command to interpret. */ - size_t len = wcslen(_PyOS_optarg) + 1 + 1; - wchar_t *command = PyMem_RawMalloc(sizeof(wchar_t) * len); - if (command == NULL) { - return _PyStatus_NO_MEMORY(); - } - memcpy(command, _PyOS_optarg, (len - 2) * sizeof(wchar_t)); - command[len - 2] = '\n'; - command[len - 1] = 0; - config->run_command = command; - } - break; - } - - if (c == 'm') { - /* -m is the last option; following arguments - that look like options are left for the - module to interpret. */ - if (config->run_module == NULL) { - config->run_module = _PyMem_RawWcsdup(_PyOS_optarg); - if (config->run_module == NULL) { - return _PyStatus_NO_MEMORY(); - } - } - break; - } - - switch (c) { - case 0: - // Handle long option. - assert(longindex == 0); // Only one long option now. - if (wcscmp(_PyOS_optarg, L"always") == 0 - || wcscmp(_PyOS_optarg, L"never") == 0 - || wcscmp(_PyOS_optarg, L"default") == 0) - { - status = PyConfig_SetString(config, &config->check_hash_pycs_mode, - _PyOS_optarg); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } else { - fprintf(stderr, "--check-hash-based-pycs must be one of " - "'default', 'always', or 'never'\n"); - config_usage(1, program); - return _PyStatus_EXIT(2); - } - break; - - case 'b': - config->bytes_warning++; - break; - - case 'd': - config->parser_debug++; - break; - - case 'i': - config->inspect++; - config->interactive++; - break; - - case 'E': - case 'I': - case 'X': - /* option handled by _PyPreCmdline_Read() */ - break; - - /* case 'J': reserved for Jython */ - - case 'O': - config->optimization_level++; - break; - - case 'B': - config->write_bytecode = 0; - break; - - case 's': - config->user_site_directory = 0; - break; - - case 'S': - config->site_import = 0; - break; - - case 't': - /* ignored for backwards compatibility */ - break; - - case 'u': - config->buffered_stdio = 0; - break; - - case 'v': - config->verbose++; - break; - - case 'x': - config->skip_source_first_line = 1; - break; - - case 'h': - case '?': - config_usage(0, program); - return _PyStatus_EXIT(0); - - case 'V': - print_version++; - break; - - case 'W': - status = PyWideStringList_Append(warnoptions, _PyOS_optarg); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - break; - - case 'q': - config->quiet++; - break; - - case 'R': - config->use_hash_seed = 0; - break; - - /* This space reserved for other options */ - - default: - /* unknown argument: parsing failed */ - config_usage(1, program); - return _PyStatus_EXIT(2); - } - } while (1); - - if (print_version) { - printf("Python %s\n", - (print_version >= 2) ? Py_GetVersion() : PY_VERSION); - return _PyStatus_EXIT(0); - } - - if (config->run_command == NULL && config->run_module == NULL - && _PyOS_optind < argv->length - && wcscmp(argv->items[_PyOS_optind], L"-") != 0 - && config->run_filename == NULL) - { - config->run_filename = _PyMem_RawWcsdup(argv->items[_PyOS_optind]); - if (config->run_filename == NULL) { - return _PyStatus_NO_MEMORY(); - } - } - - if (config->run_command != NULL || config->run_module != NULL) { - /* Backup _PyOS_optind */ - _PyOS_optind--; - } - - *opt_index = _PyOS_optind; - - return _PyStatus_OK(); -} - - -#ifdef MS_WINDOWS -# define WCSTOK wcstok_s -#else -# define WCSTOK wcstok -#endif - -/* Get warning options from PYTHONWARNINGS environment variable. */ -static PyStatus -config_init_env_warnoptions(PyConfig *config, PyWideStringList *warnoptions) -{ - PyStatus status; - /* CONFIG_GET_ENV_DUP requires dest to be initialized to NULL */ - wchar_t *env = NULL; - status = CONFIG_GET_ENV_DUP(config, &env, - L"PYTHONWARNINGS", "PYTHONWARNINGS"); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* env var is not set or is empty */ - if (env == NULL) { - return _PyStatus_OK(); - } - - - wchar_t *warning, *context = NULL; - for (warning = WCSTOK(env, L",", &context); - warning != NULL; - warning = WCSTOK(NULL, L",", &context)) - { - status = PyWideStringList_Append(warnoptions, warning); - if (_PyStatus_EXCEPTION(status)) { - PyMem_RawFree(env); - return status; - } - } - PyMem_RawFree(env); - return _PyStatus_OK(); -} - - -static PyStatus -warnoptions_append(PyConfig *config, PyWideStringList *options, - const wchar_t *option) -{ - /* config_init_warnoptions() add existing config warnoptions at the end: - ensure that the new option is not already present in this list to - prevent change the options order when config_init_warnoptions() is - called twice. */ - if (_PyWideStringList_Find(&config->warnoptions, option)) { - /* Already present: do nothing */ - return _PyStatus_OK(); - } - if (_PyWideStringList_Find(options, option)) { - /* Already present: do nothing */ - return _PyStatus_OK(); - } - return PyWideStringList_Append(options, option); -} - - -static PyStatus -warnoptions_extend(PyConfig *config, PyWideStringList *options, - const PyWideStringList *options2) -{ - const Py_ssize_t len = options2->length; - wchar_t *const *items = options2->items; - - for (Py_ssize_t i = 0; i < len; i++) { - PyStatus status = warnoptions_append(config, options, items[i]); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - return _PyStatus_OK(); -} - - -static PyStatus -config_init_warnoptions(PyConfig *config, - const PyWideStringList *cmdline_warnoptions, - const PyWideStringList *env_warnoptions, - const PyWideStringList *sys_warnoptions) -{ - PyStatus status; - PyWideStringList options = _PyWideStringList_INIT; - - /* Priority of warnings options, lowest to highest: - * - * - any implicit filters added by _warnings.c/warnings.py - * - PyConfig.dev_mode: "default" filter - * - PYTHONWARNINGS environment variable - * - '-W' command line options - * - PyConfig.bytes_warning ('-b' and '-bb' command line options): - * "default::BytesWarning" or "error::BytesWarning" filter - * - early PySys_AddWarnOption() calls - * - PyConfig.warnoptions - * - * PyConfig.warnoptions is copied to sys.warnoptions. Since the warnings - * module works on the basis of "the most recently added filter will be - * checked first", we add the lowest precedence entries first so that later - * entries override them. - */ - - if (config->dev_mode) { - status = warnoptions_append(config, &options, L"default"); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - } - - status = warnoptions_extend(config, &options, env_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - - status = warnoptions_extend(config, &options, cmdline_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - - /* If the bytes_warning_flag isn't set, bytesobject.c and bytearrayobject.c - * don't even try to emit a warning, so we skip setting the filter in that - * case. - */ - if (config->bytes_warning) { - const wchar_t *filter; - if (config->bytes_warning> 1) { - filter = L"error::BytesWarning"; - } - else { - filter = L"default::BytesWarning"; - } - status = warnoptions_append(config, &options, filter); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - } - - status = warnoptions_extend(config, &options, sys_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - - /* Always add all PyConfig.warnoptions options */ - status = _PyWideStringList_Extend(&options, &config->warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - - _PyWideStringList_Clear(&config->warnoptions); - config->warnoptions = options; - return _PyStatus_OK(); - -error: - _PyWideStringList_Clear(&options); - return status; -} - - -static PyStatus -config_update_argv(PyConfig *config, Py_ssize_t opt_index) -{ - const PyWideStringList *cmdline_argv = &config->argv; - PyWideStringList config_argv = _PyWideStringList_INIT; - - /* Copy argv to be able to modify it (to force -c/-m) */ - if (cmdline_argv->length <= opt_index) { - /* Ensure at least one (empty) argument is seen */ - PyStatus status = PyWideStringList_Append(&config_argv, L""); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - else { - PyWideStringList slice; - slice.length = cmdline_argv->length - opt_index; - slice.items = &cmdline_argv->items[opt_index]; - if (_PyWideStringList_Copy(&config_argv, &slice) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - assert(config_argv.length >= 1); - - wchar_t *arg0 = NULL; - if (config->run_command != NULL) { - /* Force sys.argv[0] = '-c' */ - arg0 = L"-c"; - } - else if (config->run_module != NULL) { - /* Force sys.argv[0] = '-m'*/ - arg0 = L"-m"; - } - - if (arg0 != NULL) { - arg0 = _PyMem_RawWcsdup(arg0); - if (arg0 == NULL) { - _PyWideStringList_Clear(&config_argv); - return _PyStatus_NO_MEMORY(); - } - - PyMem_RawFree(config_argv.items[0]); - config_argv.items[0] = arg0; - } - - _PyWideStringList_Clear(&config->argv); - config->argv = config_argv; - return _PyStatus_OK(); -} - - -static PyStatus -core_read_precmdline(PyConfig *config, _PyPreCmdline *precmdline) -{ - PyStatus status; - - if (config->parse_argv) { - if (_PyWideStringList_Copy(&precmdline->argv, &config->argv) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - - PyPreConfig preconfig; - - status = _PyPreConfig_InitFromPreConfig(&preconfig, &_PyRuntime.preconfig); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - _PyPreConfig_GetConfig(&preconfig, config); - - status = _PyPreCmdline_Read(precmdline, &preconfig); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - status = _PyPreCmdline_SetConfig(precmdline, config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); -} - - -/* Get run_filename absolute path */ -static PyStatus -config_run_filename_abspath(PyConfig *config) -{ - if (!config->run_filename) { - return _PyStatus_OK(); - } - -#ifndef MS_WINDOWS - if (_Py_isabs(config->run_filename)) { - /* path is already absolute */ - return _PyStatus_OK(); - } -#endif - - wchar_t *abs_filename; - if (_Py_abspath(config->run_filename, &abs_filename) < 0) { - /* failed to get the absolute path of the command line filename: - ignore the error, keep the relative path */ - return _PyStatus_OK(); - } - if (abs_filename == NULL) { - return _PyStatus_NO_MEMORY(); - } - - PyMem_RawFree(config->run_filename); - config->run_filename = abs_filename; - return _PyStatus_OK(); -} - - -static PyStatus -config_read_cmdline(PyConfig *config) -{ - PyStatus status; - PyWideStringList cmdline_warnoptions = _PyWideStringList_INIT; - PyWideStringList env_warnoptions = _PyWideStringList_INIT; - PyWideStringList sys_warnoptions = _PyWideStringList_INIT; - - if (config->parse_argv < 0) { - config->parse_argv = 1; - } - - if (config->program_name == NULL) { - status = config_init_program_name(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->parse_argv) { - Py_ssize_t opt_index; - status = config_parse_cmdline(config, &cmdline_warnoptions, &opt_index); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = config_run_filename_abspath(config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = config_update_argv(config, opt_index); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - } - else { - status = config_run_filename_abspath(config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - } - - if (config->use_environment) { - status = config_init_env_warnoptions(config, &env_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - } - - /* Handle early PySys_AddWarnOption() calls */ - status = _PySys_ReadPreinitWarnOptions(&sys_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = config_init_warnoptions(config, - &cmdline_warnoptions, - &env_warnoptions, - &sys_warnoptions); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = _PyStatus_OK(); - -done: - _PyWideStringList_Clear(&cmdline_warnoptions); - _PyWideStringList_Clear(&env_warnoptions); - _PyWideStringList_Clear(&sys_warnoptions); - return status; -} - - -PyStatus -_PyConfig_SetPyArgv(PyConfig *config, const _PyArgv *args) -{ - PyStatus status = _Py_PreInitializeFromConfig(config, args); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - return _PyArgv_AsWstrList(args, &config->argv); -} - - -/* Set config.argv: decode argv using Py_DecodeLocale(). Pre-initialize Python - if needed to ensure that encodings are properly configured. */ -PyStatus -PyConfig_SetBytesArgv(PyConfig *config, Py_ssize_t argc, char * const *argv) -{ - _PyArgv args = { - .argc = argc, - .use_bytes_argv = 1, - .bytes_argv = argv, - .wchar_argv = NULL}; - return _PyConfig_SetPyArgv(config, &args); -} - - -PyStatus -PyConfig_SetArgv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv) -{ - _PyArgv args = { - .argc = argc, - .use_bytes_argv = 0, - .bytes_argv = NULL, - .wchar_argv = argv}; - return _PyConfig_SetPyArgv(config, &args); -} - - -PyStatus -PyConfig_SetWideStringList(PyConfig *config, PyWideStringList *list, - Py_ssize_t length, wchar_t **items) -{ - PyStatus status = _Py_PreInitializeFromConfig(config, NULL); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - PyWideStringList list2 = {.length = length, .items = items}; - if (_PyWideStringList_Copy(list, &list2) < 0) { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); -} - - -/* Read the configuration into PyConfig from: - - * Command line arguments - * Environment variables - * Py_xxx global configuration variables - - The only side effects are to modify config and to call _Py_SetArgcArgv(). */ -PyStatus -PyConfig_Read(PyConfig *config) -{ - PyStatus status; - - status = _Py_PreInitializeFromConfig(config, NULL); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - config_get_global_vars(config); - - if (config->_orig_argv.length == 0 - && !(config->argv.length == 1 - && wcscmp(config->argv.items[0], L"") == 0)) - { - if (_PyWideStringList_Copy(&config->_orig_argv, &config->argv) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - - _PyPreCmdline precmdline = _PyPreCmdline_INIT; - status = core_read_precmdline(config, &precmdline); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - assert(config->isolated >= 0); - if (config->isolated) { - config->use_environment = 0; - config->user_site_directory = 0; - } - - status = config_read_cmdline(config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - /* Handle early PySys_AddXOption() calls */ - status = _PySys_ReadPreinitXOptions(config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = config_read(config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - /* Check config consistency */ - assert(config->isolated >= 0); - assert(config->use_environment >= 0); - assert(config->dev_mode >= 0); - assert(config->_use_peg_parser >= 0); - assert(config->install_signal_handlers >= 0); - assert(config->use_hash_seed >= 0); - assert(config->faulthandler >= 0); - assert(config->tracemalloc >= 0); - assert(config->site_import >= 0); - assert(config->bytes_warning >= 0); - assert(config->inspect >= 0); - assert(config->interactive >= 0); - assert(config->optimization_level >= 0); - assert(config->parser_debug >= 0); - assert(config->write_bytecode >= 0); - assert(config->verbose >= 0); - assert(config->quiet >= 0); - assert(config->user_site_directory >= 0); - assert(config->parse_argv >= 0); - assert(config->configure_c_stdio >= 0); - assert(config->buffered_stdio >= 0); - assert(config->program_name != NULL); - assert(_PyWideStringList_CheckConsistency(&config->argv)); - /* sys.argv must be non-empty: empty argv is replaced with [''] */ - assert(config->argv.length >= 1); - assert(_PyWideStringList_CheckConsistency(&config->xoptions)); - assert(_PyWideStringList_CheckConsistency(&config->warnoptions)); - assert(_PyWideStringList_CheckConsistency(&config->module_search_paths)); - if (config->_install_importlib) { - assert(config->module_search_paths_set != 0); - /* don't check config->module_search_paths */ - assert(config->executable != NULL); - assert(config->base_executable != NULL); - assert(config->prefix != NULL); - assert(config->base_prefix != NULL); - assert(config->exec_prefix != NULL); - assert(config->base_exec_prefix != NULL); - } - assert(config->platlibdir != NULL); - assert(config->filesystem_encoding != NULL); - assert(config->filesystem_errors != NULL); - assert(config->stdio_encoding != NULL); - assert(config->stdio_errors != NULL); -#ifdef MS_WINDOWS - assert(config->legacy_windows_stdio >= 0); -#endif - /* -c and -m options are exclusive */ - assert(!(config->run_command != NULL && config->run_module != NULL)); - assert(config->check_hash_pycs_mode != NULL); - assert(config->_install_importlib >= 0); - assert(config->pathconfig_warnings >= 0); - assert(_PyWideStringList_CheckConsistency(&config->_orig_argv)); - - status = _PyStatus_OK(); - -done: - _PyPreCmdline_Clear(&precmdline); - return status; -} - - -PyObject* -_Py_GetConfigsAsDict(void) -{ - PyObject *result = NULL; - PyObject *dict = NULL; - - result = PyDict_New(); - if (result == NULL) { - goto error; - } - - /* global result */ - dict = _Py_GetGlobalVariablesAsDict(); - if (dict == NULL) { - goto error; - } - if (PyDict_SetItemString(result, "global_config", dict) < 0) { - goto error; - } - Py_CLEAR(dict); - - /* pre config */ - PyThreadState *tstate = _PyThreadState_GET(); - const PyPreConfig *pre_config = &tstate->interp->runtime->preconfig; - dict = _PyPreConfig_AsDict(pre_config); - if (dict == NULL) { - goto error; - } - if (PyDict_SetItemString(result, "pre_config", dict) < 0) { - goto error; - } - Py_CLEAR(dict); - - /* core config */ - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - dict = config_as_dict(config); - if (dict == NULL) { - goto error; - } - if (PyDict_SetItemString(result, "config", dict) < 0) { - goto error; - } - Py_CLEAR(dict); - - return result; - -error: - Py_XDECREF(result); - Py_XDECREF(dict); - return NULL; -} - - -static void -init_dump_ascii_wstr(const wchar_t *str) -{ - if (str == NULL) { - PySys_WriteStderr("(not set)"); - return; - } - - PySys_WriteStderr("'"); - for (; *str != L'\0'; str++) { - unsigned int ch = (unsigned int)*str; - if (ch == L'\'') { - PySys_WriteStderr("\\'"); - } else if (0x20 <= ch && ch < 0x7f) { - PySys_WriteStderr("%c", ch); - } - else if (ch <= 0xff) { - PySys_WriteStderr("\\x%02x", ch); - } -#if SIZEOF_WCHAR_T > 2 - else if (ch > 0xffff) { - PySys_WriteStderr("\\U%08x", ch); - } -#endif - else { - PySys_WriteStderr("\\u%04x", ch); - } - } - PySys_WriteStderr("'"); -} - - -/* Dump the Python path configuration into sys.stderr */ -void -_Py_DumpPathConfig(PyThreadState *tstate) -{ - PyObject *exc_type, *exc_value, *exc_tb; - _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); - - PySys_WriteStderr("Python path configuration:\n"); - -#define DUMP_CONFIG(NAME, FIELD) \ - do { \ - PySys_WriteStderr(" " NAME " = "); \ - init_dump_ascii_wstr(config->FIELD); \ - PySys_WriteStderr("\n"); \ - } while (0) - - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - DUMP_CONFIG("PYTHONHOME", home); - DUMP_CONFIG("PYTHONPATH", pythonpath_env); - DUMP_CONFIG("program name", program_name); - PySys_WriteStderr(" isolated = %i\n", config->isolated); - PySys_WriteStderr(" environment = %i\n", config->use_environment); - PySys_WriteStderr(" user site = %i\n", config->user_site_directory); - PySys_WriteStderr(" import site = %i\n", config->site_import); -#undef DUMP_CONFIG - -#define DUMP_SYS(NAME) \ - do { \ - obj = PySys_GetObject(#NAME); \ - PySys_FormatStderr(" sys.%s = ", #NAME); \ - if (obj != NULL) { \ - PySys_FormatStderr("%A", obj); \ - } \ - else { \ - PySys_WriteStderr("(not set)"); \ - } \ - PySys_FormatStderr("\n"); \ - } while (0) - - PyObject *obj; - DUMP_SYS(_base_executable); - DUMP_SYS(base_prefix); - DUMP_SYS(base_exec_prefix); - DUMP_SYS(platlibdir); - DUMP_SYS(executable); - DUMP_SYS(prefix); - DUMP_SYS(exec_prefix); -#undef DUMP_SYS - - PyObject *sys_path = PySys_GetObject("path"); /* borrowed reference */ - if (sys_path != NULL && PyList_Check(sys_path)) { - PySys_WriteStderr(" sys.path = [\n"); - Py_ssize_t len = PyList_GET_SIZE(sys_path); - for (Py_ssize_t i=0; i < len; i++) { - PyObject *path = PyList_GET_ITEM(sys_path, i); - PySys_FormatStderr(" %A,\n", path); - } - PySys_WriteStderr(" ]\n"); - } - - _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); -} +#include "Python.h" +#include "pycore_fileutils.h" // _Py_HasFileSystemDefaultEncodeErrors +#include "pycore_getopt.h" // _PyOS_GetOpt() +#include "pycore_initconfig.h" // _PyStatus_OK() +#include "pycore_interp.h" // _PyInterpreterState.runtime +#include "pycore_pathconfig.h" // _Py_path_config +#include "pycore_pyerrors.h" // _PyErr_Fetch() +#include "pycore_pylifecycle.h" // _Py_PreInitializeFromConfig() +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "pycore_pystate.h" // _PyThreadState_GET() + +#include "osdefs.h" // DELIM +#include <locale.h> // setlocale() +#ifdef HAVE_LANGINFO_H +# include <langinfo.h> // nl_langinfo(CODESET) +#endif +#if defined(MS_WINDOWS) || defined(__CYGWIN__) +# include <windows.h> // GetACP() +# ifdef HAVE_IO_H +# include <io.h> +# endif +# ifdef HAVE_FCNTL_H +# include <fcntl.h> // O_BINARY +# endif +#endif + +#ifndef PLATLIBDIR +# error "PLATLIBDIR macro must be defined" +#endif + + +/* --- Command line options --------------------------------------- */ + +/* Short usage message (with %s for argv0) */ +static const char usage_line[] = +"usage: %ls [option] ... [-c cmd | -m mod | file | -] [arg] ...\n"; + +/* Long usage message, split into parts < 512 bytes */ +static const char usage_1[] = "\ +Options and arguments (and corresponding environment variables):\n\ +-b : issue warnings about str(bytes_instance), str(bytearray_instance)\n\ + and comparing bytes/bytearray with str. (-bb: issue errors)\n\ +-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\ +-c cmd : program passed in as string (terminates option list)\n\ +-d : turn on parser debugging output (for experts only, only works on\n\ + debug builds); also PYTHONDEBUG=x\n\ +-E : ignore PYTHON* environment variables (such as PYTHONPATH)\n\ +-h : print this help message and exit (also --help)\n\ +"; +static const char usage_2[] = "\ +-i : inspect interactively after running script; forces a prompt even\n\ + if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\ +-I : isolate Python from the user's environment (implies -E and -s)\n\ +-m mod : run library module as a script (terminates option list)\n\ +-O : remove assert and __debug__-dependent statements; add .opt-1 before\n\ + .pyc extension; also PYTHONOPTIMIZE=x\n\ +-OO : do -O changes and also discard docstrings; add .opt-2 before\n\ + .pyc extension\n\ +-q : don't print version and copyright messages on interactive startup\n\ +-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ +-S : don't imply 'import site' on initialization\n\ +"; +static const char usage_3[] = "\ +-u : force the stdout and stderr streams to be unbuffered;\n\ + this option has no effect on stdin; also PYTHONUNBUFFERED=x\n\ +-v : verbose (trace import statements); also PYTHONVERBOSE=x\n\ + can be supplied multiple times to increase verbosity\n\ +-V : print the Python version number and exit (also --version)\n\ + when given twice, print more information about the build\n\ +-W arg : warning control; arg is action:message:category:module:lineno\n\ + also PYTHONWARNINGS=arg\n\ +-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ +-X opt : set implementation-specific option. The following options are available:\n\ +\n\ + -X faulthandler: enable faulthandler\n\ + -X oldparser: enable the traditional LL(1) parser; also PYTHONOLDPARSER\n\ + -X showrefcount: output the total reference count and number of used\n\ + memory blocks when the program finishes or after each statement in the\n\ + interactive interpreter. This only works on debug builds\n\ + -X tracemalloc: start tracing Python memory allocations using the\n\ + tracemalloc module. By default, only the most recent frame is stored in a\n\ + traceback of a trace. Use -X tracemalloc=NFRAME to start tracing with a\n\ + traceback limit of NFRAME frames\n\ + -X importtime: show how long each import takes. It shows module name,\n\ + cumulative time (including nested imports) and self time (excluding\n\ + nested imports). Note that its output may be broken in multi-threaded\n\ + application. Typical usage is python3 -X importtime -c 'import asyncio'\n\ + -X dev: enable CPython's \"development mode\", introducing additional runtime\n\ + checks which are too expensive to be enabled by default. Effect of the\n\ + developer mode:\n\ + * Add default warning filter, as -W default\n\ + * Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks() C function\n\ + * Enable the faulthandler module to dump the Python traceback on a crash\n\ + * Enable asyncio debug mode\n\ + * Set the dev_mode attribute of sys.flags to True\n\ + * io.IOBase destructor logs close() exceptions\n\ + -X utf8: enable UTF-8 mode for operating system interfaces, overriding the default\n\ + locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode (even when it would\n\ + otherwise activate automatically)\n\ + -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\ + given directory instead of to the code tree\n\ +\n\ +--check-hash-based-pycs always|default|never:\n\ + control how Python invalidates hash-based .pyc files\n\ +"; +static const char usage_4[] = "\ +file : program read from script file\n\ +- : program read from stdin (default; interactive mode if a tty)\n\ +arg ...: arguments passed to program in sys.argv[1:]\n\n\ +Other environment variables:\n\ +PYTHONSTARTUP: file executed on interactive startup (no default)\n\ +PYTHONPATH : '%lc'-separated list of directories prefixed to the\n\ + default module search path. The result is sys.path.\n\ +"; +static const char usage_5[] = +"PYTHONHOME : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n" +" The default module search path uses %s.\n" +"PYTHONPLATLIBDIR : override sys.platlibdir.\n" +"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n" +"PYTHONUTF8: if set to 1, enable the UTF-8 mode.\n" +"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n" +"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"; +static const char usage_6[] = +"PYTHONHASHSEED: if this variable is set to 'random', a random value is used\n" +" to seed the hashes of str and bytes objects. It can also be set to an\n" +" integer in the range [0,4294967295] to get hash values with a\n" +" predictable seed.\n" +"PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" +" on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" +" hooks.\n" +"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" +" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" +" locale coercion and locale compatibility warnings on stderr.\n" +"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n" +" debugger. It can be set to the callable of your debugger of choice.\n" +"PYTHONDEVMODE: enable the development mode.\n" +"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"; + +#if defined(MS_WINDOWS) +# define PYTHONHOMEHELP "<prefix>\\python{major}{minor}" +#else +# define PYTHONHOMEHELP "<prefix>/lib/pythonX.X" +#endif + + +/* --- Global configuration variables ----------------------------- */ + +/* UTF-8 mode (PEP 540): if equals to 1, use the UTF-8 encoding, and change + stdin and stdout error handler to "surrogateescape". */ +int Py_UTF8Mode = 0; +int Py_DebugFlag = 0; /* Needed by parser.c */ +int Py_VerboseFlag = 0; /* Needed by import.c */ +int Py_QuietFlag = 0; /* Needed by sysmodule.c */ +int Py_InteractiveFlag = 0; /* Needed by Py_FdIsInteractive() below */ +int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */ +int Py_OptimizeFlag = 0; /* Needed by compile.c */ +int Py_NoSiteFlag = 0; /* Suppress 'import site' */ +int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ +int Py_FrozenFlag = 1; /* Needed by getpath.c */ +int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */ +int Py_DontWriteBytecodeFlag = 0; /* Suppress writing bytecode files (*.pyc) */ +int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ +int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ +int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */ +int Py_IsolatedFlag = 0; /* for -I, isolate from user's env */ +#ifdef MS_WINDOWS +int Py_LegacyWindowsFSEncodingFlag = 0; /* Uses mbcs instead of utf-8 */ +int Py_LegacyWindowsStdioFlag = 0; /* Uses FileIO instead of WindowsConsoleIO */ +#endif + + +static PyObject * +_Py_GetGlobalVariablesAsDict(void) +{ + PyObject *dict, *obj; + + dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + +#define SET_ITEM(KEY, EXPR) \ + do { \ + obj = (EXPR); \ + if (obj == NULL) { \ + return NULL; \ + } \ + int res = PyDict_SetItemString(dict, (KEY), obj); \ + Py_DECREF(obj); \ + if (res < 0) { \ + goto fail; \ + } \ + } while (0) +#define SET_ITEM_INT(VAR) \ + SET_ITEM(#VAR, PyLong_FromLong(VAR)) +#define FROM_STRING(STR) \ + ((STR != NULL) ? \ + PyUnicode_FromString(STR) \ + : (Py_INCREF(Py_None), Py_None)) +#define SET_ITEM_STR(VAR) \ + SET_ITEM(#VAR, FROM_STRING(VAR)) + + SET_ITEM_STR(Py_FileSystemDefaultEncoding); + SET_ITEM_INT(Py_HasFileSystemDefaultEncoding); + SET_ITEM_STR(Py_FileSystemDefaultEncodeErrors); + SET_ITEM_INT(_Py_HasFileSystemDefaultEncodeErrors); + + SET_ITEM_INT(Py_UTF8Mode); + SET_ITEM_INT(Py_DebugFlag); + SET_ITEM_INT(Py_VerboseFlag); + SET_ITEM_INT(Py_QuietFlag); + SET_ITEM_INT(Py_InteractiveFlag); + SET_ITEM_INT(Py_InspectFlag); + + SET_ITEM_INT(Py_OptimizeFlag); + SET_ITEM_INT(Py_NoSiteFlag); + SET_ITEM_INT(Py_BytesWarningFlag); + SET_ITEM_INT(Py_FrozenFlag); + SET_ITEM_INT(Py_IgnoreEnvironmentFlag); + SET_ITEM_INT(Py_DontWriteBytecodeFlag); + SET_ITEM_INT(Py_NoUserSiteDirectory); + SET_ITEM_INT(Py_UnbufferedStdioFlag); + SET_ITEM_INT(Py_HashRandomizationFlag); + SET_ITEM_INT(Py_IsolatedFlag); + +#ifdef MS_WINDOWS + SET_ITEM_INT(Py_LegacyWindowsFSEncodingFlag); + SET_ITEM_INT(Py_LegacyWindowsStdioFlag); +#endif + + return dict; + +fail: + Py_DECREF(dict); + return NULL; + +#undef FROM_STRING +#undef SET_ITEM +#undef SET_ITEM_INT +#undef SET_ITEM_STR +} + + +/* --- PyStatus ----------------------------------------------- */ + +PyStatus PyStatus_Ok(void) +{ return _PyStatus_OK(); } + +PyStatus PyStatus_Error(const char *err_msg) +{ + return (PyStatus){._type = _PyStatus_TYPE_ERROR, + .err_msg = err_msg}; +} + +PyStatus PyStatus_NoMemory(void) +{ return PyStatus_Error("memory allocation failed"); } + +PyStatus PyStatus_Exit(int exitcode) +{ return _PyStatus_EXIT(exitcode); } + + +int PyStatus_IsError(PyStatus status) +{ return _PyStatus_IS_ERROR(status); } + +int PyStatus_IsExit(PyStatus status) +{ return _PyStatus_IS_EXIT(status); } + +int PyStatus_Exception(PyStatus status) +{ return _PyStatus_EXCEPTION(status); } + + +/* --- PyWideStringList ------------------------------------------------ */ + +#ifndef NDEBUG +int +_PyWideStringList_CheckConsistency(const PyWideStringList *list) +{ + assert(list->length >= 0); + if (list->length != 0) { + assert(list->items != NULL); + } + for (Py_ssize_t i = 0; i < list->length; i++) { + assert(list->items[i] != NULL); + } + return 1; +} +#endif /* Py_DEBUG */ + + +void +_PyWideStringList_Clear(PyWideStringList *list) +{ + assert(_PyWideStringList_CheckConsistency(list)); + for (Py_ssize_t i=0; i < list->length; i++) { + PyMem_RawFree(list->items[i]); + } + PyMem_RawFree(list->items); + list->length = 0; + list->items = NULL; +} + + +int +_PyWideStringList_Copy(PyWideStringList *list, const PyWideStringList *list2) +{ + assert(_PyWideStringList_CheckConsistency(list)); + assert(_PyWideStringList_CheckConsistency(list2)); + + if (list2->length == 0) { + _PyWideStringList_Clear(list); + return 0; + } + + PyWideStringList copy = _PyWideStringList_INIT; + + size_t size = list2->length * sizeof(list2->items[0]); + copy.items = PyMem_RawMalloc(size); + if (copy.items == NULL) { + return -1; + } + + for (Py_ssize_t i=0; i < list2->length; i++) { + wchar_t *item = _PyMem_RawWcsdup(list2->items[i]); + if (item == NULL) { + _PyWideStringList_Clear(©); + return -1; + } + copy.items[i] = item; + copy.length = i + 1; + } + + _PyWideStringList_Clear(list); + *list = copy; + return 0; +} + + +PyStatus +PyWideStringList_Insert(PyWideStringList *list, + Py_ssize_t index, const wchar_t *item) +{ + Py_ssize_t len = list->length; + if (len == PY_SSIZE_T_MAX) { + /* length+1 would overflow */ + return _PyStatus_NO_MEMORY(); + } + if (index < 0) { + return _PyStatus_ERR("PyWideStringList_Insert index must be >= 0"); + } + if (index > len) { + index = len; + } + + wchar_t *item2 = _PyMem_RawWcsdup(item); + if (item2 == NULL) { + return _PyStatus_NO_MEMORY(); + } + + size_t size = (len + 1) * sizeof(list->items[0]); + wchar_t **items2 = (wchar_t **)PyMem_RawRealloc(list->items, size); + if (items2 == NULL) { + PyMem_RawFree(item2); + return _PyStatus_NO_MEMORY(); + } + + if (index < len) { + memmove(&items2[index + 1], + &items2[index], + (len - index) * sizeof(items2[0])); + } + + items2[index] = item2; + list->items = items2; + list->length++; + return _PyStatus_OK(); +} + + +PyStatus +PyWideStringList_Append(PyWideStringList *list, const wchar_t *item) +{ + return PyWideStringList_Insert(list, list->length, item); +} + + +PyStatus +_PyWideStringList_Extend(PyWideStringList *list, const PyWideStringList *list2) +{ + for (Py_ssize_t i = 0; i < list2->length; i++) { + PyStatus status = PyWideStringList_Append(list, list2->items[i]); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + return _PyStatus_OK(); +} + + +static int +_PyWideStringList_Find(PyWideStringList *list, const wchar_t *item) +{ + for (Py_ssize_t i = 0; i < list->length; i++) { + if (wcscmp(list->items[i], item) == 0) { + return 1; + } + } + return 0; +} + + +PyObject* +_PyWideStringList_AsList(const PyWideStringList *list) +{ + assert(_PyWideStringList_CheckConsistency(list)); + + PyObject *pylist = PyList_New(list->length); + if (pylist == NULL) { + return NULL; + } + + for (Py_ssize_t i = 0; i < list->length; i++) { + PyObject *item = PyUnicode_FromWideChar(list->items[i], -1); + if (item == NULL) { + Py_DECREF(pylist); + return NULL; + } + PyList_SET_ITEM(pylist, i, item); + } + return pylist; +} + + +/* --- Py_SetStandardStreamEncoding() ----------------------------- */ + +/* Helper to allow an embedding application to override the normal + * mechanism that attempts to figure out an appropriate IO encoding + */ + +static char *_Py_StandardStreamEncoding = NULL; +static char *_Py_StandardStreamErrors = NULL; + +int +Py_SetStandardStreamEncoding(const char *encoding, const char *errors) +{ + if (Py_IsInitialized()) { + /* This is too late to have any effect */ + return -1; + } + + int res = 0; + + /* Py_SetStandardStreamEncoding() can be called before Py_Initialize(), + but Py_Initialize() can change the allocator. Use a known allocator + to be able to release the memory later. */ + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + /* Can't call PyErr_NoMemory() on errors, as Python hasn't been + * initialised yet. + * + * However, the raw memory allocators are initialised appropriately + * as C static variables, so _PyMem_RawStrdup is OK even though + * Py_Initialize hasn't been called yet. + */ + if (encoding) { + PyMem_RawFree(_Py_StandardStreamEncoding); + _Py_StandardStreamEncoding = _PyMem_RawStrdup(encoding); + if (!_Py_StandardStreamEncoding) { + res = -2; + goto done; + } + } + if (errors) { + PyMem_RawFree(_Py_StandardStreamErrors); + _Py_StandardStreamErrors = _PyMem_RawStrdup(errors); + if (!_Py_StandardStreamErrors) { + PyMem_RawFree(_Py_StandardStreamEncoding); + _Py_StandardStreamEncoding = NULL; + res = -3; + goto done; + } + } +#ifdef MS_WINDOWS + if (_Py_StandardStreamEncoding) { + /* Overriding the stream encoding implies legacy streams */ + Py_LegacyWindowsStdioFlag = 1; + } +#endif + +done: + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + return res; +} + + +void +_Py_ClearStandardStreamEncoding(void) +{ + /* Use the same allocator than Py_SetStandardStreamEncoding() */ + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + /* We won't need them anymore. */ + if (_Py_StandardStreamEncoding) { + PyMem_RawFree(_Py_StandardStreamEncoding); + _Py_StandardStreamEncoding = NULL; + } + if (_Py_StandardStreamErrors) { + PyMem_RawFree(_Py_StandardStreamErrors); + _Py_StandardStreamErrors = NULL; + } + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); +} + + +/* --- Py_GetArgcArgv() ------------------------------------------- */ + +/* For Py_GetArgcArgv(); set by _Py_SetArgcArgv() */ +static PyWideStringList orig_argv = {.length = 0, .items = NULL}; + + +void +_Py_ClearArgcArgv(void) +{ + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + _PyWideStringList_Clear(&orig_argv); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); +} + + +static int +_Py_SetArgcArgv(Py_ssize_t argc, wchar_t * const *argv) +{ + const PyWideStringList argv_list = {.length = argc, .items = (wchar_t **)argv}; + int res; + + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + res = _PyWideStringList_Copy(&orig_argv, &argv_list); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + return res; +} + + +void +Py_GetArgcArgv(int *argc, wchar_t ***argv) +{ + *argc = (int)orig_argv.length; + *argv = orig_argv.items; +} + + +void +Py_InitArgcArgv(int argc, wchar_t **argv) +{ + _Py_SetArgcArgv((Py_ssize_t)argc, argv); +} + +/* --- PyConfig ---------------------------------------------- */ + +#define DECODE_LOCALE_ERR(NAME, LEN) \ + (((LEN) == -2) \ + ? _PyStatus_ERR("cannot decode " NAME) \ + : _PyStatus_NO_MEMORY()) + + +/* Free memory allocated in config, but don't clear all attributes */ +void +PyConfig_Clear(PyConfig *config) +{ +#define CLEAR(ATTR) \ + do { \ + PyMem_RawFree(ATTR); \ + ATTR = NULL; \ + } while (0) + + CLEAR(config->pycache_prefix); + CLEAR(config->pythonpath_env); + CLEAR(config->home); + CLEAR(config->program_name); + + _PyWideStringList_Clear(&config->argv); + _PyWideStringList_Clear(&config->warnoptions); + _PyWideStringList_Clear(&config->xoptions); + _PyWideStringList_Clear(&config->module_search_paths); + config->module_search_paths_set = 0; + + CLEAR(config->executable); + CLEAR(config->base_executable); + CLEAR(config->prefix); + CLEAR(config->base_prefix); + CLEAR(config->exec_prefix); + CLEAR(config->base_exec_prefix); + CLEAR(config->platlibdir); + + CLEAR(config->filesystem_encoding); + CLEAR(config->filesystem_errors); + CLEAR(config->stdio_encoding); + CLEAR(config->stdio_errors); + CLEAR(config->run_command); + CLEAR(config->run_module); + CLEAR(config->run_filename); + CLEAR(config->check_hash_pycs_mode); + + _PyWideStringList_Clear(&config->_orig_argv); +#undef CLEAR +} + + +void +_PyConfig_InitCompatConfig(PyConfig *config) +{ + memset(config, 0, sizeof(*config)); + + config->_config_init = (int)_PyConfig_INIT_COMPAT; + config->isolated = -1; + config->use_environment = -1; + config->dev_mode = -1; + config->install_signal_handlers = 1; + config->use_hash_seed = -1; + config->faulthandler = -1; + config->tracemalloc = -1; + config->module_search_paths_set = 0; + config->parse_argv = 0; + config->site_import = -1; + config->bytes_warning = -1; + config->inspect = -1; + config->interactive = -1; + config->optimization_level = -1; + config->parser_debug= -1; + config->write_bytecode = -1; + config->verbose = -1; + config->quiet = -1; + config->user_site_directory = -1; + config->configure_c_stdio = 0; + config->buffered_stdio = -1; + config->_install_importlib = 1; + config->check_hash_pycs_mode = NULL; + config->pathconfig_warnings = -1; + config->_init_main = 1; + config->_isolated_interpreter = 0; +#ifdef MS_WINDOWS + config->legacy_windows_stdio = -1; +#endif + config->_use_peg_parser = 1; +} + + +static void +config_init_defaults(PyConfig *config) +{ + _PyConfig_InitCompatConfig(config); + + config->isolated = 0; + config->use_environment = 1; + config->site_import = 1; + config->bytes_warning = 0; + config->inspect = 0; + config->interactive = 0; + config->optimization_level = 0; + config->parser_debug= 0; + config->write_bytecode = 1; + config->verbose = 0; + config->quiet = 0; + config->user_site_directory = 1; + config->buffered_stdio = 1; + config->pathconfig_warnings = 1; +#ifdef MS_WINDOWS + config->legacy_windows_stdio = 0; +#endif +} + + +void +PyConfig_InitPythonConfig(PyConfig *config) +{ + config_init_defaults(config); + + config->_config_init = (int)_PyConfig_INIT_PYTHON; + config->configure_c_stdio = 1; + config->parse_argv = 1; +} + + +void +PyConfig_InitIsolatedConfig(PyConfig *config) +{ + config_init_defaults(config); + + config->_config_init = (int)_PyConfig_INIT_ISOLATED; + config->isolated = 1; + config->use_environment = 0; + config->user_site_directory = 0; + config->dev_mode = 0; + config->install_signal_handlers = 0; + config->use_hash_seed = 0; + config->faulthandler = 0; + config->tracemalloc = 0; + config->pathconfig_warnings = 0; +#ifdef MS_WINDOWS + config->legacy_windows_stdio = 0; +#endif +} + + +/* Copy str into *config_str (duplicate the string) */ +PyStatus +PyConfig_SetString(PyConfig *config, wchar_t **config_str, const wchar_t *str) +{ + PyStatus status = _Py_PreInitializeFromConfig(config, NULL); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + wchar_t *str2; + if (str != NULL) { + str2 = _PyMem_RawWcsdup(str); + if (str2 == NULL) { + return _PyStatus_NO_MEMORY(); + } + } + else { + str2 = NULL; + } + PyMem_RawFree(*config_str); + *config_str = str2; + return _PyStatus_OK(); +} + + +static PyStatus +config_set_bytes_string(PyConfig *config, wchar_t **config_str, + const char *str, const char *decode_err_msg) +{ + PyStatus status = _Py_PreInitializeFromConfig(config, NULL); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + wchar_t *str2; + if (str != NULL) { + size_t len; + str2 = Py_DecodeLocale(str, &len); + if (str2 == NULL) { + if (len == (size_t)-2) { + return _PyStatus_ERR(decode_err_msg); + } + else { + return _PyStatus_NO_MEMORY(); + } + } + } + else { + str2 = NULL; + } + PyMem_RawFree(*config_str); + *config_str = str2; + return _PyStatus_OK(); +} + + +#define CONFIG_SET_BYTES_STR(config, config_str, str, NAME) \ + config_set_bytes_string(config, config_str, str, "cannot decode " NAME) + + +/* Decode str using Py_DecodeLocale() and set the result into *config_str. + Pre-initialize Python if needed to ensure that encodings are properly + configured. */ +PyStatus +PyConfig_SetBytesString(PyConfig *config, wchar_t **config_str, + const char *str) +{ + return CONFIG_SET_BYTES_STR(config, config_str, str, "string"); +} + + +PyStatus +_PyConfig_Copy(PyConfig *config, const PyConfig *config2) +{ + PyStatus status; + + PyConfig_Clear(config); + +#define COPY_ATTR(ATTR) config->ATTR = config2->ATTR +#define COPY_WSTR_ATTR(ATTR) \ + do { \ + status = PyConfig_SetString(config, &config->ATTR, config2->ATTR); \ + if (_PyStatus_EXCEPTION(status)) { \ + return status; \ + } \ + } while (0) +#define COPY_WSTRLIST(LIST) \ + do { \ + if (_PyWideStringList_Copy(&config->LIST, &config2->LIST) < 0) { \ + return _PyStatus_NO_MEMORY(); \ + } \ + } while (0) + + COPY_ATTR(_config_init); + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(dev_mode); + COPY_ATTR(_use_peg_parser); + COPY_ATTR(install_signal_handlers); + COPY_ATTR(use_hash_seed); + COPY_ATTR(hash_seed); + COPY_ATTR(_install_importlib); + COPY_ATTR(faulthandler); + COPY_ATTR(tracemalloc); + COPY_ATTR(import_time); + COPY_ATTR(show_ref_count); + COPY_ATTR(dump_refs); + COPY_ATTR(malloc_stats); + + COPY_WSTR_ATTR(pycache_prefix); + COPY_WSTR_ATTR(pythonpath_env); + COPY_WSTR_ATTR(home); + COPY_WSTR_ATTR(program_name); + + COPY_ATTR(parse_argv); + COPY_WSTRLIST(argv); + COPY_WSTRLIST(warnoptions); + COPY_WSTRLIST(xoptions); + COPY_WSTRLIST(module_search_paths); + COPY_ATTR(module_search_paths_set); + + COPY_WSTR_ATTR(executable); + COPY_WSTR_ATTR(base_executable); + COPY_WSTR_ATTR(prefix); + COPY_WSTR_ATTR(base_prefix); + COPY_WSTR_ATTR(exec_prefix); + COPY_WSTR_ATTR(base_exec_prefix); + COPY_WSTR_ATTR(platlibdir); + + COPY_ATTR(site_import); + COPY_ATTR(bytes_warning); + COPY_ATTR(inspect); + COPY_ATTR(interactive); + COPY_ATTR(optimization_level); + COPY_ATTR(parser_debug); + COPY_ATTR(write_bytecode); + COPY_ATTR(verbose); + COPY_ATTR(quiet); + COPY_ATTR(user_site_directory); + COPY_ATTR(configure_c_stdio); + COPY_ATTR(buffered_stdio); + COPY_WSTR_ATTR(filesystem_encoding); + COPY_WSTR_ATTR(filesystem_errors); + COPY_WSTR_ATTR(stdio_encoding); + COPY_WSTR_ATTR(stdio_errors); +#ifdef MS_WINDOWS + COPY_ATTR(legacy_windows_stdio); +#endif + COPY_ATTR(skip_source_first_line); + COPY_WSTR_ATTR(run_command); + COPY_WSTR_ATTR(run_module); + COPY_WSTR_ATTR(run_filename); + COPY_WSTR_ATTR(check_hash_pycs_mode); + COPY_ATTR(pathconfig_warnings); + COPY_ATTR(_init_main); + COPY_ATTR(_isolated_interpreter); + COPY_WSTRLIST(_orig_argv); + +#undef COPY_ATTR +#undef COPY_WSTR_ATTR +#undef COPY_WSTRLIST + return _PyStatus_OK(); +} + + +static PyObject * +config_as_dict(const PyConfig *config) +{ + PyObject *dict; + + dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + +#define SET_ITEM(KEY, EXPR) \ + do { \ + PyObject *obj = (EXPR); \ + if (obj == NULL) { \ + goto fail; \ + } \ + int res = PyDict_SetItemString(dict, (KEY), obj); \ + Py_DECREF(obj); \ + if (res < 0) { \ + goto fail; \ + } \ + } while (0) +#define SET_ITEM_INT(ATTR) \ + SET_ITEM(#ATTR, PyLong_FromLong(config->ATTR)) +#define SET_ITEM_UINT(ATTR) \ + SET_ITEM(#ATTR, PyLong_FromUnsignedLong(config->ATTR)) +#define FROM_WSTRING(STR) \ + ((STR != NULL) ? \ + PyUnicode_FromWideChar(STR, -1) \ + : (Py_INCREF(Py_None), Py_None)) +#define SET_ITEM_WSTR(ATTR) \ + SET_ITEM(#ATTR, FROM_WSTRING(config->ATTR)) +#define SET_ITEM_WSTRLIST(LIST) \ + SET_ITEM(#LIST, _PyWideStringList_AsList(&config->LIST)) + + SET_ITEM_INT(_config_init); + SET_ITEM_INT(isolated); + SET_ITEM_INT(use_environment); + SET_ITEM_INT(dev_mode); + SET_ITEM_INT(_use_peg_parser); + SET_ITEM_INT(install_signal_handlers); + SET_ITEM_INT(use_hash_seed); + SET_ITEM_UINT(hash_seed); + SET_ITEM_INT(faulthandler); + SET_ITEM_INT(tracemalloc); + SET_ITEM_INT(import_time); + SET_ITEM_INT(show_ref_count); + SET_ITEM_INT(dump_refs); + SET_ITEM_INT(malloc_stats); + SET_ITEM_WSTR(filesystem_encoding); + SET_ITEM_WSTR(filesystem_errors); + SET_ITEM_WSTR(pycache_prefix); + SET_ITEM_WSTR(program_name); + SET_ITEM_INT(parse_argv); + SET_ITEM_WSTRLIST(argv); + SET_ITEM_WSTRLIST(xoptions); + SET_ITEM_WSTRLIST(warnoptions); + SET_ITEM_WSTR(pythonpath_env); + SET_ITEM_WSTR(home); + SET_ITEM_WSTRLIST(module_search_paths); + SET_ITEM_WSTR(executable); + SET_ITEM_WSTR(base_executable); + SET_ITEM_WSTR(prefix); + SET_ITEM_WSTR(base_prefix); + SET_ITEM_WSTR(exec_prefix); + SET_ITEM_WSTR(base_exec_prefix); + SET_ITEM_WSTR(platlibdir); + SET_ITEM_INT(site_import); + SET_ITEM_INT(bytes_warning); + SET_ITEM_INT(inspect); + SET_ITEM_INT(interactive); + SET_ITEM_INT(optimization_level); + SET_ITEM_INT(parser_debug); + SET_ITEM_INT(write_bytecode); + SET_ITEM_INT(verbose); + SET_ITEM_INT(quiet); + SET_ITEM_INT(user_site_directory); + SET_ITEM_INT(configure_c_stdio); + SET_ITEM_INT(buffered_stdio); + SET_ITEM_WSTR(stdio_encoding); + SET_ITEM_WSTR(stdio_errors); +#ifdef MS_WINDOWS + SET_ITEM_INT(legacy_windows_stdio); +#endif + SET_ITEM_INT(skip_source_first_line); + SET_ITEM_WSTR(run_command); + SET_ITEM_WSTR(run_module); + SET_ITEM_WSTR(run_filename); + SET_ITEM_INT(_install_importlib); + SET_ITEM_WSTR(check_hash_pycs_mode); + SET_ITEM_INT(pathconfig_warnings); + SET_ITEM_INT(_init_main); + SET_ITEM_INT(_isolated_interpreter); + SET_ITEM_WSTRLIST(_orig_argv); + + return dict; + +fail: + Py_DECREF(dict); + return NULL; + +#undef FROM_WSTRING +#undef SET_ITEM +#undef SET_ITEM_INT +#undef SET_ITEM_UINT +#undef SET_ITEM_WSTR +#undef SET_ITEM_WSTRLIST +} + + +static const char* +config_get_env(const PyConfig *config, const char *name) +{ + return _Py_GetEnv(config->use_environment, name); +} + + +/* Get a copy of the environment variable as wchar_t*. + Return 0 on success, but *dest can be NULL. + Return -1 on memory allocation failure. Return -2 on decoding error. */ +static PyStatus +config_get_env_dup(PyConfig *config, + wchar_t **dest, + wchar_t *wname, char *name, + const char *decode_err_msg) +{ + assert(*dest == NULL); + assert(config->use_environment >= 0); + + if (!config->use_environment) { + *dest = NULL; + return _PyStatus_OK(); + } + +#ifdef MS_WINDOWS + const wchar_t *var = _wgetenv(wname); + if (!var || var[0] == '\0') { + *dest = NULL; + return _PyStatus_OK(); + } + + return PyConfig_SetString(config, dest, var); +#else + const char *var = getenv(name); + if (!var || var[0] == '\0') { + *dest = NULL; + return _PyStatus_OK(); + } + + return config_set_bytes_string(config, dest, var, decode_err_msg); +#endif +} + + +#define CONFIG_GET_ENV_DUP(CONFIG, DEST, WNAME, NAME) \ + config_get_env_dup(CONFIG, DEST, WNAME, NAME, "cannot decode " NAME) + + +static void +config_get_global_vars(PyConfig *config) +{ + if (config->_config_init != _PyConfig_INIT_COMPAT) { + /* Python and Isolated configuration ignore global variables */ + return; + } + +#define COPY_FLAG(ATTR, VALUE) \ + if (config->ATTR == -1) { \ + config->ATTR = VALUE; \ + } +#define COPY_NOT_FLAG(ATTR, VALUE) \ + if (config->ATTR == -1) { \ + config->ATTR = !(VALUE); \ + } + + COPY_FLAG(isolated, Py_IsolatedFlag); + COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); + COPY_FLAG(bytes_warning, Py_BytesWarningFlag); + COPY_FLAG(inspect, Py_InspectFlag); + COPY_FLAG(interactive, Py_InteractiveFlag); + COPY_FLAG(optimization_level, Py_OptimizeFlag); + COPY_FLAG(parser_debug, Py_DebugFlag); + COPY_FLAG(verbose, Py_VerboseFlag); + COPY_FLAG(quiet, Py_QuietFlag); +#ifdef MS_WINDOWS + COPY_FLAG(legacy_windows_stdio, Py_LegacyWindowsStdioFlag); +#endif + COPY_NOT_FLAG(pathconfig_warnings, Py_FrozenFlag); + + COPY_NOT_FLAG(buffered_stdio, Py_UnbufferedStdioFlag); + COPY_NOT_FLAG(site_import, Py_NoSiteFlag); + COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); + COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); + +#undef COPY_FLAG +#undef COPY_NOT_FLAG +} + + +/* Set Py_xxx global configuration variables from 'config' configuration. */ +static void +config_set_global_vars(const PyConfig *config) +{ +#define COPY_FLAG(ATTR, VAR) \ + if (config->ATTR != -1) { \ + VAR = config->ATTR; \ + } +#define COPY_NOT_FLAG(ATTR, VAR) \ + if (config->ATTR != -1) { \ + VAR = !config->ATTR; \ + } + + COPY_FLAG(isolated, Py_IsolatedFlag); + COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); + COPY_FLAG(bytes_warning, Py_BytesWarningFlag); + COPY_FLAG(inspect, Py_InspectFlag); + COPY_FLAG(interactive, Py_InteractiveFlag); + COPY_FLAG(optimization_level, Py_OptimizeFlag); + COPY_FLAG(parser_debug, Py_DebugFlag); + COPY_FLAG(verbose, Py_VerboseFlag); + COPY_FLAG(quiet, Py_QuietFlag); +#ifdef MS_WINDOWS + COPY_FLAG(legacy_windows_stdio, Py_LegacyWindowsStdioFlag); +#endif + COPY_NOT_FLAG(pathconfig_warnings, Py_FrozenFlag); + + COPY_NOT_FLAG(buffered_stdio, Py_UnbufferedStdioFlag); + COPY_NOT_FLAG(site_import, Py_NoSiteFlag); + COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); + COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); + + /* Random or non-zero hash seed */ + Py_HashRandomizationFlag = (config->use_hash_seed == 0 || + config->hash_seed != 0); + +#undef COPY_FLAG +#undef COPY_NOT_FLAG +} + + +/* Get the program name: use PYTHONEXECUTABLE and __PYVENV_LAUNCHER__ + environment variables on macOS if available. */ +static PyStatus +config_init_program_name(PyConfig *config) +{ + PyStatus status; + + /* If Py_SetProgramName() was called, use its value */ + const wchar_t *program_name = _Py_path_config.program_name; + if (program_name != NULL) { + config->program_name = _PyMem_RawWcsdup(program_name); + if (config->program_name == NULL) { + return _PyStatus_NO_MEMORY(); + } + return _PyStatus_OK(); + } + +#ifdef __APPLE__ + /* On MacOS X, when the Python interpreter is embedded in an + application bundle, it gets executed by a bootstrapping script + that does os.execve() with an argv[0] that's different from the + actual Python executable. This is needed to keep the Finder happy, + or rather, to work around Apple's overly strict requirements of + the process name. However, we still need a usable sys.executable, + so the actual executable path is passed in an environment variable. + See Lib/plat-mac/bundlebuilder.py for details about the bootstrap + script. */ + const char *p = config_get_env(config, "PYTHONEXECUTABLE"); + if (p != NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->program_name, p, + "PYTHONEXECUTABLE environment variable"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); + } +#ifdef WITH_NEXT_FRAMEWORK + else { + const char* pyvenv_launcher = getenv("__PYVENV_LAUNCHER__"); + if (pyvenv_launcher && *pyvenv_launcher) { + /* Used by Mac/Tools/pythonw.c to forward + * the argv0 of the stub executable + */ + status = CONFIG_SET_BYTES_STR(config, + &config->program_name, + pyvenv_launcher, + "__PYVENV_LAUNCHER__ environment variable"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* + * This environment variable is used to communicate between + * the stub launcher and the real interpreter and isn't needed + * beyond this point. + * + * Clean up to avoid problems when launching other programs + * later on. + */ + (void)unsetenv("__PYVENV_LAUNCHER__"); + + return _PyStatus_OK(); + } + } +#endif /* WITH_NEXT_FRAMEWORK */ +#endif /* __APPLE__ */ + + /* Use argv[0] if available and non-empty */ + const PyWideStringList *argv = &config->argv; + if (argv->length >= 1 && argv->items[0][0] != L'\0') { + config->program_name = _PyMem_RawWcsdup(argv->items[0]); + if (config->program_name == NULL) { + return _PyStatus_NO_MEMORY(); + } + return _PyStatus_OK(); + } + + /* Last fall back: hardcoded name */ +#ifdef MS_WINDOWS + const wchar_t *default_program_name = L"python"; +#else + const wchar_t *default_program_name = L"python3"; +#endif + status = PyConfig_SetString(config, &config->program_name, + default_program_name); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); +} + +static PyStatus +config_init_executable(PyConfig *config) +{ + assert(config->executable == NULL); + + /* If Py_SetProgramFullPath() was called, use its value */ + const wchar_t *program_full_path = _Py_path_config.program_full_path; + if (program_full_path != NULL) { + PyStatus status = PyConfig_SetString(config, + &config->executable, + program_full_path); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); + } + return _PyStatus_OK(); +} + + +static const wchar_t* +config_get_xoption(const PyConfig *config, wchar_t *name) +{ + return _Py_get_xoption(&config->xoptions, name); +} + + +static PyStatus +config_init_home(PyConfig *config) +{ + assert(config->home == NULL); + + /* If Py_SetPythonHome() was called, use its value */ + wchar_t *home = _Py_path_config.home; + if (home) { + PyStatus status = PyConfig_SetString(config, &config->home, home); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); + } + + return CONFIG_GET_ENV_DUP(config, &config->home, + L"PYTHONHOME", "PYTHONHOME"); +} + + +static PyStatus +config_init_hash_seed(PyConfig *config) +{ + const char *seed_text = config_get_env(config, "PYTHONHASHSEED"); + + Py_BUILD_ASSERT(sizeof(_Py_HashSecret_t) == sizeof(_Py_HashSecret.uc)); + /* Convert a text seed to a numeric one */ + if (seed_text && strcmp(seed_text, "random") != 0) { + const char *endptr = seed_text; + unsigned long seed; + errno = 0; + seed = strtoul(seed_text, (char **)&endptr, 10); + if (*endptr != '\0' + || seed > 4294967295UL + || (errno == ERANGE && seed == ULONG_MAX)) + { + return _PyStatus_ERR("PYTHONHASHSEED must be \"random\" " + "or an integer in range [0; 4294967295]"); + } + /* Use a specific hash */ + config->use_hash_seed = 1; + config->hash_seed = seed; + } + else { + /* Use a random hash */ + config->use_hash_seed = 0; + config->hash_seed = 0; + } + return _PyStatus_OK(); +} + + +static int +config_wstr_to_int(const wchar_t *wstr, int *result) +{ + const wchar_t *endptr = wstr; + errno = 0; + long value = wcstol(wstr, (wchar_t **)&endptr, 10); + if (*endptr != '\0' || errno == ERANGE) { + return -1; + } + if (value < INT_MIN || value > INT_MAX) { + return -1; + } + + *result = (int)value; + return 0; +} + + +static PyStatus +config_read_env_vars(PyConfig *config) +{ + PyStatus status; + int use_env = config->use_environment; + + /* Get environment variables */ + _Py_get_env_flag(use_env, &config->parser_debug, "PYTHONDEBUG"); + _Py_get_env_flag(use_env, &config->verbose, "PYTHONVERBOSE"); + _Py_get_env_flag(use_env, &config->optimization_level, "PYTHONOPTIMIZE"); + _Py_get_env_flag(use_env, &config->inspect, "PYTHONINSPECT"); + + int dont_write_bytecode = 0; + _Py_get_env_flag(use_env, &dont_write_bytecode, "PYTHONDONTWRITEBYTECODE"); + if (dont_write_bytecode) { + config->write_bytecode = 0; + } + + int no_user_site_directory = 0; + _Py_get_env_flag(use_env, &no_user_site_directory, "PYTHONNOUSERSITE"); + if (no_user_site_directory) { + config->user_site_directory = 0; + } + + int unbuffered_stdio = 0; + _Py_get_env_flag(use_env, &unbuffered_stdio, "PYTHONUNBUFFERED"); + if (unbuffered_stdio) { + config->buffered_stdio = 0; + } + +#ifdef MS_WINDOWS + _Py_get_env_flag(use_env, &config->legacy_windows_stdio, + "PYTHONLEGACYWINDOWSSTDIO"); +#endif + + if (config_get_env(config, "PYTHONDUMPREFS")) { + config->dump_refs = 1; + } + if (config_get_env(config, "PYTHONMALLOCSTATS")) { + config->malloc_stats = 1; + } + + if (config->pythonpath_env == NULL) { + status = CONFIG_GET_ENV_DUP(config, &config->pythonpath_env, + L"PYTHONPATH", "PYTHONPATH"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if(config->platlibdir == NULL) { + status = CONFIG_GET_ENV_DUP(config, &config->platlibdir, + L"PYTHONPLATLIBDIR", "PYTHONPLATLIBDIR"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->use_hash_seed < 0) { + status = config_init_hash_seed(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + return _PyStatus_OK(); +} + + +static PyStatus +config_init_tracemalloc(PyConfig *config) +{ + int nframe; + int valid; + + const char *env = config_get_env(config, "PYTHONTRACEMALLOC"); + if (env) { + if (!_Py_str_to_int(env, &nframe)) { + valid = (nframe >= 0); + } + else { + valid = 0; + } + if (!valid) { + return _PyStatus_ERR("PYTHONTRACEMALLOC: invalid number of frames"); + } + config->tracemalloc = nframe; + } + + const wchar_t *xoption = config_get_xoption(config, L"tracemalloc"); + if (xoption) { + const wchar_t *sep = wcschr(xoption, L'='); + if (sep) { + if (!config_wstr_to_int(sep + 1, &nframe)) { + valid = (nframe >= 0); + } + else { + valid = 0; + } + if (!valid) { + return _PyStatus_ERR("-X tracemalloc=NFRAME: " + "invalid number of frames"); + } + } + else { + /* -X tracemalloc behaves as -X tracemalloc=1 */ + nframe = 1; + } + config->tracemalloc = nframe; + } + return _PyStatus_OK(); +} + + +static PyStatus +config_init_pycache_prefix(PyConfig *config) +{ + assert(config->pycache_prefix == NULL); + + const wchar_t *xoption = config_get_xoption(config, L"pycache_prefix"); + if (xoption) { + const wchar_t *sep = wcschr(xoption, L'='); + if (sep && wcslen(sep) > 1) { + config->pycache_prefix = _PyMem_RawWcsdup(sep + 1); + if (config->pycache_prefix == NULL) { + return _PyStatus_NO_MEMORY(); + } + } + else { + // PYTHONPYCACHEPREFIX env var ignored + // if "-X pycache_prefix=" option is used + config->pycache_prefix = NULL; + } + return _PyStatus_OK(); + } + + return CONFIG_GET_ENV_DUP(config, &config->pycache_prefix, + L"PYTHONPYCACHEPREFIX", + "PYTHONPYCACHEPREFIX"); +} + + +static PyStatus +config_read_complex_options(PyConfig *config) +{ + /* More complex options configured by env var and -X option */ + if (config->faulthandler < 0) { + if (config_get_env(config, "PYTHONFAULTHANDLER") + || config_get_xoption(config, L"faulthandler")) { + config->faulthandler = 1; + } + } + if (config_get_env(config, "PYTHONPROFILEIMPORTTIME") + || config_get_xoption(config, L"importtime")) { + config->import_time = 1; + } + + if (config_get_env(config, "PYTHONOLDPARSER") + || config_get_xoption(config, L"oldparser")) { + config->_use_peg_parser = 0; + } + + PyStatus status; + if (config->tracemalloc < 0) { + status = config_init_tracemalloc(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->pycache_prefix == NULL) { + status = config_init_pycache_prefix(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + return _PyStatus_OK(); +} + + +static const wchar_t * +config_get_stdio_errors(void) +{ +#ifndef MS_WINDOWS + const char *loc = setlocale(LC_CTYPE, NULL); + if (loc != NULL) { + /* surrogateescape is the default in the legacy C and POSIX locales */ + if (strcmp(loc, "C") == 0 || strcmp(loc, "POSIX") == 0) { + return L"surrogateescape"; + } + +#ifdef PY_COERCE_C_LOCALE + /* surrogateescape is the default in locale coercion target locales */ + if (_Py_IsLocaleCoercionTarget(loc)) { + return L"surrogateescape"; + } +#endif + } + + return L"strict"; +#else + /* On Windows, always use surrogateescape by default */ + return L"surrogateescape"; +#endif +} + + +static PyStatus +config_get_locale_encoding(PyConfig *config, wchar_t **locale_encoding) +{ +#ifdef MS_WINDOWS + char encoding[20]; + PyOS_snprintf(encoding, sizeof(encoding), "cp%u", GetACP()); + return PyConfig_SetBytesString(config, locale_encoding, encoding); +#elif defined(_Py_FORCE_UTF8_LOCALE) + return PyConfig_SetString(config, locale_encoding, L"utf-8"); +#else + const char *encoding = nl_langinfo(CODESET); + if (!encoding || encoding[0] == '\0') { + return _PyStatus_ERR("failed to get the locale encoding: " + "nl_langinfo(CODESET) failed"); + } + /* nl_langinfo(CODESET) is decoded by Py_DecodeLocale() */ + return CONFIG_SET_BYTES_STR(config, + locale_encoding, encoding, + "nl_langinfo(CODESET)"); +#endif +} + + +static PyStatus +config_init_stdio_encoding(PyConfig *config, + const PyPreConfig *preconfig) +{ + PyStatus status; + + /* If Py_SetStandardStreamEncoding() have been called, use these + parameters. */ + if (config->stdio_encoding == NULL && _Py_StandardStreamEncoding != NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, + _Py_StandardStreamEncoding, + "_Py_StandardStreamEncoding"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->stdio_errors == NULL && _Py_StandardStreamErrors != NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, + _Py_StandardStreamErrors, + "_Py_StandardStreamErrors"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->stdio_encoding != NULL && config->stdio_errors != NULL) { + return _PyStatus_OK(); + } + + /* PYTHONIOENCODING environment variable */ + const char *opt = config_get_env(config, "PYTHONIOENCODING"); + if (opt) { + char *pythonioencoding = _PyMem_RawStrdup(opt); + if (pythonioencoding == NULL) { + return _PyStatus_NO_MEMORY(); + } + + char *errors = strchr(pythonioencoding, ':'); + if (errors) { + *errors = '\0'; + errors++; + if (!errors[0]) { + errors = NULL; + } + } + + /* Does PYTHONIOENCODING contain an encoding? */ + if (pythonioencoding[0]) { + if (config->stdio_encoding == NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, + pythonioencoding, + "PYTHONIOENCODING environment variable"); + if (_PyStatus_EXCEPTION(status)) { + PyMem_RawFree(pythonioencoding); + return status; + } + } + + /* If the encoding is set but not the error handler, + use "strict" error handler by default. + PYTHONIOENCODING=latin1 behaves as + PYTHONIOENCODING=latin1:strict. */ + if (!errors) { + errors = "strict"; + } + } + + if (config->stdio_errors == NULL && errors != NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, + errors, + "PYTHONIOENCODING environment variable"); + if (_PyStatus_EXCEPTION(status)) { + PyMem_RawFree(pythonioencoding); + return status; + } + } + + PyMem_RawFree(pythonioencoding); + } + + /* UTF-8 Mode uses UTF-8/surrogateescape */ + if (preconfig->utf8_mode) { + if (config->stdio_encoding == NULL) { + status = PyConfig_SetString(config, &config->stdio_encoding, + L"utf-8"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + if (config->stdio_errors == NULL) { + status = PyConfig_SetString(config, &config->stdio_errors, + L"surrogateescape"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + } + + /* Choose the default error handler based on the current locale. */ + if (config->stdio_encoding == NULL) { + status = config_get_locale_encoding(config, &config->stdio_encoding); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + if (config->stdio_errors == NULL) { + const wchar_t *errors = config_get_stdio_errors(); + assert(errors != NULL); + + status = PyConfig_SetString(config, &config->stdio_errors, errors); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + return _PyStatus_OK(); +} + + +static PyStatus +config_init_fs_encoding(PyConfig *config, const PyPreConfig *preconfig) +{ + PyStatus status; + + if (config->filesystem_encoding == NULL) { +#ifdef _Py_FORCE_UTF8_FS_ENCODING + status = PyConfig_SetString(config, &config->filesystem_encoding, L"utf-8"); +#else + +#ifdef MS_WINDOWS + if (preconfig->legacy_windows_fs_encoding) { + /* Legacy Windows filesystem encoding: mbcs/replace */ + status = PyConfig_SetString(config, &config->filesystem_encoding, + L"mbcs"); + } + else +#endif + if (preconfig->utf8_mode) { + status = PyConfig_SetString(config, &config->filesystem_encoding, + L"utf-8"); + } +#ifndef MS_WINDOWS + else if (_Py_GetForceASCII()) { + status = PyConfig_SetString(config, &config->filesystem_encoding, + L"ascii"); + } +#endif + else { +#ifdef MS_WINDOWS + /* Windows defaults to utf-8/surrogatepass (PEP 529). */ + status = PyConfig_SetString(config, &config->filesystem_encoding, + L"utf-8"); +#else + status = config_get_locale_encoding(config, + &config->filesystem_encoding); +#endif + } +#endif /* !_Py_FORCE_UTF8_FS_ENCODING */ + + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->filesystem_errors == NULL) { + const wchar_t *errors; +#ifdef MS_WINDOWS + if (preconfig->legacy_windows_fs_encoding) { + errors = L"replace"; + } + else { + errors = L"surrogatepass"; + } +#else + errors = L"surrogateescape"; +#endif + status = PyConfig_SetString(config, &config->filesystem_errors, errors); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + return _PyStatus_OK(); +} + + +static PyStatus +config_read(PyConfig *config) +{ + PyStatus status; + const PyPreConfig *preconfig = &_PyRuntime.preconfig; + + if (config->use_environment) { + status = config_read_env_vars(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + /* -X options */ + if (config_get_xoption(config, L"showrefcount")) { + config->show_ref_count = 1; + } + + status = config_read_complex_options(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (config->home == NULL) { + status = config_init_home(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->executable == NULL) { + status = config_init_executable(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if(config->platlibdir == NULL) { + status = CONFIG_SET_BYTES_STR(config, &config->platlibdir, PLATLIBDIR, + "PLATLIBDIR macro"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->_install_importlib) { + status = _PyConfig_InitPathConfig(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + /* default values */ + if (config->dev_mode) { + if (config->faulthandler < 0) { + config->faulthandler = 1; + } + } + if (config->faulthandler < 0) { + config->faulthandler = 0; + } + if (config->tracemalloc < 0) { + config->tracemalloc = 0; + } + if (config->use_hash_seed < 0) { + config->use_hash_seed = 0; + config->hash_seed = 0; + } + + if (config->filesystem_encoding == NULL || config->filesystem_errors == NULL) { + status = config_init_fs_encoding(config, preconfig); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + status = config_init_stdio_encoding(config, preconfig); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (config->argv.length < 1) { + /* Ensure at least one (empty) argument is seen */ + status = PyWideStringList_Append(&config->argv, L""); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->check_hash_pycs_mode == NULL) { + status = PyConfig_SetString(config, &config->check_hash_pycs_mode, + L"default"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->configure_c_stdio < 0) { + config->configure_c_stdio = 1; + } + + return _PyStatus_OK(); +} + + +static void +config_init_stdio(const PyConfig *config) +{ +#if defined(MS_WINDOWS) || defined(__CYGWIN__) + /* don't translate newlines (\r\n <=> \n) */ + _setmode(fileno(stdin), O_BINARY); + _setmode(fileno(stdout), O_BINARY); + _setmode(fileno(stderr), O_BINARY); +#endif + + if (!config->buffered_stdio) { +#ifdef HAVE_SETVBUF + setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); + setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); + setvbuf(stderr, (char *)NULL, _IONBF, BUFSIZ); +#else /* !HAVE_SETVBUF */ + setbuf(stdin, (char *)NULL); + setbuf(stdout, (char *)NULL); + setbuf(stderr, (char *)NULL); +#endif /* !HAVE_SETVBUF */ + } + else if (config->interactive) { +#ifdef MS_WINDOWS + /* Doesn't have to have line-buffered -- use unbuffered */ + /* Any set[v]buf(stdin, ...) screws up Tkinter :-( */ + setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); +#else /* !MS_WINDOWS */ +#ifdef HAVE_SETVBUF + setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); + setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); +#endif /* HAVE_SETVBUF */ +#endif /* !MS_WINDOWS */ + /* Leave stderr alone - it should be unbuffered anyway. */ + } +} + + +/* Write the configuration: + + - set Py_xxx global configuration variables + - initialize C standard streams (stdin, stdout, stderr) */ +PyStatus +_PyConfig_Write(const PyConfig *config, _PyRuntimeState *runtime) +{ + config_set_global_vars(config); + + if (config->configure_c_stdio) { + config_init_stdio(config); + } + + /* Write the new pre-configuration into _PyRuntime */ + PyPreConfig *preconfig = &runtime->preconfig; + preconfig->isolated = config->isolated; + preconfig->use_environment = config->use_environment; + preconfig->dev_mode = config->dev_mode; + + if (_Py_SetArgcArgv(config->_orig_argv.length, + config->_orig_argv.items) < 0) + { + return _PyStatus_NO_MEMORY(); + } + return _PyStatus_OK(); +} + + +/* --- PyConfig command line parser -------------------------- */ + +static void +config_usage(int error, const wchar_t* program) +{ + FILE *f = error ? stderr : stdout; + + fprintf(f, usage_line, program); + if (error) + fprintf(f, "Try `python -h' for more information.\n"); + else { + fputs(usage_1, f); + fputs(usage_2, f); + fputs(usage_3, f); + fprintf(f, usage_4, (wint_t)DELIM); + fprintf(f, usage_5, (wint_t)DELIM, PYTHONHOMEHELP); + fputs(usage_6, f); + } +} + + +/* Parse the command line arguments */ +static PyStatus +config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions, + Py_ssize_t *opt_index) +{ + PyStatus status; + const PyWideStringList *argv = &config->argv; + int print_version = 0; + const wchar_t* program = config->program_name; + + _PyOS_ResetGetOpt(); + do { + int longindex = -1; + int c = _PyOS_GetOpt(argv->length, argv->items, &longindex); + if (c == EOF) { + break; + } + + if (c == 'c') { + if (config->run_command == NULL) { + /* -c is the last option; following arguments + that look like options are left for the + command to interpret. */ + size_t len = wcslen(_PyOS_optarg) + 1 + 1; + wchar_t *command = PyMem_RawMalloc(sizeof(wchar_t) * len); + if (command == NULL) { + return _PyStatus_NO_MEMORY(); + } + memcpy(command, _PyOS_optarg, (len - 2) * sizeof(wchar_t)); + command[len - 2] = '\n'; + command[len - 1] = 0; + config->run_command = command; + } + break; + } + + if (c == 'm') { + /* -m is the last option; following arguments + that look like options are left for the + module to interpret. */ + if (config->run_module == NULL) { + config->run_module = _PyMem_RawWcsdup(_PyOS_optarg); + if (config->run_module == NULL) { + return _PyStatus_NO_MEMORY(); + } + } + break; + } + + switch (c) { + case 0: + // Handle long option. + assert(longindex == 0); // Only one long option now. + if (wcscmp(_PyOS_optarg, L"always") == 0 + || wcscmp(_PyOS_optarg, L"never") == 0 + || wcscmp(_PyOS_optarg, L"default") == 0) + { + status = PyConfig_SetString(config, &config->check_hash_pycs_mode, + _PyOS_optarg); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } else { + fprintf(stderr, "--check-hash-based-pycs must be one of " + "'default', 'always', or 'never'\n"); + config_usage(1, program); + return _PyStatus_EXIT(2); + } + break; + + case 'b': + config->bytes_warning++; + break; + + case 'd': + config->parser_debug++; + break; + + case 'i': + config->inspect++; + config->interactive++; + break; + + case 'E': + case 'I': + case 'X': + /* option handled by _PyPreCmdline_Read() */ + break; + + /* case 'J': reserved for Jython */ + + case 'O': + config->optimization_level++; + break; + + case 'B': + config->write_bytecode = 0; + break; + + case 's': + config->user_site_directory = 0; + break; + + case 'S': + config->site_import = 0; + break; + + case 't': + /* ignored for backwards compatibility */ + break; + + case 'u': + config->buffered_stdio = 0; + break; + + case 'v': + config->verbose++; + break; + + case 'x': + config->skip_source_first_line = 1; + break; + + case 'h': + case '?': + config_usage(0, program); + return _PyStatus_EXIT(0); + + case 'V': + print_version++; + break; + + case 'W': + status = PyWideStringList_Append(warnoptions, _PyOS_optarg); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + break; + + case 'q': + config->quiet++; + break; + + case 'R': + config->use_hash_seed = 0; + break; + + /* This space reserved for other options */ + + default: + /* unknown argument: parsing failed */ + config_usage(1, program); + return _PyStatus_EXIT(2); + } + } while (1); + + if (print_version) { + printf("Python %s\n", + (print_version >= 2) ? Py_GetVersion() : PY_VERSION); + return _PyStatus_EXIT(0); + } + + if (config->run_command == NULL && config->run_module == NULL + && _PyOS_optind < argv->length + && wcscmp(argv->items[_PyOS_optind], L"-") != 0 + && config->run_filename == NULL) + { + config->run_filename = _PyMem_RawWcsdup(argv->items[_PyOS_optind]); + if (config->run_filename == NULL) { + return _PyStatus_NO_MEMORY(); + } + } + + if (config->run_command != NULL || config->run_module != NULL) { + /* Backup _PyOS_optind */ + _PyOS_optind--; + } + + *opt_index = _PyOS_optind; + + return _PyStatus_OK(); +} + + +#ifdef MS_WINDOWS +# define WCSTOK wcstok_s +#else +# define WCSTOK wcstok +#endif + +/* Get warning options from PYTHONWARNINGS environment variable. */ +static PyStatus +config_init_env_warnoptions(PyConfig *config, PyWideStringList *warnoptions) +{ + PyStatus status; + /* CONFIG_GET_ENV_DUP requires dest to be initialized to NULL */ + wchar_t *env = NULL; + status = CONFIG_GET_ENV_DUP(config, &env, + L"PYTHONWARNINGS", "PYTHONWARNINGS"); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* env var is not set or is empty */ + if (env == NULL) { + return _PyStatus_OK(); + } + + + wchar_t *warning, *context = NULL; + for (warning = WCSTOK(env, L",", &context); + warning != NULL; + warning = WCSTOK(NULL, L",", &context)) + { + status = PyWideStringList_Append(warnoptions, warning); + if (_PyStatus_EXCEPTION(status)) { + PyMem_RawFree(env); + return status; + } + } + PyMem_RawFree(env); + return _PyStatus_OK(); +} + + +static PyStatus +warnoptions_append(PyConfig *config, PyWideStringList *options, + const wchar_t *option) +{ + /* config_init_warnoptions() add existing config warnoptions at the end: + ensure that the new option is not already present in this list to + prevent change the options order when config_init_warnoptions() is + called twice. */ + if (_PyWideStringList_Find(&config->warnoptions, option)) { + /* Already present: do nothing */ + return _PyStatus_OK(); + } + if (_PyWideStringList_Find(options, option)) { + /* Already present: do nothing */ + return _PyStatus_OK(); + } + return PyWideStringList_Append(options, option); +} + + +static PyStatus +warnoptions_extend(PyConfig *config, PyWideStringList *options, + const PyWideStringList *options2) +{ + const Py_ssize_t len = options2->length; + wchar_t *const *items = options2->items; + + for (Py_ssize_t i = 0; i < len; i++) { + PyStatus status = warnoptions_append(config, options, items[i]); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + return _PyStatus_OK(); +} + + +static PyStatus +config_init_warnoptions(PyConfig *config, + const PyWideStringList *cmdline_warnoptions, + const PyWideStringList *env_warnoptions, + const PyWideStringList *sys_warnoptions) +{ + PyStatus status; + PyWideStringList options = _PyWideStringList_INIT; + + /* Priority of warnings options, lowest to highest: + * + * - any implicit filters added by _warnings.c/warnings.py + * - PyConfig.dev_mode: "default" filter + * - PYTHONWARNINGS environment variable + * - '-W' command line options + * - PyConfig.bytes_warning ('-b' and '-bb' command line options): + * "default::BytesWarning" or "error::BytesWarning" filter + * - early PySys_AddWarnOption() calls + * - PyConfig.warnoptions + * + * PyConfig.warnoptions is copied to sys.warnoptions. Since the warnings + * module works on the basis of "the most recently added filter will be + * checked first", we add the lowest precedence entries first so that later + * entries override them. + */ + + if (config->dev_mode) { + status = warnoptions_append(config, &options, L"default"); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + } + + status = warnoptions_extend(config, &options, env_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + + status = warnoptions_extend(config, &options, cmdline_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + + /* If the bytes_warning_flag isn't set, bytesobject.c and bytearrayobject.c + * don't even try to emit a warning, so we skip setting the filter in that + * case. + */ + if (config->bytes_warning) { + const wchar_t *filter; + if (config->bytes_warning> 1) { + filter = L"error::BytesWarning"; + } + else { + filter = L"default::BytesWarning"; + } + status = warnoptions_append(config, &options, filter); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + } + + status = warnoptions_extend(config, &options, sys_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + + /* Always add all PyConfig.warnoptions options */ + status = _PyWideStringList_Extend(&options, &config->warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto error; + } + + _PyWideStringList_Clear(&config->warnoptions); + config->warnoptions = options; + return _PyStatus_OK(); + +error: + _PyWideStringList_Clear(&options); + return status; +} + + +static PyStatus +config_update_argv(PyConfig *config, Py_ssize_t opt_index) +{ + const PyWideStringList *cmdline_argv = &config->argv; + PyWideStringList config_argv = _PyWideStringList_INIT; + + /* Copy argv to be able to modify it (to force -c/-m) */ + if (cmdline_argv->length <= opt_index) { + /* Ensure at least one (empty) argument is seen */ + PyStatus status = PyWideStringList_Append(&config_argv, L""); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + else { + PyWideStringList slice; + slice.length = cmdline_argv->length - opt_index; + slice.items = &cmdline_argv->items[opt_index]; + if (_PyWideStringList_Copy(&config_argv, &slice) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + assert(config_argv.length >= 1); + + wchar_t *arg0 = NULL; + if (config->run_command != NULL) { + /* Force sys.argv[0] = '-c' */ + arg0 = L"-c"; + } + else if (config->run_module != NULL) { + /* Force sys.argv[0] = '-m'*/ + arg0 = L"-m"; + } + + if (arg0 != NULL) { + arg0 = _PyMem_RawWcsdup(arg0); + if (arg0 == NULL) { + _PyWideStringList_Clear(&config_argv); + return _PyStatus_NO_MEMORY(); + } + + PyMem_RawFree(config_argv.items[0]); + config_argv.items[0] = arg0; + } + + _PyWideStringList_Clear(&config->argv); + config->argv = config_argv; + return _PyStatus_OK(); +} + + +static PyStatus +core_read_precmdline(PyConfig *config, _PyPreCmdline *precmdline) +{ + PyStatus status; + + if (config->parse_argv) { + if (_PyWideStringList_Copy(&precmdline->argv, &config->argv) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + + PyPreConfig preconfig; + + status = _PyPreConfig_InitFromPreConfig(&preconfig, &_PyRuntime.preconfig); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + _PyPreConfig_GetConfig(&preconfig, config); + + status = _PyPreCmdline_Read(precmdline, &preconfig); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = _PyPreCmdline_SetConfig(precmdline, config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); +} + + +/* Get run_filename absolute path */ +static PyStatus +config_run_filename_abspath(PyConfig *config) +{ + if (!config->run_filename) { + return _PyStatus_OK(); + } + +#ifndef MS_WINDOWS + if (_Py_isabs(config->run_filename)) { + /* path is already absolute */ + return _PyStatus_OK(); + } +#endif + + wchar_t *abs_filename; + if (_Py_abspath(config->run_filename, &abs_filename) < 0) { + /* failed to get the absolute path of the command line filename: + ignore the error, keep the relative path */ + return _PyStatus_OK(); + } + if (abs_filename == NULL) { + return _PyStatus_NO_MEMORY(); + } + + PyMem_RawFree(config->run_filename); + config->run_filename = abs_filename; + return _PyStatus_OK(); +} + + +static PyStatus +config_read_cmdline(PyConfig *config) +{ + PyStatus status; + PyWideStringList cmdline_warnoptions = _PyWideStringList_INIT; + PyWideStringList env_warnoptions = _PyWideStringList_INIT; + PyWideStringList sys_warnoptions = _PyWideStringList_INIT; + + if (config->parse_argv < 0) { + config->parse_argv = 1; + } + + if (config->program_name == NULL) { + status = config_init_program_name(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->parse_argv) { + Py_ssize_t opt_index; + status = config_parse_cmdline(config, &cmdline_warnoptions, &opt_index); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = config_run_filename_abspath(config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = config_update_argv(config, opt_index); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + } + else { + status = config_run_filename_abspath(config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + } + + if (config->use_environment) { + status = config_init_env_warnoptions(config, &env_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + } + + /* Handle early PySys_AddWarnOption() calls */ + status = _PySys_ReadPreinitWarnOptions(&sys_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = config_init_warnoptions(config, + &cmdline_warnoptions, + &env_warnoptions, + &sys_warnoptions); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = _PyStatus_OK(); + +done: + _PyWideStringList_Clear(&cmdline_warnoptions); + _PyWideStringList_Clear(&env_warnoptions); + _PyWideStringList_Clear(&sys_warnoptions); + return status; +} + + +PyStatus +_PyConfig_SetPyArgv(PyConfig *config, const _PyArgv *args) +{ + PyStatus status = _Py_PreInitializeFromConfig(config, args); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + return _PyArgv_AsWstrList(args, &config->argv); +} + + +/* Set config.argv: decode argv using Py_DecodeLocale(). Pre-initialize Python + if needed to ensure that encodings are properly configured. */ +PyStatus +PyConfig_SetBytesArgv(PyConfig *config, Py_ssize_t argc, char * const *argv) +{ + _PyArgv args = { + .argc = argc, + .use_bytes_argv = 1, + .bytes_argv = argv, + .wchar_argv = NULL}; + return _PyConfig_SetPyArgv(config, &args); +} + + +PyStatus +PyConfig_SetArgv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv) +{ + _PyArgv args = { + .argc = argc, + .use_bytes_argv = 0, + .bytes_argv = NULL, + .wchar_argv = argv}; + return _PyConfig_SetPyArgv(config, &args); +} + + +PyStatus +PyConfig_SetWideStringList(PyConfig *config, PyWideStringList *list, + Py_ssize_t length, wchar_t **items) +{ + PyStatus status = _Py_PreInitializeFromConfig(config, NULL); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + PyWideStringList list2 = {.length = length, .items = items}; + if (_PyWideStringList_Copy(list, &list2) < 0) { + return _PyStatus_NO_MEMORY(); + } + return _PyStatus_OK(); +} + + +/* Read the configuration into PyConfig from: + + * Command line arguments + * Environment variables + * Py_xxx global configuration variables + + The only side effects are to modify config and to call _Py_SetArgcArgv(). */ +PyStatus +PyConfig_Read(PyConfig *config) +{ + PyStatus status; + + status = _Py_PreInitializeFromConfig(config, NULL); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + config_get_global_vars(config); + + if (config->_orig_argv.length == 0 + && !(config->argv.length == 1 + && wcscmp(config->argv.items[0], L"") == 0)) + { + if (_PyWideStringList_Copy(&config->_orig_argv, &config->argv) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + + _PyPreCmdline precmdline = _PyPreCmdline_INIT; + status = core_read_precmdline(config, &precmdline); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + assert(config->isolated >= 0); + if (config->isolated) { + config->use_environment = 0; + config->user_site_directory = 0; + } + + status = config_read_cmdline(config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + /* Handle early PySys_AddXOption() calls */ + status = _PySys_ReadPreinitXOptions(config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = config_read(config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + /* Check config consistency */ + assert(config->isolated >= 0); + assert(config->use_environment >= 0); + assert(config->dev_mode >= 0); + assert(config->_use_peg_parser >= 0); + assert(config->install_signal_handlers >= 0); + assert(config->use_hash_seed >= 0); + assert(config->faulthandler >= 0); + assert(config->tracemalloc >= 0); + assert(config->site_import >= 0); + assert(config->bytes_warning >= 0); + assert(config->inspect >= 0); + assert(config->interactive >= 0); + assert(config->optimization_level >= 0); + assert(config->parser_debug >= 0); + assert(config->write_bytecode >= 0); + assert(config->verbose >= 0); + assert(config->quiet >= 0); + assert(config->user_site_directory >= 0); + assert(config->parse_argv >= 0); + assert(config->configure_c_stdio >= 0); + assert(config->buffered_stdio >= 0); + assert(config->program_name != NULL); + assert(_PyWideStringList_CheckConsistency(&config->argv)); + /* sys.argv must be non-empty: empty argv is replaced with [''] */ + assert(config->argv.length >= 1); + assert(_PyWideStringList_CheckConsistency(&config->xoptions)); + assert(_PyWideStringList_CheckConsistency(&config->warnoptions)); + assert(_PyWideStringList_CheckConsistency(&config->module_search_paths)); + if (config->_install_importlib) { + assert(config->module_search_paths_set != 0); + /* don't check config->module_search_paths */ + assert(config->executable != NULL); + assert(config->base_executable != NULL); + assert(config->prefix != NULL); + assert(config->base_prefix != NULL); + assert(config->exec_prefix != NULL); + assert(config->base_exec_prefix != NULL); + } + assert(config->platlibdir != NULL); + assert(config->filesystem_encoding != NULL); + assert(config->filesystem_errors != NULL); + assert(config->stdio_encoding != NULL); + assert(config->stdio_errors != NULL); +#ifdef MS_WINDOWS + assert(config->legacy_windows_stdio >= 0); +#endif + /* -c and -m options are exclusive */ + assert(!(config->run_command != NULL && config->run_module != NULL)); + assert(config->check_hash_pycs_mode != NULL); + assert(config->_install_importlib >= 0); + assert(config->pathconfig_warnings >= 0); + assert(_PyWideStringList_CheckConsistency(&config->_orig_argv)); + + status = _PyStatus_OK(); + +done: + _PyPreCmdline_Clear(&precmdline); + return status; +} + + +PyObject* +_Py_GetConfigsAsDict(void) +{ + PyObject *result = NULL; + PyObject *dict = NULL; + + result = PyDict_New(); + if (result == NULL) { + goto error; + } + + /* global result */ + dict = _Py_GetGlobalVariablesAsDict(); + if (dict == NULL) { + goto error; + } + if (PyDict_SetItemString(result, "global_config", dict) < 0) { + goto error; + } + Py_CLEAR(dict); + + /* pre config */ + PyThreadState *tstate = _PyThreadState_GET(); + const PyPreConfig *pre_config = &tstate->interp->runtime->preconfig; + dict = _PyPreConfig_AsDict(pre_config); + if (dict == NULL) { + goto error; + } + if (PyDict_SetItemString(result, "pre_config", dict) < 0) { + goto error; + } + Py_CLEAR(dict); + + /* core config */ + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + dict = config_as_dict(config); + if (dict == NULL) { + goto error; + } + if (PyDict_SetItemString(result, "config", dict) < 0) { + goto error; + } + Py_CLEAR(dict); + + return result; + +error: + Py_XDECREF(result); + Py_XDECREF(dict); + return NULL; +} + + +static void +init_dump_ascii_wstr(const wchar_t *str) +{ + if (str == NULL) { + PySys_WriteStderr("(not set)"); + return; + } + + PySys_WriteStderr("'"); + for (; *str != L'\0'; str++) { + unsigned int ch = (unsigned int)*str; + if (ch == L'\'') { + PySys_WriteStderr("\\'"); + } else if (0x20 <= ch && ch < 0x7f) { + PySys_WriteStderr("%c", ch); + } + else if (ch <= 0xff) { + PySys_WriteStderr("\\x%02x", ch); + } +#if SIZEOF_WCHAR_T > 2 + else if (ch > 0xffff) { + PySys_WriteStderr("\\U%08x", ch); + } +#endif + else { + PySys_WriteStderr("\\u%04x", ch); + } + } + PySys_WriteStderr("'"); +} + + +/* Dump the Python path configuration into sys.stderr */ +void +_Py_DumpPathConfig(PyThreadState *tstate) +{ + PyObject *exc_type, *exc_value, *exc_tb; + _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); + + PySys_WriteStderr("Python path configuration:\n"); + +#define DUMP_CONFIG(NAME, FIELD) \ + do { \ + PySys_WriteStderr(" " NAME " = "); \ + init_dump_ascii_wstr(config->FIELD); \ + PySys_WriteStderr("\n"); \ + } while (0) + + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + DUMP_CONFIG("PYTHONHOME", home); + DUMP_CONFIG("PYTHONPATH", pythonpath_env); + DUMP_CONFIG("program name", program_name); + PySys_WriteStderr(" isolated = %i\n", config->isolated); + PySys_WriteStderr(" environment = %i\n", config->use_environment); + PySys_WriteStderr(" user site = %i\n", config->user_site_directory); + PySys_WriteStderr(" import site = %i\n", config->site_import); +#undef DUMP_CONFIG + +#define DUMP_SYS(NAME) \ + do { \ + obj = PySys_GetObject(#NAME); \ + PySys_FormatStderr(" sys.%s = ", #NAME); \ + if (obj != NULL) { \ + PySys_FormatStderr("%A", obj); \ + } \ + else { \ + PySys_WriteStderr("(not set)"); \ + } \ + PySys_FormatStderr("\n"); \ + } while (0) + + PyObject *obj; + DUMP_SYS(_base_executable); + DUMP_SYS(base_prefix); + DUMP_SYS(base_exec_prefix); + DUMP_SYS(platlibdir); + DUMP_SYS(executable); + DUMP_SYS(prefix); + DUMP_SYS(exec_prefix); +#undef DUMP_SYS + + PyObject *sys_path = PySys_GetObject("path"); /* borrowed reference */ + if (sys_path != NULL && PyList_Check(sys_path)) { + PySys_WriteStderr(" sys.path = [\n"); + Py_ssize_t len = PyList_GET_SIZE(sys_path); + for (Py_ssize_t i=0; i < len; i++) { + PyObject *path = PyList_GET_ITEM(sys_path, i); + PySys_FormatStderr(" %A,\n", path); + } + PySys_WriteStderr(" ]\n"); + } + + _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); +} diff --git a/contrib/tools/python3/src/Python/marshal.c b/contrib/tools/python3/src/Python/marshal.c index a9721aa7c0..baafa3ecfb 100644 --- a/contrib/tools/python3/src/Python/marshal.c +++ b/contrib/tools/python3/src/Python/marshal.c @@ -12,7 +12,7 @@ #include "longintrepr.h" #include "code.h" #include "marshal.h" -#include "pycore_hashtable.h" +#include "pycore_hashtable.h" /*[clinic input] module marshal @@ -83,7 +83,7 @@ typedef struct { int depth; PyObject *str; char *ptr; - const char *end; + const char *end; char *buf; _Py_hashtable_t *hashtable; int version; @@ -114,7 +114,7 @@ w_reserve(WFILE *p, Py_ssize_t needed) } assert(p->str != NULL); pos = p->ptr - p->buf; - size = PyBytes_GET_SIZE(p->str); + size = PyBytes_GET_SIZE(p->str); if (size > 16*1024*1024) delta = (size >> 3); /* 12.5% overallocation */ else @@ -126,7 +126,7 @@ w_reserve(WFILE *p, Py_ssize_t needed) } size += delta; if (_PyBytes_Resize(&p->str, size) != 0) { - p->end = p->ptr = p->buf = NULL; + p->end = p->ptr = p->buf = NULL; return 0; } else { @@ -138,7 +138,7 @@ w_reserve(WFILE *p, Py_ssize_t needed) } static void -w_string(const void *s, Py_ssize_t n, WFILE *p) +w_string(const void *s, Py_ssize_t n, WFILE *p) { Py_ssize_t m; if (!n || p->ptr == NULL) @@ -194,14 +194,14 @@ w_long(long x, WFILE *p) #endif static void -w_pstring(const void *s, Py_ssize_t n, WFILE *p) +w_pstring(const void *s, Py_ssize_t n, WFILE *p) { W_SIZE(n, p); w_string(s, n, p); } static void -w_short_pstring(const void *s, Py_ssize_t n, WFILE *p) +w_short_pstring(const void *s, Py_ssize_t n, WFILE *p) { w_byte(Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char), p); w_string(s, n, p); @@ -266,29 +266,29 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p) } while (d != 0); } -static void -w_float_bin(double v, WFILE *p) -{ - unsigned char buf[8]; - if (_PyFloat_Pack8(v, buf, 1) < 0) { - p->error = WFERR_UNMARSHALLABLE; - return; - } - w_string(buf, 8, p); -} - -static void -w_float_str(double v, WFILE *p) -{ - char *buf = PyOS_double_to_string(v, 'g', 17, 0, NULL); - if (!buf) { - p->error = WFERR_NOMEMORY; - return; - } - w_short_pstring(buf, strlen(buf), p); - PyMem_Free(buf); -} - +static void +w_float_bin(double v, WFILE *p) +{ + unsigned char buf[8]; + if (_PyFloat_Pack8(v, buf, 1) < 0) { + p->error = WFERR_UNMARSHALLABLE; + return; + } + w_string(buf, 8, p); +} + +static void +w_float_str(double v, WFILE *p) +{ + char *buf = PyOS_double_to_string(v, 'g', 17, 0, NULL); + if (!buf) { + p->error = WFERR_NOMEMORY; + return; + } + w_short_pstring(buf, strlen(buf), p); + PyMem_Free(buf); +} + static int w_ref(PyObject *v, char *flag, WFILE *p) { @@ -302,17 +302,17 @@ w_ref(PyObject *v, char *flag, WFILE *p) if (Py_REFCNT(v) == 1) return 0; - entry = _Py_hashtable_get_entry(p->hashtable, v); + entry = _Py_hashtable_get_entry(p->hashtable, v); if (entry != NULL) { /* write the reference index to the stream */ - w = (int)(uintptr_t)entry->value; + w = (int)(uintptr_t)entry->value; /* we don't store "long" indices in the dict */ assert(0 <= w && w <= 0x7fffffff); w_byte(TYPE_REF, p); w_long(w, p); return 1; } else { - size_t s = p->hashtable->nentries; + size_t s = p->hashtable->nentries; /* we don't support long indices */ if (s >= 0x7fffffff) { PyErr_SetString(PyExc_ValueError, "too many objects"); @@ -320,7 +320,7 @@ w_ref(PyObject *v, char *flag, WFILE *p) } w = (int)s; Py_INCREF(v); - if (_Py_hashtable_set(p->hashtable, v, (void *)(uintptr_t)w) < 0) { + if (_Py_hashtable_set(p->hashtable, v, (void *)(uintptr_t)w) < 0) { Py_DECREF(v); goto err; } @@ -375,10 +375,10 @@ w_complex_object(PyObject *v, char flag, WFILE *p) Py_ssize_t i, n; if (PyLong_CheckExact(v)) { - int overflow; - long x = PyLong_AsLongAndOverflow(v, &overflow); - if (overflow) { - w_PyLong((PyLongObject *)v, flag, p); + int overflow; + long x = PyLong_AsLongAndOverflow(v, &overflow); + if (overflow) { + w_PyLong((PyLongObject *)v, flag, p); } else { #if SIZEOF_LONG > 4 @@ -398,23 +398,23 @@ w_complex_object(PyObject *v, char flag, WFILE *p) else if (PyFloat_CheckExact(v)) { if (p->version > 1) { W_TYPE(TYPE_BINARY_FLOAT, p); - w_float_bin(PyFloat_AS_DOUBLE(v), p); + w_float_bin(PyFloat_AS_DOUBLE(v), p); } else { W_TYPE(TYPE_FLOAT, p); - w_float_str(PyFloat_AS_DOUBLE(v), p); + w_float_str(PyFloat_AS_DOUBLE(v), p); } } else if (PyComplex_CheckExact(v)) { if (p->version > 1) { W_TYPE(TYPE_BINARY_COMPLEX, p); - w_float_bin(PyComplex_RealAsDouble(v), p); - w_float_bin(PyComplex_ImagAsDouble(v), p); + w_float_bin(PyComplex_RealAsDouble(v), p); + w_float_bin(PyComplex_ImagAsDouble(v), p); } else { W_TYPE(TYPE_COMPLEX, p); - w_float_str(PyComplex_RealAsDouble(v), p); - w_float_str(PyComplex_ImagAsDouble(v), p); + w_float_str(PyComplex_RealAsDouble(v), p); + w_float_str(PyComplex_ImagAsDouble(v), p); } } else if (PyBytes_CheckExact(v)) { @@ -429,7 +429,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p) W_TYPE(TYPE_SHORT_ASCII_INTERNED, p); else W_TYPE(TYPE_SHORT_ASCII, p); - w_short_pstring(PyUnicode_1BYTE_DATA(v), + w_short_pstring(PyUnicode_1BYTE_DATA(v), PyUnicode_GET_LENGTH(v), p); } else { @@ -437,7 +437,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p) W_TYPE(TYPE_ASCII_INTERNED, p); else W_TYPE(TYPE_ASCII, p); - w_pstring(PyUnicode_1BYTE_DATA(v), + w_pstring(PyUnicode_1BYTE_DATA(v), PyUnicode_GET_LENGTH(v), p); } } @@ -458,7 +458,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p) } } else if (PyTuple_CheckExact(v)) { - n = PyTuple_GET_SIZE(v); + n = PyTuple_GET_SIZE(v); if (p->version >= 4 && n < 256) { W_TYPE(TYPE_SMALL_TUPLE, p); w_byte((unsigned char)n, p); @@ -492,17 +492,17 @@ w_complex_object(PyObject *v, char flag, WFILE *p) w_object((PyObject *)NULL, p); } else if (PyAnySet_CheckExact(v)) { - PyObject *value; - Py_ssize_t pos = 0; - Py_hash_t hash; + PyObject *value; + Py_ssize_t pos = 0; + Py_hash_t hash; - if (PyFrozenSet_CheckExact(v)) - W_TYPE(TYPE_FROZENSET, p); - else + if (PyFrozenSet_CheckExact(v)) + W_TYPE(TYPE_FROZENSET, p); + else W_TYPE(TYPE_SET, p); - n = PySet_GET_SIZE(v); + n = PySet_GET_SIZE(v); W_SIZE(n, p); - while (_PySet_NextEntry(v, &pos, &value, &hash)) { + while (_PySet_NextEntry(v, &pos, &value, &hash)) { w_object(value, p); } } @@ -510,7 +510,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p) PyCodeObject *co = (PyCodeObject *)v; W_TYPE(TYPE_CODE, p); w_long(co->co_argcount, p); - w_long(co->co_posonlyargcount, p); + w_long(co->co_posonlyargcount, p); w_long(co->co_kwonlyargcount, p); w_long(co->co_nlocals, p); w_long(co->co_stacksize, p); @@ -545,20 +545,20 @@ w_complex_object(PyObject *v, char flag, WFILE *p) } } -static void -w_decref_entry(void *key) -{ - PyObject *entry_key = (PyObject *)key; - Py_XDECREF(entry_key); -} - +static void +w_decref_entry(void *key) +{ + PyObject *entry_key = (PyObject *)key; + Py_XDECREF(entry_key); +} + static int w_init_refs(WFILE *wf, int version) { if (version >= 3) { - wf->hashtable = _Py_hashtable_new_full(_Py_hashtable_hash_ptr, - _Py_hashtable_compare_direct, - w_decref_entry, NULL, NULL); + wf->hashtable = _Py_hashtable_new_full(_Py_hashtable_hash_ptr, + _Py_hashtable_compare_direct, + w_decref_entry, NULL, NULL); if (wf->hashtable == NULL) { PyErr_NoMemory(); return -1; @@ -596,18 +596,18 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version) { char buf[BUFSIZ]; WFILE wf; - if (PySys_Audit("marshal.dumps", "Oi", x, version) < 0) { - return; /* caller must check PyErr_Occurred() */ - } + if (PySys_Audit("marshal.dumps", "Oi", x, version) < 0) { + return; /* caller must check PyErr_Occurred() */ + } memset(&wf, 0, sizeof(wf)); wf.fp = fp; wf.ptr = wf.buf = buf; wf.end = wf.ptr + sizeof(buf); wf.error = WFERR_OK; wf.version = version; - if (w_init_refs(&wf, version)) { - return; /* caller must check PyErr_Occurred() */ - } + if (w_init_refs(&wf, version)) { + return; /* caller must check PyErr_Occurred() */ + } w_object(x, &wf); w_clear_refs(&wf); w_flush(&wf); @@ -617,8 +617,8 @@ typedef struct { FILE *fp; int depth; PyObject *readable; /* Stream-like object being read from */ - const char *ptr; - const char *end; + const char *ptr; + const char *end; char *buf; Py_ssize_t buf_size; PyObject *refs; /* a list */ @@ -631,7 +631,7 @@ r_string(Py_ssize_t n, RFILE *p) if (p->ptr != NULL) { /* Fast path for loads() */ - const char *res = p->ptr; + const char *res = p->ptr; Py_ssize_t left = p->end - p->ptr; if (left < n) { PyErr_SetString(PyExc_EOFError, @@ -713,7 +713,7 @@ r_byte(RFILE *p) else { const char *ptr = r_string(1, p); if (ptr != NULL) - c = *(const unsigned char *) ptr; + c = *(const unsigned char *) ptr; } return c; } @@ -792,7 +792,7 @@ r_PyLong(RFILE *p) if (ob == NULL) return NULL; - Py_SET_SIZE(ob, n > 0 ? size : -size); + Py_SET_SIZE(ob, n > 0 ? size : -size); for (i = 0; i < size-1; i++) { d = 0; @@ -842,38 +842,38 @@ r_PyLong(RFILE *p) return NULL; } -static double -r_float_bin(RFILE *p) -{ - const unsigned char *buf = (const unsigned char *) r_string(8, p); - if (buf == NULL) - return -1; - return _PyFloat_Unpack8(buf, 1); -} - -/* Issue #33720: Disable inlining for reducing the C stack consumption - on PGO builds. */ -_Py_NO_INLINE static double -r_float_str(RFILE *p) -{ - int n; - char buf[256]; - const char *ptr; - n = r_byte(p); - if (n == EOF) { - PyErr_SetString(PyExc_EOFError, - "EOF read where object expected"); - return -1; - } - ptr = r_string(n, p); - if (ptr == NULL) { - return -1; - } - memcpy(buf, ptr, n); - buf[n] = '\0'; - return PyOS_string_to_double(buf, NULL, NULL); -} - +static double +r_float_bin(RFILE *p) +{ + const unsigned char *buf = (const unsigned char *) r_string(8, p); + if (buf == NULL) + return -1; + return _PyFloat_Unpack8(buf, 1); +} + +/* Issue #33720: Disable inlining for reducing the C stack consumption + on PGO builds. */ +_Py_NO_INLINE static double +r_float_str(RFILE *p) +{ + int n; + char buf[256]; + const char *ptr; + n = r_byte(p); + if (n == EOF) { + PyErr_SetString(PyExc_EOFError, + "EOF read where object expected"); + return -1; + } + ptr = r_string(n, p); + if (ptr == NULL) { + return -1; + } + memcpy(buf, ptr, n); + buf[n] = '\0'; + return PyOS_string_to_double(buf, NULL, NULL); +} + /* allocate the reflist index for a new object. Return -1 on failure */ static Py_ssize_t r_ref_reserve(int flag, RFILE *p) @@ -1010,17 +1010,17 @@ r_object(RFILE *p) case TYPE_FLOAT: { - double x = r_float_str(p); - if (x == -1.0 && PyErr_Occurred()) + double x = r_float_str(p); + if (x == -1.0 && PyErr_Occurred()) break; - retval = PyFloat_FromDouble(x); + retval = PyFloat_FromDouble(x); R_REF(retval); break; } case TYPE_BINARY_FLOAT: { - double x = r_float_bin(p); + double x = r_float_bin(p); if (x == -1.0 && PyErr_Occurred()) break; retval = PyFloat_FromDouble(x); @@ -1031,10 +1031,10 @@ r_object(RFILE *p) case TYPE_COMPLEX: { Py_complex c; - c.real = r_float_str(p); + c.real = r_float_str(p); if (c.real == -1.0 && PyErr_Occurred()) break; - c.imag = r_float_str(p); + c.imag = r_float_str(p); if (c.imag == -1.0 && PyErr_Occurred()) break; retval = PyComplex_FromCComplex(c); @@ -1045,10 +1045,10 @@ r_object(RFILE *p) case TYPE_BINARY_COMPLEX: { Py_complex c; - c.real = r_float_bin(p); + c.real = r_float_bin(p); if (c.real == -1.0 && PyErr_Occurred()) break; - c.imag = r_float_bin(p); + c.imag = r_float_bin(p); if (c.imag == -1.0 && PyErr_Occurred()) break; retval = PyComplex_FromCComplex(c); @@ -1302,7 +1302,7 @@ r_object(RFILE *p) case TYPE_CODE: { int argcount; - int posonlyargcount; + int posonlyargcount; int kwonlyargcount; int nlocals; int stacksize; @@ -1328,10 +1328,10 @@ r_object(RFILE *p) argcount = (int)r_long(p); if (PyErr_Occurred()) goto code_error; - posonlyargcount = (int)r_long(p); - if (PyErr_Occurred()) { - goto code_error; - } + posonlyargcount = (int)r_long(p); + if (PyErr_Occurred()) { + goto code_error; + } kwonlyargcount = (int)r_long(p); if (PyErr_Occurred()) goto code_error; @@ -1375,8 +1375,8 @@ r_object(RFILE *p) if (lnotab == NULL) goto code_error; - v = (PyObject *) PyCode_NewWithPosOnlyArgs( - argcount, posonlyargcount, kwonlyargcount, + v = (PyObject *) PyCode_NewWithPosOnlyArgs( + argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames, freevars, cellvars, filename, name, @@ -1433,15 +1433,15 @@ read_object(RFILE *p) fprintf(stderr, "XXX readobject called with exception set\n"); return NULL; } - if (p->ptr && p->end) { - if (PySys_Audit("marshal.loads", "y#", p->ptr, (Py_ssize_t)(p->end - p->ptr)) < 0) { - return NULL; - } - } else if (p->fp || p->readable) { - if (PySys_Audit("marshal.load", NULL) < 0) { - return NULL; - } - } + if (p->ptr && p->end) { + if (PySys_Audit("marshal.loads", "y#", p->ptr, (Py_ssize_t)(p->end - p->ptr)) < 0) { + return NULL; + } + } else if (p->fp || p->readable) { + if (PySys_Audit("marshal.load", NULL) < 0) { + return NULL; + } + } v = r_object(p); if (v == NULL && !PyErr_Occurred()) PyErr_SetString(PyExc_TypeError, "NULL object in marshal data for object"); @@ -1538,7 +1538,7 @@ PyMarshal_ReadObjectFromFile(FILE *fp) rf.refs = PyList_New(0); if (rf.refs == NULL) return NULL; - result = read_object(&rf); + result = read_object(&rf); Py_DECREF(rf.refs); if (rf.buf != NULL) PyMem_FREE(rf.buf); @@ -1552,14 +1552,14 @@ PyMarshal_ReadObjectFromString(const char *str, Py_ssize_t len) PyObject *result; rf.fp = NULL; rf.readable = NULL; - rf.ptr = str; - rf.end = str + len; + rf.ptr = str; + rf.end = str + len; rf.buf = NULL; rf.depth = 0; rf.refs = PyList_New(0); if (rf.refs == NULL) return NULL; - result = read_object(&rf); + result = read_object(&rf); Py_DECREF(rf.refs); if (rf.buf != NULL) PyMem_FREE(rf.buf); @@ -1571,15 +1571,15 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) { WFILE wf; - if (PySys_Audit("marshal.dumps", "Oi", x, version) < 0) { - return NULL; - } + if (PySys_Audit("marshal.dumps", "Oi", x, version) < 0) { + return NULL; + } memset(&wf, 0, sizeof(wf)); wf.str = PyBytes_FromStringAndSize((char *)NULL, 50); if (wf.str == NULL) return NULL; - wf.ptr = wf.buf = PyBytes_AS_STRING(wf.str); - wf.end = wf.ptr + PyBytes_GET_SIZE(wf.str); + wf.ptr = wf.buf = PyBytes_AS_STRING(wf.str); + wf.end = wf.ptr + PyBytes_GET_SIZE(wf.str); wf.error = WFERR_OK; wf.version = version; if (w_init_refs(&wf, version)) { @@ -1589,7 +1589,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) w_object(x, &wf); w_clear_refs(&wf); if (wf.str != NULL) { - const char *base = PyBytes_AS_STRING(wf.str); + const char *base = PyBytes_AS_STRING(wf.str); if (_PyBytes_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base)) < 0) return NULL; } @@ -1638,7 +1638,7 @@ marshal_dump_impl(PyObject *module, PyObject *value, PyObject *file, s = PyMarshal_WriteObjectToString(value, version); if (s == NULL) return NULL; - res = _PyObject_CallMethodIdOneArg(file, &PyId_write, s); + res = _PyObject_CallMethodIdOneArg(file, &PyId_write, s); Py_DECREF(s); return res; } @@ -1681,7 +1681,7 @@ marshal_load(PyObject *module, PyObject *file) if (!PyBytes_Check(data)) { PyErr_Format(PyExc_TypeError, "file.read() returned not bytes but %.100s", - Py_TYPE(data)->tp_name); + Py_TYPE(data)->tp_name); result = NULL; } else { @@ -1814,9 +1814,9 @@ PyMarshal_Init(void) PyObject *mod = PyModule_Create(&marshalmodule); if (mod == NULL) return NULL; - if (PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION) < 0) { - Py_DECREF(mod); - return NULL; - } + if (PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION) < 0) { + Py_DECREF(mod); + return NULL; + } return mod; } diff --git a/contrib/tools/python3/src/Python/modsupport.c b/contrib/tools/python3/src/Python/modsupport.c index 802f795090..13482c6508 100644 --- a/contrib/tools/python3/src/Python/modsupport.c +++ b/contrib/tools/python3/src/Python/modsupport.c @@ -2,7 +2,7 @@ /* Module support implementation */ #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #define FLAG_SIZE_T 1 typedef double va_double; @@ -21,7 +21,7 @@ _Py_convert_optional_to_ssize_t(PyObject *obj, void *result) if (obj == Py_None) { return 1; } - else if (_PyIndex_Check(obj)) { + else if (_PyIndex_Check(obj)) { limit = PyNumber_AsSsize_t(obj, PyExc_OverflowError); if (limit == -1 && PyErr_Occurred()) { return 0; @@ -343,13 +343,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) ++*p_format; if (flags & FLAG_SIZE_T) n = va_arg(*p_va, Py_ssize_t); - else { + else { n = va_arg(*p_va, int); - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { - return NULL; - } - } + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { + return NULL; + } + } } else n = -1; @@ -396,13 +396,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) ++*p_format; if (flags & FLAG_SIZE_T) n = va_arg(*p_va, Py_ssize_t); - else { + else { n = va_arg(*p_va, int); - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { - return NULL; - } - } + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { + return NULL; + } + } } else n = -1; @@ -434,13 +434,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) ++*p_format; if (flags & FLAG_SIZE_T) n = va_arg(*p_va, Py_ssize_t); - else { + else { n = va_arg(*p_va, int); - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { - return NULL; - } - } + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { + return NULL; + } + } } else n = -1; @@ -619,9 +619,9 @@ va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len, va_end(lva); if (res < 0) { - if (stack != small_stack) { - PyMem_Free(stack); - } + if (stack != small_stack) { + PyMem_Free(stack); + } return NULL; } @@ -682,22 +682,22 @@ PyModule_AddStringConstant(PyObject *m, const char *name, const char *value) Py_DECREF(o); return -1; } - -int -PyModule_AddType(PyObject *module, PyTypeObject *type) -{ - if (PyType_Ready(type) < 0) { - return -1; - } - - const char *name = _PyType_Name(type); - assert(name != NULL); - - Py_INCREF(type); - if (PyModule_AddObject(module, name, (PyObject *)type) < 0) { - Py_DECREF(type); - return -1; - } - - return 0; -} + +int +PyModule_AddType(PyObject *module, PyTypeObject *type) +{ + if (PyType_Ready(type) < 0) { + return -1; + } + + const char *name = _PyType_Name(type); + assert(name != NULL); + + Py_INCREF(type); + if (PyModule_AddObject(module, name, (PyObject *)type) < 0) { + Py_DECREF(type); + return -1; + } + + return 0; +} diff --git a/contrib/tools/python3/src/Python/mysnprintf.c b/contrib/tools/python3/src/Python/mysnprintf.c index 25a8e26018..458ca14d5c 100644 --- a/contrib/tools/python3/src/Python/mysnprintf.c +++ b/contrib/tools/python3/src/Python/mysnprintf.c @@ -1,8 +1,8 @@ #include "Python.h" -/* snprintf() and vsnprintf() wrappers. - - If the platform has vsnprintf, we use it, else we +/* snprintf() and vsnprintf() wrappers. + + If the platform has vsnprintf, we use it, else we emulate it in a half-hearted way. Even if the platform has it, we wrap it because platforms differ in what vsnprintf does in case the buffer is too small: C99 behavior is to return the number of characters that @@ -54,15 +54,15 @@ PyOS_snprintf(char *str, size_t size, const char *format, ...) int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) { - assert(str != NULL); - assert(size > 0); - assert(format != NULL); - + assert(str != NULL); + assert(size > 0); + assert(format != NULL); + int len; /* # bytes written, excluding \0 */ -#if defined(_MSC_VER) || defined(HAVE_SNPRINTF) -# define _PyOS_vsnprintf_EXTRA_SPACE 1 +#if defined(_MSC_VER) || defined(HAVE_SNPRINTF) +# define _PyOS_vsnprintf_EXTRA_SPACE 1 #else -# define _PyOS_vsnprintf_EXTRA_SPACE 512 +# define _PyOS_vsnprintf_EXTRA_SPACE 512 char *buffer; #endif /* We take a size_t as input but return an int. Sanity check @@ -73,12 +73,12 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) goto Done; } -#if defined(_MSC_VER) - len = _vsnprintf(str, size, format, va); -#elif defined(HAVE_SNPRINTF) +#if defined(_MSC_VER) + len = _vsnprintf(str, size, format, va); +#elif defined(HAVE_SNPRINTF) len = vsnprintf(str, size, format, va); #else - /* Emulate vsnprintf(). */ + /* Emulate vsnprintf(). */ buffer = PyMem_MALLOC(size + _PyOS_vsnprintf_EXTRA_SPACE); if (buffer == NULL) { len = -666; @@ -86,12 +86,12 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) } len = vsprintf(buffer, format, va); - if (len < 0) { + if (len < 0) { /* ignore the error */; - } - else if ((size_t)len >= size + _PyOS_vsnprintf_EXTRA_SPACE) { - _Py_FatalErrorFunc(__func__, "Buffer overflow"); - } + } + else if ((size_t)len >= size + _PyOS_vsnprintf_EXTRA_SPACE) { + _Py_FatalErrorFunc(__func__, "Buffer overflow"); + } else { const size_t to_copy = (size_t)len < size ? (size_t)len : size - 1; @@ -101,11 +101,11 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) } PyMem_FREE(buffer); #endif - + Done: - if (size > 0) { + if (size > 0) { str[size-1] = '\0'; - } + } return len; #undef _PyOS_vsnprintf_EXTRA_SPACE } diff --git a/contrib/tools/python3/src/Python/mystrtoul.c b/contrib/tools/python3/src/Python/mystrtoul.c index 01ca208bbe..19fa57aa14 100644 --- a/contrib/tools/python3/src/Python/mystrtoul.c +++ b/contrib/tools/python3/src/Python/mystrtoul.c @@ -99,7 +99,7 @@ PyOS_strtoul(const char *str, char **ptr, int base) int ovlimit; /* required digits to overflow */ /* skip leading white space */ - while (*str && Py_ISSPACE(*str)) + while (*str && Py_ISSPACE(*str)) ++str; /* check for leading 0b, 0o or 0x for auto-base or base 16 */ @@ -138,7 +138,7 @@ PyOS_strtoul(const char *str, char **ptr, int base) /* skip all zeroes... */ while (*str == '0') ++str; - while (Py_ISSPACE(*str)) + while (Py_ISSPACE(*str)) ++str; if (ptr) *ptr = (char *)str; @@ -266,7 +266,7 @@ PyOS_strtol(const char *str, char **ptr, int base) unsigned long uresult; char sign; - while (*str && Py_ISSPACE(*str)) + while (*str && Py_ISSPACE(*str)) str++; sign = *str; diff --git a/contrib/tools/python3/src/Python/opcode_targets.h b/contrib/tools/python3/src/Python/opcode_targets.h index c6ebebc783..538fdbe3e0 100644 --- a/contrib/tools/python3/src/Python/opcode_targets.h +++ b/contrib/tools/python3/src/Python/opcode_targets.h @@ -5,7 +5,7 @@ static void *opcode_targets[256] = { &&TARGET_ROT_THREE, &&TARGET_DUP_TOP, &&TARGET_DUP_TOP_TWO, - &&TARGET_ROT_FOUR, + &&TARGET_ROT_FOUR, &&_unknown_opcode, &&_unknown_opcode, &&TARGET_NOP, @@ -47,13 +47,13 @@ static void *opcode_targets[256] = { &&_unknown_opcode, &&_unknown_opcode, &&_unknown_opcode, - &&TARGET_RERAISE, - &&TARGET_WITH_EXCEPT_START, + &&TARGET_RERAISE, + &&TARGET_WITH_EXCEPT_START, &&TARGET_GET_AITER, &&TARGET_GET_ANEXT, &&TARGET_BEFORE_ASYNC_WITH, - &&_unknown_opcode, - &&TARGET_END_ASYNC_FOR, + &&_unknown_opcode, + &&TARGET_END_ASYNC_FOR, &&TARGET_INPLACE_ADD, &&TARGET_INPLACE_SUBTRACT, &&TARGET_INPLACE_MULTIPLY, @@ -73,21 +73,21 @@ static void *opcode_targets[256] = { &&TARGET_LOAD_BUILD_CLASS, &&TARGET_YIELD_FROM, &&TARGET_GET_AWAITABLE, - &&TARGET_LOAD_ASSERTION_ERROR, + &&TARGET_LOAD_ASSERTION_ERROR, &&TARGET_INPLACE_LSHIFT, &&TARGET_INPLACE_RSHIFT, &&TARGET_INPLACE_AND, &&TARGET_INPLACE_XOR, &&TARGET_INPLACE_OR, - &&_unknown_opcode, - &&_unknown_opcode, - &&TARGET_LIST_TO_TUPLE, + &&_unknown_opcode, + &&_unknown_opcode, + &&TARGET_LIST_TO_TUPLE, &&TARGET_RETURN_VALUE, &&TARGET_IMPORT_STAR, &&TARGET_SETUP_ANNOTATIONS, &&TARGET_YIELD_VALUE, &&TARGET_POP_BLOCK, - &&_unknown_opcode, + &&_unknown_opcode, &&TARGET_POP_EXCEPT, &&TARGET_STORE_NAME, &&TARGET_DELETE_NAME, @@ -116,11 +116,11 @@ static void *opcode_targets[256] = { &&TARGET_POP_JUMP_IF_FALSE, &&TARGET_POP_JUMP_IF_TRUE, &&TARGET_LOAD_GLOBAL, - &&TARGET_IS_OP, - &&TARGET_CONTAINS_OP, + &&TARGET_IS_OP, + &&TARGET_CONTAINS_OP, &&_unknown_opcode, &&_unknown_opcode, - &&TARGET_JUMP_IF_NOT_EXC_MATCH, + &&TARGET_JUMP_IF_NOT_EXC_MATCH, &&TARGET_SETUP_FINALLY, &&_unknown_opcode, &&TARGET_LOAD_FAST, @@ -148,23 +148,23 @@ static void *opcode_targets[256] = { &&TARGET_SET_ADD, &&TARGET_MAP_ADD, &&TARGET_LOAD_CLASSDEREF, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, + &&_unknown_opcode, &&TARGET_SETUP_ASYNC_WITH, &&TARGET_FORMAT_VALUE, &&TARGET_BUILD_CONST_KEY_MAP, &&TARGET_BUILD_STRING, &&_unknown_opcode, - &&_unknown_opcode, + &&_unknown_opcode, &&TARGET_LOAD_METHOD, &&TARGET_CALL_METHOD, - &&TARGET_LIST_EXTEND, - &&TARGET_SET_UPDATE, - &&TARGET_DICT_MERGE, - &&TARGET_DICT_UPDATE, + &&TARGET_LIST_EXTEND, + &&TARGET_SET_UPDATE, + &&TARGET_DICT_MERGE, + &&TARGET_DICT_UPDATE, &&_unknown_opcode, &&_unknown_opcode, &&_unknown_opcode, diff --git a/contrib/tools/python3/src/Python/pathconfig.c b/contrib/tools/python3/src/Python/pathconfig.c index b28f3e4976..b2ce86e64c 100644 --- a/contrib/tools/python3/src/Python/pathconfig.c +++ b/contrib/tools/python3/src/Python/pathconfig.c @@ -1,15 +1,15 @@ /* Path configuration like module_search_path (sys.path) */ #include "Python.h" -#include "osdefs.h" // DELIM -#include "pycore_initconfig.h" -#include "pycore_fileutils.h" -#include "pycore_pathconfig.h" -#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "osdefs.h" // DELIM +#include "pycore_initconfig.h" +#include "pycore_fileutils.h" +#include "pycore_pathconfig.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include <wchar.h> -#ifdef MS_WINDOWS -# include <windows.h> // GetFullPathNameW(), MAX_PATH -#endif +#ifdef MS_WINDOWS +# include <windows.h> // GetFullPathNameW(), MAX_PATH +#endif #ifdef __cplusplus extern "C" { @@ -19,26 +19,26 @@ extern "C" { _PyPathConfig _Py_path_config = _PyPathConfig_INIT; -static int -copy_wstr(wchar_t **dst, const wchar_t *src) +static int +copy_wstr(wchar_t **dst, const wchar_t *src) +{ + assert(*dst == NULL); + if (src != NULL) { + *dst = _PyMem_RawWcsdup(src); + if (*dst == NULL) { + return -1; + } + } + else { + *dst = NULL; + } + return 0; +} + + +static void +pathconfig_clear(_PyPathConfig *config) { - assert(*dst == NULL); - if (src != NULL) { - *dst = _PyMem_RawWcsdup(src); - if (*dst == NULL) { - return -1; - } - } - else { - *dst = NULL; - } - return 0; -} - - -static void -pathconfig_clear(_PyPathConfig *config) -{ /* _PyMem_SetDefaultAllocator() is needed to get a known memory allocator, since Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName() can be called before Py_Initialize() which can changes the memory allocator. */ @@ -51,434 +51,434 @@ pathconfig_clear(_PyPathConfig *config) ATTR = NULL; \ } while (0) - CLEAR(config->program_full_path); + CLEAR(config->program_full_path); CLEAR(config->prefix); CLEAR(config->exec_prefix); CLEAR(config->module_search_path); - CLEAR(config->program_name); + CLEAR(config->program_name); CLEAR(config->home); -#ifdef MS_WINDOWS - CLEAR(config->base_executable); -#endif - +#ifdef MS_WINDOWS + CLEAR(config->base_executable); +#endif + #undef CLEAR PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } -static PyStatus -pathconfig_copy(_PyPathConfig *config, const _PyPathConfig *config2) +static PyStatus +pathconfig_copy(_PyPathConfig *config, const _PyPathConfig *config2) +{ + pathconfig_clear(config); + +#define COPY_ATTR(ATTR) \ + do { \ + if (copy_wstr(&config->ATTR, config2->ATTR) < 0) { \ + return _PyStatus_NO_MEMORY(); \ + } \ + } while (0) + + COPY_ATTR(program_full_path); + COPY_ATTR(prefix); + COPY_ATTR(exec_prefix); + COPY_ATTR(module_search_path); + COPY_ATTR(program_name); + COPY_ATTR(home); +#ifdef MS_WINDOWS + config->isolated = config2->isolated; + config->site_import = config2->site_import; + COPY_ATTR(base_executable); +#endif + +#undef COPY_ATTR + + return _PyStatus_OK(); +} + + +void +_PyPathConfig_ClearGlobal(void) +{ + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + pathconfig_clear(&_Py_path_config); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); +} + + +static wchar_t* +_PyWideStringList_Join(const PyWideStringList *list, wchar_t sep) { - pathconfig_clear(config); - -#define COPY_ATTR(ATTR) \ - do { \ - if (copy_wstr(&config->ATTR, config2->ATTR) < 0) { \ - return _PyStatus_NO_MEMORY(); \ - } \ - } while (0) - - COPY_ATTR(program_full_path); - COPY_ATTR(prefix); - COPY_ATTR(exec_prefix); - COPY_ATTR(module_search_path); - COPY_ATTR(program_name); - COPY_ATTR(home); -#ifdef MS_WINDOWS - config->isolated = config2->isolated; - config->site_import = config2->site_import; - COPY_ATTR(base_executable); -#endif - -#undef COPY_ATTR - - return _PyStatus_OK(); -} - - -void -_PyPathConfig_ClearGlobal(void) -{ - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - pathconfig_clear(&_Py_path_config); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); -} - - -static wchar_t* -_PyWideStringList_Join(const PyWideStringList *list, wchar_t sep) -{ - size_t len = 1; /* NUL terminator */ - for (Py_ssize_t i=0; i < list->length; i++) { - if (i != 0) { - len++; - } - len += wcslen(list->items[i]); - } - - wchar_t *text = PyMem_RawMalloc(len * sizeof(wchar_t)); - if (text == NULL) { - return NULL; - } - wchar_t *str = text; - for (Py_ssize_t i=0; i < list->length; i++) { - wchar_t *path = list->items[i]; - if (i != 0) { - *str++ = sep; - } - len = wcslen(path); - memcpy(str, path, len * sizeof(wchar_t)); - str += len; - } - *str = L'\0'; - - return text; -} - - -static PyStatus -pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) -{ - PyStatus status; + size_t len = 1; /* NUL terminator */ + for (Py_ssize_t i=0; i < list->length; i++) { + if (i != 0) { + len++; + } + len += wcslen(list->items[i]); + } + + wchar_t *text = PyMem_RawMalloc(len * sizeof(wchar_t)); + if (text == NULL) { + return NULL; + } + wchar_t *str = text; + for (Py_ssize_t i=0; i < list->length; i++) { + wchar_t *path = list->items[i]; + if (i != 0) { + *str++ = sep; + } + len = wcslen(path); + memcpy(str, path, len * sizeof(wchar_t)); + str += len; + } + *str = L'\0'; + + return text; +} + + +static PyStatus +pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) +{ + PyStatus status; PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - if (config->module_search_paths_set) { - PyMem_RawFree(pathconfig->module_search_path); - pathconfig->module_search_path = _PyWideStringList_Join(&config->module_search_paths, DELIM); - if (pathconfig->module_search_path == NULL) { - goto no_memory; - } - } - -#define COPY_CONFIG(PATH_ATTR, CONFIG_ATTR) \ - if (config->CONFIG_ATTR) { \ - PyMem_RawFree(pathconfig->PATH_ATTR); \ - pathconfig->PATH_ATTR = NULL; \ - if (copy_wstr(&pathconfig->PATH_ATTR, config->CONFIG_ATTR) < 0) { \ - goto no_memory; \ - } \ - } - - COPY_CONFIG(program_full_path, executable); - COPY_CONFIG(prefix, prefix); - COPY_CONFIG(exec_prefix, exec_prefix); - COPY_CONFIG(program_name, program_name); - COPY_CONFIG(home, home); -#ifdef MS_WINDOWS - COPY_CONFIG(base_executable, base_executable); -#endif - -#undef COPY_CONFIG - - status = _PyStatus_OK(); - goto done; - -no_memory: - status = _PyStatus_NO_MEMORY(); - -done: - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - return status; -} - - -PyStatus -_PyConfig_WritePathConfig(const PyConfig *config) -{ - return pathconfig_set_from_config(&_Py_path_config, config); -} - - -static PyStatus -config_init_module_search_paths(PyConfig *config, _PyPathConfig *pathconfig) -{ - assert(!config->module_search_paths_set); - - _PyWideStringList_Clear(&config->module_search_paths); - - const wchar_t *sys_path = pathconfig->module_search_path; - const wchar_t delim = DELIM; - while (1) { - const wchar_t *p = wcschr(sys_path, delim); - if (p == NULL) { - p = sys_path + wcslen(sys_path); /* End of string */ - } - - size_t path_len = (p - sys_path); - wchar_t *path = PyMem_RawMalloc((path_len + 1) * sizeof(wchar_t)); - if (path == NULL) { - return _PyStatus_NO_MEMORY(); - } - memcpy(path, sys_path, path_len * sizeof(wchar_t)); - path[path_len] = L'\0'; - - PyStatus status = PyWideStringList_Append(&config->module_search_paths, path); - PyMem_RawFree(path); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (*p == '\0') { - break; - } - sys_path = p + 1; - } - config->module_search_paths_set = 1; - return _PyStatus_OK(); -} - - -/* Calculate the path configuration: - - - exec_prefix - - module_search_path - - prefix - - program_full_path - - On Windows, more fields are calculated: - - - base_executable - - isolated - - site_import - - On other platforms, isolated and site_import are left unchanged, and - _PyConfig_InitPathConfig() copies executable to base_executable (if it's not - set). - - Priority, highest to lowest: - - - PyConfig - - _Py_path_config: set by Py_SetPath(), Py_SetPythonHome() - and Py_SetProgramName() - - _PyPathConfig_Calculate() -*/ -static PyStatus -pathconfig_calculate(_PyPathConfig *pathconfig, const PyConfig *config) -{ - PyStatus status; - - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - status = pathconfig_copy(pathconfig, &_Py_path_config); - if (_PyStatus_EXCEPTION(status)) { + if (config->module_search_paths_set) { + PyMem_RawFree(pathconfig->module_search_path); + pathconfig->module_search_path = _PyWideStringList_Join(&config->module_search_paths, DELIM); + if (pathconfig->module_search_path == NULL) { + goto no_memory; + } + } + +#define COPY_CONFIG(PATH_ATTR, CONFIG_ATTR) \ + if (config->CONFIG_ATTR) { \ + PyMem_RawFree(pathconfig->PATH_ATTR); \ + pathconfig->PATH_ATTR = NULL; \ + if (copy_wstr(&pathconfig->PATH_ATTR, config->CONFIG_ATTR) < 0) { \ + goto no_memory; \ + } \ + } + + COPY_CONFIG(program_full_path, executable); + COPY_CONFIG(prefix, prefix); + COPY_CONFIG(exec_prefix, exec_prefix); + COPY_CONFIG(program_name, program_name); + COPY_CONFIG(home, home); +#ifdef MS_WINDOWS + COPY_CONFIG(base_executable, base_executable); +#endif + +#undef COPY_CONFIG + + status = _PyStatus_OK(); + goto done; + +no_memory: + status = _PyStatus_NO_MEMORY(); + +done: + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + return status; +} + + +PyStatus +_PyConfig_WritePathConfig(const PyConfig *config) +{ + return pathconfig_set_from_config(&_Py_path_config, config); +} + + +static PyStatus +config_init_module_search_paths(PyConfig *config, _PyPathConfig *pathconfig) +{ + assert(!config->module_search_paths_set); + + _PyWideStringList_Clear(&config->module_search_paths); + + const wchar_t *sys_path = pathconfig->module_search_path; + const wchar_t delim = DELIM; + while (1) { + const wchar_t *p = wcschr(sys_path, delim); + if (p == NULL) { + p = sys_path + wcslen(sys_path); /* End of string */ + } + + size_t path_len = (p - sys_path); + wchar_t *path = PyMem_RawMalloc((path_len + 1) * sizeof(wchar_t)); + if (path == NULL) { + return _PyStatus_NO_MEMORY(); + } + memcpy(path, sys_path, path_len * sizeof(wchar_t)); + path[path_len] = L'\0'; + + PyStatus status = PyWideStringList_Append(&config->module_search_paths, path); + PyMem_RawFree(path); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (*p == '\0') { + break; + } + sys_path = p + 1; + } + config->module_search_paths_set = 1; + return _PyStatus_OK(); +} + + +/* Calculate the path configuration: + + - exec_prefix + - module_search_path + - prefix + - program_full_path + + On Windows, more fields are calculated: + + - base_executable + - isolated + - site_import + + On other platforms, isolated and site_import are left unchanged, and + _PyConfig_InitPathConfig() copies executable to base_executable (if it's not + set). + + Priority, highest to lowest: + + - PyConfig + - _Py_path_config: set by Py_SetPath(), Py_SetPythonHome() + and Py_SetProgramName() + - _PyPathConfig_Calculate() +*/ +static PyStatus +pathconfig_calculate(_PyPathConfig *pathconfig, const PyConfig *config) +{ + PyStatus status; + + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + status = pathconfig_copy(pathconfig, &_Py_path_config); + if (_PyStatus_EXCEPTION(status)) { goto done; } - status = pathconfig_set_from_config(pathconfig, config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - if (_Py_path_config.module_search_path == NULL) { - status = _PyPathConfig_Calculate(pathconfig, config); - } - else { - /* Py_SetPath() has been called: avoid _PyPathConfig_Calculate() */ - } - -done: - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - return status; -} - - -static PyStatus -config_calculate_pathconfig(PyConfig *config) -{ - _PyPathConfig pathconfig = _PyPathConfig_INIT; - PyStatus status; - - status = pathconfig_calculate(&pathconfig, config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - if (!config->module_search_paths_set) { - status = config_init_module_search_paths(config, &pathconfig); - if (_PyStatus_EXCEPTION(status)) { + status = pathconfig_set_from_config(pathconfig, config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + if (_Py_path_config.module_search_path == NULL) { + status = _PyPathConfig_Calculate(pathconfig, config); + } + else { + /* Py_SetPath() has been called: avoid _PyPathConfig_Calculate() */ + } + +done: + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + return status; +} + + +static PyStatus +config_calculate_pathconfig(PyConfig *config) +{ + _PyPathConfig pathconfig = _PyPathConfig_INIT; + PyStatus status; + + status = pathconfig_calculate(&pathconfig, config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + if (!config->module_search_paths_set) { + status = config_init_module_search_paths(config, &pathconfig); + if (_PyStatus_EXCEPTION(status)) { goto done; } } - -#define COPY_ATTR(PATH_ATTR, CONFIG_ATTR) \ - if (config->CONFIG_ATTR == NULL) { \ - if (copy_wstr(&config->CONFIG_ATTR, pathconfig.PATH_ATTR) < 0) { \ - goto no_memory; \ - } \ - } - -#ifdef MS_WINDOWS - if (config->executable != NULL && config->base_executable == NULL) { - /* If executable is set explicitly in the configuration, - ignore calculated base_executable: _PyConfig_InitPathConfig() - will copy executable to base_executable */ - } + +#define COPY_ATTR(PATH_ATTR, CONFIG_ATTR) \ + if (config->CONFIG_ATTR == NULL) { \ + if (copy_wstr(&config->CONFIG_ATTR, pathconfig.PATH_ATTR) < 0) { \ + goto no_memory; \ + } \ + } + +#ifdef MS_WINDOWS + if (config->executable != NULL && config->base_executable == NULL) { + /* If executable is set explicitly in the configuration, + ignore calculated base_executable: _PyConfig_InitPathConfig() + will copy executable to base_executable */ + } else { - COPY_ATTR(base_executable, base_executable); + COPY_ATTR(base_executable, base_executable); } -#endif +#endif + + COPY_ATTR(program_full_path, executable); + COPY_ATTR(prefix, prefix); + COPY_ATTR(exec_prefix, exec_prefix); - COPY_ATTR(program_full_path, executable); - COPY_ATTR(prefix, prefix); - COPY_ATTR(exec_prefix, exec_prefix); - -#undef COPY_ATTR - -#ifdef MS_WINDOWS - /* If a ._pth file is found: isolated and site_import are overridden */ - if (pathconfig.isolated != -1) { - config->isolated = pathconfig.isolated; +#undef COPY_ATTR + +#ifdef MS_WINDOWS + /* If a ._pth file is found: isolated and site_import are overridden */ + if (pathconfig.isolated != -1) { + config->isolated = pathconfig.isolated; + } + if (pathconfig.site_import != -1) { + config->site_import = pathconfig.site_import; } - if (pathconfig.site_import != -1) { - config->site_import = pathconfig.site_import; - } -#endif +#endif + + status = _PyStatus_OK(); + goto done; + +no_memory: + status = _PyStatus_NO_MEMORY(); + +done: + pathconfig_clear(&pathconfig); + return status; +} + + +PyStatus +_PyConfig_InitPathConfig(PyConfig *config) +{ + /* Do we need to calculate the path? */ + if (!config->module_search_paths_set + || config->executable == NULL + || config->prefix == NULL + || config->exec_prefix == NULL) + { + PyStatus status = config_calculate_pathconfig(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (config->base_prefix == NULL) { + if (copy_wstr(&config->base_prefix, config->prefix) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + + if (config->base_exec_prefix == NULL) { + if (copy_wstr(&config->base_exec_prefix, + config->exec_prefix) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + + if (config->base_executable == NULL) { + if (copy_wstr(&config->base_executable, + config->executable) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + + return _PyStatus_OK(); +} - status = _PyStatus_OK(); - goto done; -no_memory: - status = _PyStatus_NO_MEMORY(); +static PyStatus +pathconfig_global_read(_PyPathConfig *pathconfig) +{ + PyConfig config; + _PyConfig_InitCompatConfig(&config); + + /* Call _PyConfig_InitPathConfig() */ + PyStatus status = PyConfig_Read(&config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = pathconfig_set_from_config(pathconfig, &config); done: - pathconfig_clear(&pathconfig); - return status; + PyConfig_Clear(&config); + return status; } -PyStatus -_PyConfig_InitPathConfig(PyConfig *config) +static void +pathconfig_global_init(void) { - /* Do we need to calculate the path? */ - if (!config->module_search_paths_set - || config->executable == NULL - || config->prefix == NULL - || config->exec_prefix == NULL) - { - PyStatus status = config_calculate_pathconfig(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (config->base_prefix == NULL) { - if (copy_wstr(&config->base_prefix, config->prefix) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - - if (config->base_exec_prefix == NULL) { - if (copy_wstr(&config->base_exec_prefix, - config->exec_prefix) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - - if (config->base_executable == NULL) { - if (copy_wstr(&config->base_executable, - config->executable) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - - return _PyStatus_OK(); -} - - -static PyStatus -pathconfig_global_read(_PyPathConfig *pathconfig) -{ - PyConfig config; - _PyConfig_InitCompatConfig(&config); - - /* Call _PyConfig_InitPathConfig() */ - PyStatus status = PyConfig_Read(&config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = pathconfig_set_from_config(pathconfig, &config); - -done: - PyConfig_Clear(&config); - return status; + PyStatus status; + + if (_Py_path_config.module_search_path == NULL) { + status = pathconfig_global_read(&_Py_path_config); + if (_PyStatus_EXCEPTION(status)) { + Py_ExitStatusException(status); + } + } + else { + /* Global configuration already initialized */ + } + + assert(_Py_path_config.program_full_path != NULL); + assert(_Py_path_config.prefix != NULL); + assert(_Py_path_config.exec_prefix != NULL); + assert(_Py_path_config.module_search_path != NULL); + assert(_Py_path_config.program_name != NULL); + /* home can be NULL */ +#ifdef MS_WINDOWS + assert(_Py_path_config.base_executable != NULL); +#endif } -static void -pathconfig_global_init(void) -{ - PyStatus status; - - if (_Py_path_config.module_search_path == NULL) { - status = pathconfig_global_read(&_Py_path_config); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); - } - } - else { - /* Global configuration already initialized */ - } - - assert(_Py_path_config.program_full_path != NULL); - assert(_Py_path_config.prefix != NULL); - assert(_Py_path_config.exec_prefix != NULL); - assert(_Py_path_config.module_search_path != NULL); - assert(_Py_path_config.program_name != NULL); - /* home can be NULL */ -#ifdef MS_WINDOWS - assert(_Py_path_config.base_executable != NULL); -#endif -} - - /* External interface */ -static void _Py_NO_RETURN -path_out_of_memory(const char *func) -{ - _Py_FatalErrorFunc(func, "out of memory"); -} - +static void _Py_NO_RETURN +path_out_of_memory(const char *func) +{ + _Py_FatalErrorFunc(func, "out of memory"); +} + void Py_SetPath(const wchar_t *path) { if (path == NULL) { - pathconfig_clear(&_Py_path_config); + pathconfig_clear(&_Py_path_config); return; } PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - /* Getting the program full path calls pathconfig_global_init() */ - wchar_t *program_full_path = _PyMem_RawWcsdup(Py_GetProgramFullPath()); + /* Getting the program full path calls pathconfig_global_init() */ + wchar_t *program_full_path = _PyMem_RawWcsdup(Py_GetProgramFullPath()); - PyMem_RawFree(_Py_path_config.program_full_path); - PyMem_RawFree(_Py_path_config.prefix); - PyMem_RawFree(_Py_path_config.exec_prefix); - PyMem_RawFree(_Py_path_config.module_search_path); + PyMem_RawFree(_Py_path_config.program_full_path); + PyMem_RawFree(_Py_path_config.prefix); + PyMem_RawFree(_Py_path_config.exec_prefix); + PyMem_RawFree(_Py_path_config.module_search_path); - _Py_path_config.program_full_path = program_full_path; - _Py_path_config.prefix = _PyMem_RawWcsdup(L""); - _Py_path_config.exec_prefix = _PyMem_RawWcsdup(L""); - _Py_path_config.module_search_path = _PyMem_RawWcsdup(path); + _Py_path_config.program_full_path = program_full_path; + _Py_path_config.prefix = _PyMem_RawWcsdup(L""); + _Py_path_config.exec_prefix = _PyMem_RawWcsdup(L""); + _Py_path_config.module_search_path = _PyMem_RawWcsdup(path); PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - if (_Py_path_config.program_full_path == NULL - || _Py_path_config.prefix == NULL - || _Py_path_config.exec_prefix == NULL - || _Py_path_config.module_search_path == NULL) - { - path_out_of_memory(__func__); - } + + if (_Py_path_config.program_full_path == NULL + || _Py_path_config.prefix == NULL + || _Py_path_config.exec_prefix == NULL + || _Py_path_config.module_search_path == NULL) + { + path_out_of_memory(__func__); + } } @@ -498,7 +498,7 @@ Py_SetPythonHome(const wchar_t *home) PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); if (_Py_path_config.home == NULL) { - path_out_of_memory(__func__); + path_out_of_memory(__func__); } } @@ -519,7 +519,7 @@ Py_SetProgramName(const wchar_t *program_name) PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); if (_Py_path_config.program_name == NULL) { - path_out_of_memory(__func__); + path_out_of_memory(__func__); } } @@ -539,7 +539,7 @@ _Py_SetProgramFullPath(const wchar_t *program_full_path) PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); if (_Py_path_config.program_full_path == NULL) { - path_out_of_memory(__func__); + path_out_of_memory(__func__); } } @@ -591,90 +591,90 @@ Py_GetProgramName(void) return _Py_path_config.program_name; } -/* Compute module search path from argv[0] or the current working - directory ("-m module" case) which will be prepended to sys.argv: - sys.path[0]. - - Return 1 if the path is correctly resolved and written into *path0_p. - - Return 0 if it fails to resolve the full path. For example, return 0 if the - current working directory has been removed (bpo-36236) or if argv is empty. - - Raise an exception and return -1 on error. - */ -int -_PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p) +/* Compute module search path from argv[0] or the current working + directory ("-m module" case) which will be prepended to sys.argv: + sys.path[0]. + + Return 1 if the path is correctly resolved and written into *path0_p. + + Return 0 if it fails to resolve the full path. For example, return 0 if the + current working directory has been removed (bpo-36236) or if argv is empty. + + Raise an exception and return -1 on error. + */ +int +_PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p) { - assert(_PyWideStringList_CheckConsistency(argv)); - - if (argv->length == 0) { - /* Leave sys.path unchanged if sys.argv is empty */ - return 0; - } - - wchar_t *argv0 = argv->items[0]; - int have_module_arg = (wcscmp(argv0, L"-m") == 0); - int have_script_arg = (!have_module_arg && (wcscmp(argv0, L"-c") != 0)); - - wchar_t *path0 = argv0; + assert(_PyWideStringList_CheckConsistency(argv)); + + if (argv->length == 0) { + /* Leave sys.path unchanged if sys.argv is empty */ + return 0; + } + + wchar_t *argv0 = argv->items[0]; + int have_module_arg = (wcscmp(argv0, L"-m") == 0); + int have_script_arg = (!have_module_arg && (wcscmp(argv0, L"-c") != 0)); + + wchar_t *path0 = argv0; Py_ssize_t n = 0; - -#ifdef HAVE_REALPATH + +#ifdef HAVE_REALPATH wchar_t fullpath[MAXPATHLEN]; #elif defined(MS_WINDOWS) wchar_t fullpath[MAX_PATH]; #endif if (have_module_arg) { -#if defined(HAVE_REALPATH) || defined(MS_WINDOWS) - if (!_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath))) { - return 0; - } - path0 = fullpath; -#else - path0 = L"."; -#endif - n = wcslen(path0); +#if defined(HAVE_REALPATH) || defined(MS_WINDOWS) + if (!_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath))) { + return 0; + } + path0 = fullpath; +#else + path0 = L"."; +#endif + n = wcslen(path0); } #ifdef HAVE_READLINK - wchar_t link[MAXPATHLEN + 1]; - int nr = 0; - wchar_t path0copy[2 * MAXPATHLEN + 1]; - - if (have_script_arg) { - nr = _Py_wreadlink(path0, link, Py_ARRAY_LENGTH(link)); - } + wchar_t link[MAXPATHLEN + 1]; + int nr = 0; + wchar_t path0copy[2 * MAXPATHLEN + 1]; + + if (have_script_arg) { + nr = _Py_wreadlink(path0, link, Py_ARRAY_LENGTH(link)); + } if (nr > 0) { /* It's a symlink */ link[nr] = '\0'; - if (link[0] == SEP) { - path0 = link; /* Link to absolute path */ - } - else if (wcschr(link, SEP) == NULL) { - /* Link without path */ - } + if (link[0] == SEP) { + path0 = link; /* Link to absolute path */ + } + else if (wcschr(link, SEP) == NULL) { + /* Link without path */ + } else { - /* Must join(dirname(path0), link) */ - wchar_t *q = wcsrchr(path0, SEP); - if (q == NULL) { - /* path0 without path */ - path0 = link; - } + /* Must join(dirname(path0), link) */ + wchar_t *q = wcsrchr(path0, SEP); + if (q == NULL) { + /* path0 without path */ + path0 = link; + } else { - /* Must make a copy, path0copy has room for 2 * MAXPATHLEN */ - wcsncpy(path0copy, path0, MAXPATHLEN); - q = wcsrchr(path0copy, SEP); + /* Must make a copy, path0copy has room for 2 * MAXPATHLEN */ + wcsncpy(path0copy, path0, MAXPATHLEN); + q = wcsrchr(path0copy, SEP); wcsncpy(q+1, link, MAXPATHLEN); q[MAXPATHLEN + 1] = L'\0'; - path0 = path0copy; + path0 = path0copy; } } } #endif /* HAVE_READLINK */ - wchar_t *p = NULL; - + wchar_t *p = NULL; + #if SEP == '\\' /* Special case for Microsoft filename syntax */ if (have_script_arg) { @@ -682,78 +682,78 @@ _PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p) #if defined(MS_WINDOWS) /* Replace the first element in argv with the full path. */ wchar_t *ptemp; - if (GetFullPathNameW(path0, + if (GetFullPathNameW(path0, Py_ARRAY_LENGTH(fullpath), fullpath, &ptemp)) { - path0 = fullpath; + path0 = fullpath; } #endif - p = wcsrchr(path0, SEP); + p = wcsrchr(path0, SEP); /* Test for alternate separator */ - q = wcsrchr(p ? p : path0, '/'); + q = wcsrchr(p ? p : path0, '/'); if (q != NULL) p = q; if (p != NULL) { - n = p + 1 - path0; + n = p + 1 - path0; if (n > 1 && p[-1] != ':') n--; /* Drop trailing separator */ } } -#else - /* All other filename syntaxes */ +#else + /* All other filename syntaxes */ if (have_script_arg) { #if defined(HAVE_REALPATH) - if (_Py_wrealpath(path0, fullpath, Py_ARRAY_LENGTH(fullpath))) { - path0 = fullpath; + if (_Py_wrealpath(path0, fullpath, Py_ARRAY_LENGTH(fullpath))) { + path0 = fullpath; } #endif - p = wcsrchr(path0, SEP); + p = wcsrchr(path0, SEP); } if (p != NULL) { - n = p + 1 - path0; + n = p + 1 - path0; #if SEP == '/' /* Special case for Unix filename syntax */ - if (n > 1) { - /* Drop trailing separator */ - n--; - } + if (n > 1) { + /* Drop trailing separator */ + n--; + } #endif /* Unix */ } #endif /* All others */ - PyObject *path0_obj = PyUnicode_FromWideChar(path0, n); - if (path0_obj == NULL) { - return -1; - } - - *path0_p = path0_obj; - return 1; + PyObject *path0_obj = PyUnicode_FromWideChar(path0, n); + if (path0_obj == NULL) { + return -1; + } + + *path0_p = path0_obj; + return 1; } -#ifdef MS_WINDOWS -#define WCSTOK wcstok_s -#else -#define WCSTOK wcstok -#endif - +#ifdef MS_WINDOWS +#define WCSTOK wcstok_s +#else +#define WCSTOK wcstok +#endif + /* Search for a prefix value in an environment file (pyvenv.cfg). - - - If found, copy it into *value_p: string which must be freed by - PyMem_RawFree(). - - If not found, *value_p is set to NULL. -*/ -PyStatus + + - If found, copy it into *value_p: string which must be freed by + PyMem_RawFree(). + - If not found, *value_p is set to NULL. +*/ +PyStatus _Py_FindEnvConfigValue(FILE *env_file, const wchar_t *key, - wchar_t **value_p) + wchar_t **value_p) { - *value_p = NULL; - - char buffer[MAXPATHLEN * 2 + 1]; /* allow extra for key, '=', etc. */ - buffer[Py_ARRAY_LENGTH(buffer)-1] = '\0'; + *value_p = NULL; + + char buffer[MAXPATHLEN * 2 + 1]; /* allow extra for key, '=', etc. */ + buffer[Py_ARRAY_LENGTH(buffer)-1] = '\0'; while (!feof(env_file)) { - char * p = fgets(buffer, Py_ARRAY_LENGTH(buffer) - 1, env_file); + char * p = fgets(buffer, Py_ARRAY_LENGTH(buffer) - 1, env_file); if (p == NULL) { break; @@ -769,33 +769,33 @@ _Py_FindEnvConfigValue(FILE *env_file, const wchar_t *key, continue; } - wchar_t *tmpbuffer = _Py_DecodeUTF8_surrogateescape(buffer, n, NULL); + wchar_t *tmpbuffer = _Py_DecodeUTF8_surrogateescape(buffer, n, NULL); if (tmpbuffer) { wchar_t * state; - wchar_t * tok = WCSTOK(tmpbuffer, L" \t\r\n", &state); + wchar_t * tok = WCSTOK(tmpbuffer, L" \t\r\n", &state); if ((tok != NULL) && !wcscmp(tok, key)) { - tok = WCSTOK(NULL, L" \t", &state); + tok = WCSTOK(NULL, L" \t", &state); if ((tok != NULL) && !wcscmp(tok, L"=")) { - tok = WCSTOK(NULL, L"\r\n", &state); + tok = WCSTOK(NULL, L"\r\n", &state); if (tok != NULL) { - *value_p = _PyMem_RawWcsdup(tok); + *value_p = _PyMem_RawWcsdup(tok); PyMem_RawFree(tmpbuffer); - - if (*value_p == NULL) { - return _PyStatus_NO_MEMORY(); - } - - /* found */ - return _PyStatus_OK(); + + if (*value_p == NULL) { + return _PyStatus_NO_MEMORY(); + } + + /* found */ + return _PyStatus_OK(); } } } PyMem_RawFree(tmpbuffer); } } - - /* not found */ - return _PyStatus_OK(); + + /* not found */ + return _PyStatus_OK(); } #ifdef __cplusplus diff --git a/contrib/tools/python3/src/Python/peephole.c b/contrib/tools/python3/src/Python/peephole.c index c5c8ed1b5b..6954c87b13 100644 --- a/contrib/tools/python3/src/Python/peephole.c +++ b/contrib/tools/python3/src/Python/peephole.c @@ -13,9 +13,9 @@ #define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) #define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE \ +#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE \ || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ - || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH) + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH) #define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) #define GETJUMPTGT(arr, i) (get_arg(arr, i) / sizeof(_Py_CODEUNIT) + \ (ABSOLUTE_JUMP(_Py_OPCODE(arr[i])) ? 0 : i+1)) @@ -152,15 +152,15 @@ fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t codelen, PyTuple_SET_ITEM(newconst, i, constant); } - Py_ssize_t index = PyList_GET_SIZE(consts); -#if SIZEOF_SIZE_T > SIZEOF_INT - if ((size_t)index >= UINT_MAX - 1) { - Py_DECREF(newconst); - PyErr_SetString(PyExc_OverflowError, "too many constants"); - return -1; - } -#endif - + Py_ssize_t index = PyList_GET_SIZE(consts); +#if SIZEOF_SIZE_T > SIZEOF_INT + if ((size_t)index >= UINT_MAX - 1) { + Py_DECREF(newconst); + PyErr_SetString(PyExc_OverflowError, "too many constants"); + return -1; + } +#endif + /* Append folded constant onto consts */ if (PyList_Append(consts, newconst)) { Py_DECREF(newconst); @@ -169,7 +169,7 @@ fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t codelen, Py_DECREF(newconst); return copy_op_arg(codestr, c_start, LOAD_CONST, - (unsigned int)index, opcode_end); + (unsigned int)index, opcode_end); } static unsigned int * @@ -194,7 +194,7 @@ markblocks(_Py_CODEUNIT *code, Py_ssize_t len) case JUMP_IF_TRUE_OR_POP: case POP_JUMP_IF_FALSE: case POP_JUMP_IF_TRUE: - case JUMP_IF_NOT_EXC_MATCH: + case JUMP_IF_NOT_EXC_MATCH: case JUMP_ABSOLUTE: case SETUP_FINALLY: case SETUP_WITH: @@ -230,7 +230,7 @@ PyObject * PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, PyObject *lnotab_obj) { - Py_ssize_t h, i, nexti, op_start, tgt; + Py_ssize_t h, i, nexti, op_start, tgt; unsigned int j, nops; unsigned char opcode, nextop; _Py_CODEUNIT *codestr = NULL; @@ -250,34 +250,34 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, lnotab = (unsigned char*)PyBytes_AS_STRING(lnotab_obj); tabsiz = PyBytes_GET_SIZE(lnotab_obj); assert(tabsiz == 0 || Py_REFCNT(lnotab_obj) == 1); - - /* Don't optimize if lnotab contains instruction pointer delta larger - than +255 (encoded as multiple bytes), just to keep the peephole optimizer - simple. The optimizer leaves line number deltas unchanged. */ - - for (i = 0; i < tabsiz; i += 2) { - if (lnotab[i] == 255) { - goto exitUnchanged; - } + + /* Don't optimize if lnotab contains instruction pointer delta larger + than +255 (encoded as multiple bytes), just to keep the peephole optimizer + simple. The optimizer leaves line number deltas unchanged. */ + + for (i = 0; i < tabsiz; i += 2) { + if (lnotab[i] == 255) { + goto exitUnchanged; + } } assert(PyBytes_Check(code)); - Py_ssize_t codesize = PyBytes_GET_SIZE(code); - assert(codesize % sizeof(_Py_CODEUNIT) == 0); - Py_ssize_t codelen = codesize / sizeof(_Py_CODEUNIT); - if (codelen > INT_MAX) { - /* Python assembler is limited to INT_MAX: see assembler.a_offset in - compile.c. */ - goto exitUnchanged; - } + Py_ssize_t codesize = PyBytes_GET_SIZE(code); + assert(codesize % sizeof(_Py_CODEUNIT) == 0); + Py_ssize_t codelen = codesize / sizeof(_Py_CODEUNIT); + if (codelen > INT_MAX) { + /* Python assembler is limited to INT_MAX: see assembler.a_offset in + compile.c. */ + goto exitUnchanged; + } /* Make a modifiable copy of the code string */ - codestr = (_Py_CODEUNIT *)PyMem_Malloc(codesize); + codestr = (_Py_CODEUNIT *)PyMem_Malloc(codesize); if (codestr == NULL) { PyErr_NoMemory(); goto exitError; } - memcpy(codestr, PyBytes_AS_STRING(code), codesize); + memcpy(codestr, PyBytes_AS_STRING(code), codesize); blocks = markblocks(codestr, codelen); if (blocks == NULL) @@ -306,18 +306,18 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case LOAD_CONST: cumlc = lastlc + 1; if (nextop != POP_JUMP_IF_FALSE || - !ISBASICBLOCK(blocks, op_start, i + 1)) { + !ISBASICBLOCK(blocks, op_start, i + 1)) { break; - } - PyObject* cnt = PyList_GET_ITEM(consts, get_arg(codestr, i)); - int is_true = PyObject_IsTrue(cnt); - if (is_true == -1) { - goto exitError; - } - if (is_true == 1) { - fill_nops(codestr, op_start, nexti + 1); - cumlc = 0; - } + } + PyObject* cnt = PyList_GET_ITEM(consts, get_arg(codestr, i)); + int is_true = PyObject_IsTrue(cnt); + if (is_true == -1) { + goto exitError; + } + if (is_true == 1) { + fill_nops(codestr, op_start, nexti + 1); + cumlc = 0; + } break; /* Try to fold tuples of constants. @@ -382,11 +382,11 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, jump past it), and all conditional jumps pop their argument when they're not taken (so change the first jump to pop its argument when it's taken). */ - Py_ssize_t arg = (tgt + 1); - /* cannot overflow: codelen <= INT_MAX */ - assert((size_t)arg <= UINT_MAX / sizeof(_Py_CODEUNIT)); - arg *= sizeof(_Py_CODEUNIT); - h = set_arg(codestr, i, (unsigned int)arg); + Py_ssize_t arg = (tgt + 1); + /* cannot overflow: codelen <= INT_MAX */ + assert((size_t)arg <= UINT_MAX / sizeof(_Py_CODEUNIT)); + arg *= sizeof(_Py_CODEUNIT); + h = set_arg(codestr, i, (unsigned int)arg); j = opcode == JUMP_IF_TRUE_OR_POP ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE; } @@ -412,37 +412,37 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, codestr[op_start] = PACKOPARG(RETURN_VALUE, 0); fill_nops(codestr, op_start + 1, i + 1); } else if (UNCONDITIONAL_JUMP(_Py_OPCODE(codestr[tgt]))) { - size_t arg = GETJUMPTGT(codestr, tgt); + size_t arg = GETJUMPTGT(codestr, tgt); if (opcode == JUMP_FORWARD) { /* JMP_ABS can go backwards */ opcode = JUMP_ABSOLUTE; } else if (!ABSOLUTE_JUMP(opcode)) { - if (arg < (size_t)(i + 1)) { + if (arg < (size_t)(i + 1)) { break; /* No backward relative jumps */ } - arg -= i + 1; /* Calc relative jump addr */ + arg -= i + 1; /* Calc relative jump addr */ } - /* cannot overflow: codelen <= INT_MAX */ - assert(arg <= (UINT_MAX / sizeof(_Py_CODEUNIT))); - arg *= sizeof(_Py_CODEUNIT); - copy_op_arg(codestr, op_start, opcode, - (unsigned int)arg, i + 1); + /* cannot overflow: codelen <= INT_MAX */ + assert(arg <= (UINT_MAX / sizeof(_Py_CODEUNIT))); + arg *= sizeof(_Py_CODEUNIT); + copy_op_arg(codestr, op_start, opcode, + (unsigned int)arg, i + 1); } break; /* Remove unreachable ops after RETURN */ case RETURN_VALUE: h = i + 1; - while (h < codelen && ISBASICBLOCK(blocks, i, h)) - { - /* Leave SETUP_FINALLY and RERAISE in place to help find block limits. */ - if (_Py_OPCODE(codestr[h]) == SETUP_FINALLY || _Py_OPCODE(codestr[h]) == RERAISE) { - while (h > i + 1 && - _Py_OPCODE(codestr[h - 1]) == EXTENDED_ARG) - { - h--; - } - break; - } + while (h < codelen && ISBASICBLOCK(blocks, i, h)) + { + /* Leave SETUP_FINALLY and RERAISE in place to help find block limits. */ + if (_Py_OPCODE(codestr[h]) == SETUP_FINALLY || _Py_OPCODE(codestr[h]) == RERAISE) { + while (h > i + 1 && + _Py_OPCODE(codestr[h - 1]) == EXTENDED_ARG) + { + h--; + } + break; + } h++; } if (h > i + 1) { @@ -455,14 +455,14 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, /* Fixup lnotab */ for (i = 0, nops = 0; i < codelen; i++) { - size_t block = (size_t)i - nops; - /* cannot overflow: codelen <= INT_MAX */ - assert(block <= UINT_MAX); + size_t block = (size_t)i - nops; + /* cannot overflow: codelen <= INT_MAX */ + assert(block <= UINT_MAX); /* original code offset => new code offset */ - blocks[i] = (unsigned int)block; - if (_Py_OPCODE(codestr[i]) == NOP) { + blocks[i] = (unsigned int)block; + if (_Py_OPCODE(codestr[i]) == NOP) { nops++; - } + } } cum_orig_offset = 0; last_offset = 0; @@ -494,7 +494,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case POP_JUMP_IF_TRUE: case JUMP_IF_FALSE_OR_POP: case JUMP_IF_TRUE_OR_POP: - case JUMP_IF_NOT_EXC_MATCH: + case JUMP_IF_NOT_EXC_MATCH: j = blocks[j / sizeof(_Py_CODEUNIT)] * sizeof(_Py_CODEUNIT); break; @@ -507,18 +507,18 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, j *= sizeof(_Py_CODEUNIT); break; } - Py_ssize_t ilen = i - op_start + 1; - if (instrsize(j) > ilen) { + Py_ssize_t ilen = i - op_start + 1; + if (instrsize(j) > ilen) { goto exitUnchanged; - } - /* If instrsize(j) < ilen, we'll emit EXTENDED_ARG 0 */ - if (ilen > 4) { - /* Can only happen when PyCode_Optimize() is called with - malformed bytecode. */ - goto exitUnchanged; - } - write_op_arg(codestr + h, opcode, j, (int)ilen); - h += ilen; + } + /* If instrsize(j) < ilen, we'll emit EXTENDED_ARG 0 */ + if (ilen > 4) { + /* Can only happen when PyCode_Optimize() is called with + malformed bytecode. */ + goto exitUnchanged; + } + write_op_arg(codestr + h, opcode, j, (int)ilen); + h += ilen; } assert(h + (Py_ssize_t)nops == codelen); diff --git a/contrib/tools/python3/src/Python/preconfig.c b/contrib/tools/python3/src/Python/preconfig.c index cb4dc7ad53..262738fa57 100644 --- a/contrib/tools/python3/src/Python/preconfig.c +++ b/contrib/tools/python3/src/Python/preconfig.c @@ -1,968 +1,968 @@ -#include "Python.h" -#include "pycore_getopt.h" // _PyOS_GetOpt() -#include "pycore_initconfig.h" // _PyArgv -#include "pycore_pymem.h" // _PyMem_GetAllocatorName() -#include "pycore_runtime.h" // _PyRuntime_Initialize() -#include <locale.h> // setlocale() - - -#define DECODE_LOCALE_ERR(NAME, LEN) \ - (((LEN) == -2) \ - ? _PyStatus_ERR("cannot decode " NAME) \ - : _PyStatus_NO_MEMORY()) - - -/* Forward declarations */ -static void -preconfig_copy(PyPreConfig *config, const PyPreConfig *config2); - - -/* --- File system encoding/errors -------------------------------- */ - -/* The filesystem encoding is chosen by config_init_fs_encoding(), - see also initfsencoding(). - - Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors - are encoded to UTF-8. */ -const char *Py_FileSystemDefaultEncoding = NULL; -int Py_HasFileSystemDefaultEncoding = 0; -const char *Py_FileSystemDefaultEncodeErrors = NULL; -int _Py_HasFileSystemDefaultEncodeErrors = 0; - -void -_Py_ClearFileSystemEncoding(void) -{ - if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) { - PyMem_RawFree((char*)Py_FileSystemDefaultEncoding); - Py_FileSystemDefaultEncoding = NULL; - } - if (!_Py_HasFileSystemDefaultEncodeErrors && Py_FileSystemDefaultEncodeErrors) { - PyMem_RawFree((char*)Py_FileSystemDefaultEncodeErrors); - Py_FileSystemDefaultEncodeErrors = NULL; - } -} - - -/* Set Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors - global configuration variables. */ -int -_Py_SetFileSystemEncoding(const char *encoding, const char *errors) -{ - char *encoding2 = _PyMem_RawStrdup(encoding); - if (encoding2 == NULL) { - return -1; - } - - char *errors2 = _PyMem_RawStrdup(errors); - if (errors2 == NULL) { - PyMem_RawFree(encoding2); - return -1; - } - - _Py_ClearFileSystemEncoding(); - - Py_FileSystemDefaultEncoding = encoding2; - Py_HasFileSystemDefaultEncoding = 0; - - Py_FileSystemDefaultEncodeErrors = errors2; - _Py_HasFileSystemDefaultEncodeErrors = 0; - return 0; -} - - -/* --- _PyArgv ---------------------------------------------------- */ - -/* Decode bytes_argv using Py_DecodeLocale() */ -PyStatus -_PyArgv_AsWstrList(const _PyArgv *args, PyWideStringList *list) -{ - PyWideStringList wargv = _PyWideStringList_INIT; - if (args->use_bytes_argv) { - size_t size = sizeof(wchar_t*) * args->argc; - wargv.items = (wchar_t **)PyMem_RawMalloc(size); - if (wargv.items == NULL) { - return _PyStatus_NO_MEMORY(); - } - - for (Py_ssize_t i = 0; i < args->argc; i++) { - size_t len; - wchar_t *arg = Py_DecodeLocale(args->bytes_argv[i], &len); - if (arg == NULL) { - _PyWideStringList_Clear(&wargv); - return DECODE_LOCALE_ERR("command line arguments", - (Py_ssize_t)len); - } - wargv.items[i] = arg; - wargv.length++; - } - - _PyWideStringList_Clear(list); - *list = wargv; - } - else { - wargv.length = args->argc; - wargv.items = (wchar_t **)args->wchar_argv; - if (_PyWideStringList_Copy(list, &wargv) < 0) { - return _PyStatus_NO_MEMORY(); - } - } - return _PyStatus_OK(); -} - - -/* --- _PyPreCmdline ------------------------------------------------- */ - -void -_PyPreCmdline_Clear(_PyPreCmdline *cmdline) -{ - _PyWideStringList_Clear(&cmdline->argv); - _PyWideStringList_Clear(&cmdline->xoptions); -} - - -PyStatus -_PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, const _PyArgv *args) -{ - return _PyArgv_AsWstrList(args, &cmdline->argv); -} - - -static void -precmdline_get_preconfig(_PyPreCmdline *cmdline, const PyPreConfig *config) -{ -#define COPY_ATTR(ATTR) \ - if (config->ATTR != -1) { \ - cmdline->ATTR = config->ATTR; \ - } - - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(dev_mode); - -#undef COPY_ATTR -} - - -static void -precmdline_set_preconfig(const _PyPreCmdline *cmdline, PyPreConfig *config) -{ -#define COPY_ATTR(ATTR) \ - config->ATTR = cmdline->ATTR - - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(dev_mode); - -#undef COPY_ATTR -} - - -PyStatus -_PyPreCmdline_SetConfig(const _PyPreCmdline *cmdline, PyConfig *config) -{ -#define COPY_ATTR(ATTR) \ - config->ATTR = cmdline->ATTR - - PyStatus status = _PyWideStringList_Extend(&config->xoptions, &cmdline->xoptions); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(dev_mode); - return _PyStatus_OK(); - -#undef COPY_ATTR -} - - -/* Parse the command line arguments */ -static PyStatus -precmdline_parse_cmdline(_PyPreCmdline *cmdline) -{ - const PyWideStringList *argv = &cmdline->argv; - - _PyOS_ResetGetOpt(); - /* Don't log parsing errors into stderr here: PyConfig_Read() - is responsible for that */ - _PyOS_opterr = 0; - do { - int longindex = -1; - int c = _PyOS_GetOpt(argv->length, argv->items, &longindex); - - if (c == EOF || c == 'c' || c == 'm') { - break; - } - - switch (c) { - case 'E': - cmdline->use_environment = 0; - break; - - case 'I': - cmdline->isolated = 1; - break; - - case 'X': - { - PyStatus status = PyWideStringList_Append(&cmdline->xoptions, - _PyOS_optarg); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - break; - } - - default: - /* ignore other argument: - handled by PyConfig_Read() */ - break; - } - } while (1); - - return _PyStatus_OK(); -} - - -PyStatus -_PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig) -{ - precmdline_get_preconfig(cmdline, preconfig); - - if (preconfig->parse_argv) { - PyStatus status = precmdline_parse_cmdline(cmdline); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - /* isolated, use_environment */ - if (cmdline->isolated < 0) { - cmdline->isolated = 0; - } - if (cmdline->isolated > 0) { - cmdline->use_environment = 0; - } - if (cmdline->use_environment < 0) { - cmdline->use_environment = 0; - } - - /* dev_mode */ - if ((cmdline->dev_mode < 0) - && (_Py_get_xoption(&cmdline->xoptions, L"dev") - || _Py_GetEnv(cmdline->use_environment, "PYTHONDEVMODE"))) - { - cmdline->dev_mode = 1; - } - if (cmdline->dev_mode < 0) { - cmdline->dev_mode = 0; - } - - assert(cmdline->use_environment >= 0); - assert(cmdline->isolated >= 0); - assert(cmdline->dev_mode >= 0); - - return _PyStatus_OK(); -} - - -/* --- PyPreConfig ----------------------------------------------- */ - - -void -_PyPreConfig_InitCompatConfig(PyPreConfig *config) -{ - memset(config, 0, sizeof(*config)); - - config->_config_init = (int)_PyConfig_INIT_COMPAT; - config->parse_argv = 0; - config->isolated = -1; - config->use_environment = -1; - config->configure_locale = 1; - - /* bpo-36443: C locale coercion (PEP 538) and UTF-8 Mode (PEP 540) - are disabled by default using the Compat configuration. - - Py_UTF8Mode=1 enables the UTF-8 mode. PYTHONUTF8 environment variable - is ignored (even if use_environment=1). */ - config->utf8_mode = 0; - config->coerce_c_locale = 0; - config->coerce_c_locale_warn = 0; - - config->dev_mode = -1; - config->allocator = PYMEM_ALLOCATOR_NOT_SET; -#ifdef MS_WINDOWS - config->legacy_windows_fs_encoding = -1; -#endif -} - - -void -PyPreConfig_InitPythonConfig(PyPreConfig *config) -{ - _PyPreConfig_InitCompatConfig(config); - - config->_config_init = (int)_PyConfig_INIT_PYTHON; - config->isolated = 0; - config->parse_argv = 1; - config->use_environment = 1; - /* Set to -1 to enable C locale coercion (PEP 538) and UTF-8 Mode (PEP 540) - depending on the LC_CTYPE locale, PYTHONUTF8 and PYTHONCOERCECLOCALE - environment variables. */ - config->coerce_c_locale = -1; - config->coerce_c_locale_warn = -1; - config->utf8_mode = -1; -#ifdef MS_WINDOWS - config->legacy_windows_fs_encoding = 0; -#endif -} - - -void -PyPreConfig_InitIsolatedConfig(PyPreConfig *config) -{ - _PyPreConfig_InitCompatConfig(config); - - config->_config_init = (int)_PyConfig_INIT_ISOLATED; - config->configure_locale = 0; - config->isolated = 1; - config->use_environment = 0; - config->utf8_mode = 0; - config->dev_mode = 0; -#ifdef MS_WINDOWS - config->legacy_windows_fs_encoding = 0; -#endif -} - - -PyStatus -_PyPreConfig_InitFromPreConfig(PyPreConfig *config, - const PyPreConfig *config2) -{ - PyPreConfig_InitPythonConfig(config); - preconfig_copy(config, config2); - return _PyStatus_OK(); -} - - -void -_PyPreConfig_InitFromConfig(PyPreConfig *preconfig, const PyConfig *config) -{ - _PyConfigInitEnum config_init = (_PyConfigInitEnum)config->_config_init; - switch (config_init) { - case _PyConfig_INIT_PYTHON: - PyPreConfig_InitPythonConfig(preconfig); - break; - case _PyConfig_INIT_ISOLATED: - PyPreConfig_InitIsolatedConfig(preconfig); - break; - case _PyConfig_INIT_COMPAT: - default: - _PyPreConfig_InitCompatConfig(preconfig); - } - - _PyPreConfig_GetConfig(preconfig, config); -} - - -static void -preconfig_copy(PyPreConfig *config, const PyPreConfig *config2) -{ -#define COPY_ATTR(ATTR) config->ATTR = config2->ATTR - - COPY_ATTR(_config_init); - COPY_ATTR(parse_argv); - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(configure_locale); - COPY_ATTR(dev_mode); - COPY_ATTR(coerce_c_locale); - COPY_ATTR(coerce_c_locale_warn); - COPY_ATTR(utf8_mode); - COPY_ATTR(allocator); -#ifdef MS_WINDOWS - COPY_ATTR(legacy_windows_fs_encoding); -#endif - -#undef COPY_ATTR -} - - -PyObject* -_PyPreConfig_AsDict(const PyPreConfig *config) -{ - PyObject *dict; - - dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - -#define SET_ITEM_INT(ATTR) \ - do { \ - PyObject *obj = PyLong_FromLong(config->ATTR); \ - if (obj == NULL) { \ - goto fail; \ - } \ - int res = PyDict_SetItemString(dict, #ATTR, obj); \ - Py_DECREF(obj); \ - if (res < 0) { \ - goto fail; \ - } \ - } while (0) - - SET_ITEM_INT(_config_init); - SET_ITEM_INT(parse_argv); - SET_ITEM_INT(isolated); - SET_ITEM_INT(use_environment); - SET_ITEM_INT(configure_locale); - SET_ITEM_INT(coerce_c_locale); - SET_ITEM_INT(coerce_c_locale_warn); - SET_ITEM_INT(utf8_mode); -#ifdef MS_WINDOWS - SET_ITEM_INT(legacy_windows_fs_encoding); -#endif - SET_ITEM_INT(dev_mode); - SET_ITEM_INT(allocator); - return dict; - -fail: - Py_DECREF(dict); - return NULL; - -#undef SET_ITEM_INT -} - - -void -_PyPreConfig_GetConfig(PyPreConfig *preconfig, const PyConfig *config) -{ -#define COPY_ATTR(ATTR) \ - if (config->ATTR != -1) { \ - preconfig->ATTR = config->ATTR; \ - } - - COPY_ATTR(parse_argv); - COPY_ATTR(isolated); - COPY_ATTR(use_environment); - COPY_ATTR(dev_mode); - -#undef COPY_ATTR -} - - -static void -preconfig_get_global_vars(PyPreConfig *config) -{ - if (config->_config_init != _PyConfig_INIT_COMPAT) { - /* Python and Isolated configuration ignore global variables */ - return; - } - -#define COPY_FLAG(ATTR, VALUE) \ - if (config->ATTR < 0) { \ - config->ATTR = VALUE; \ - } -#define COPY_NOT_FLAG(ATTR, VALUE) \ - if (config->ATTR < 0) { \ - config->ATTR = !(VALUE); \ - } - - COPY_FLAG(isolated, Py_IsolatedFlag); - COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); - if (Py_UTF8Mode > 0) { - config->utf8_mode = Py_UTF8Mode; - } -#ifdef MS_WINDOWS - COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag); -#endif - -#undef COPY_FLAG -#undef COPY_NOT_FLAG -} - - -static void -preconfig_set_global_vars(const PyPreConfig *config) -{ -#define COPY_FLAG(ATTR, VAR) \ - if (config->ATTR >= 0) { \ - VAR = config->ATTR; \ - } -#define COPY_NOT_FLAG(ATTR, VAR) \ - if (config->ATTR >= 0) { \ - VAR = !config->ATTR; \ - } - - COPY_FLAG(isolated, Py_IsolatedFlag); - COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); -#ifdef MS_WINDOWS - COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag); -#endif - COPY_FLAG(utf8_mode, Py_UTF8Mode); - -#undef COPY_FLAG -#undef COPY_NOT_FLAG -} - - -const char* -_Py_GetEnv(int use_environment, const char *name) -{ - assert(use_environment >= 0); - - if (!use_environment) { - return NULL; - } - - const char *var = getenv(name); - if (var && var[0] != '\0') { - return var; - } - else { - return NULL; - } -} - - -int -_Py_str_to_int(const char *str, int *result) -{ - const char *endptr = str; - errno = 0; - long value = strtol(str, (char **)&endptr, 10); - if (*endptr != '\0' || errno == ERANGE) { - return -1; - } - if (value < INT_MIN || value > INT_MAX) { - return -1; - } - - *result = (int)value; - return 0; -} - - -void -_Py_get_env_flag(int use_environment, int *flag, const char *name) -{ - const char *var = _Py_GetEnv(use_environment, name); - if (!var) { - return; - } - int value; - if (_Py_str_to_int(var, &value) < 0 || value < 0) { - /* PYTHONDEBUG=text and PYTHONDEBUG=-2 behave as PYTHONDEBUG=1 */ - value = 1; - } - if (*flag < value) { - *flag = value; - } -} - - -const wchar_t* -_Py_get_xoption(const PyWideStringList *xoptions, const wchar_t *name) -{ - for (Py_ssize_t i=0; i < xoptions->length; i++) { - const wchar_t *option = xoptions->items[i]; - size_t len; - wchar_t *sep = wcschr(option, L'='); - if (sep != NULL) { - len = (sep - option); - } - else { - len = wcslen(option); - } - if (wcsncmp(option, name, len) == 0 && name[len] == L'\0') { - return option; - } - } - return NULL; -} - - -static PyStatus -preconfig_init_utf8_mode(PyPreConfig *config, const _PyPreCmdline *cmdline) -{ -#ifdef MS_WINDOWS - if (config->legacy_windows_fs_encoding) { - config->utf8_mode = 0; - } -#endif - - if (config->utf8_mode >= 0) { - return _PyStatus_OK(); - } - - const wchar_t *xopt; - xopt = _Py_get_xoption(&cmdline->xoptions, L"utf8"); - if (xopt) { - wchar_t *sep = wcschr(xopt, L'='); - if (sep) { - xopt = sep + 1; - if (wcscmp(xopt, L"1") == 0) { - config->utf8_mode = 1; - } - else if (wcscmp(xopt, L"0") == 0) { - config->utf8_mode = 0; - } - else { - return _PyStatus_ERR("invalid -X utf8 option value"); - } - } - else { - config->utf8_mode = 1; - } - return _PyStatus_OK(); - } - - const char *opt = _Py_GetEnv(config->use_environment, "PYTHONUTF8"); - if (opt) { - if (strcmp(opt, "1") == 0) { - config->utf8_mode = 1; - } - else if (strcmp(opt, "0") == 0) { - config->utf8_mode = 0; - } - else { - return _PyStatus_ERR("invalid PYTHONUTF8 environment " - "variable value"); - } - return _PyStatus_OK(); - } - - -#ifndef MS_WINDOWS - if (config->utf8_mode < 0) { - /* The C locale and the POSIX locale enable the UTF-8 Mode (PEP 540) */ - const char *ctype_loc = setlocale(LC_CTYPE, NULL); - if (ctype_loc != NULL - && (strcmp(ctype_loc, "C") == 0 - || strcmp(ctype_loc, "POSIX") == 0)) - { - config->utf8_mode = 1; - } - } -#endif - - if (config->utf8_mode < 0) { - config->utf8_mode = 0; - } - return _PyStatus_OK(); -} - - -static void -preconfig_init_coerce_c_locale(PyPreConfig *config) -{ - if (!config->configure_locale) { - config->coerce_c_locale = 0; - config->coerce_c_locale_warn = 0; - return; - } - - const char *env = _Py_GetEnv(config->use_environment, "PYTHONCOERCECLOCALE"); - if (env) { - if (strcmp(env, "0") == 0) { - if (config->coerce_c_locale < 0) { - config->coerce_c_locale = 0; - } - } - else if (strcmp(env, "warn") == 0) { - if (config->coerce_c_locale_warn < 0) { - config->coerce_c_locale_warn = 1; - } - } - else { - if (config->coerce_c_locale < 0) { - config->coerce_c_locale = 1; - } - } - } - - /* Test if coerce_c_locale equals to -1 or equals to 1: - PYTHONCOERCECLOCALE=1 doesn't imply that the C locale is always coerced. - It is only coerced if if the LC_CTYPE locale is "C". */ - if (config->coerce_c_locale < 0 || config->coerce_c_locale == 1) { - /* The C locale enables the C locale coercion (PEP 538) */ - if (_Py_LegacyLocaleDetected(0)) { - config->coerce_c_locale = 2; - } - else { - config->coerce_c_locale = 0; - } - } - - if (config->coerce_c_locale_warn < 0) { - config->coerce_c_locale_warn = 0; - } -} - - -static PyStatus -preconfig_init_allocator(PyPreConfig *config) -{ - if (config->allocator == PYMEM_ALLOCATOR_NOT_SET) { - /* bpo-34247. The PYTHONMALLOC environment variable has the priority - over PYTHONDEV env var and "-X dev" command line option. - For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory - allocators to "malloc" (and not to "debug"). */ - const char *envvar = _Py_GetEnv(config->use_environment, "PYTHONMALLOC"); - if (envvar) { - PyMemAllocatorName name; - if (_PyMem_GetAllocatorName(envvar, &name) < 0) { - return _PyStatus_ERR("PYTHONMALLOC: unknown allocator"); - } - config->allocator = (int)name; - } - } - - if (config->dev_mode && config->allocator == PYMEM_ALLOCATOR_NOT_SET) { - config->allocator = PYMEM_ALLOCATOR_DEBUG; - } - return _PyStatus_OK(); -} - - -static PyStatus -preconfig_read(PyPreConfig *config, _PyPreCmdline *cmdline) -{ - PyStatus status; - - status = _PyPreCmdline_Read(cmdline, config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - precmdline_set_preconfig(cmdline, config); - - /* legacy_windows_fs_encoding, coerce_c_locale, utf8_mode */ -#ifdef MS_WINDOWS - _Py_get_env_flag(config->use_environment, - &config->legacy_windows_fs_encoding, - "PYTHONLEGACYWINDOWSFSENCODING"); -#endif - - preconfig_init_coerce_c_locale(config); - - status = preconfig_init_utf8_mode(config, cmdline); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* allocator */ - status = preconfig_init_allocator(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - assert(config->coerce_c_locale >= 0); - assert(config->coerce_c_locale_warn >= 0); -#ifdef MS_WINDOWS - assert(config->legacy_windows_fs_encoding >= 0); -#endif - assert(config->utf8_mode >= 0); - assert(config->isolated >= 0); - assert(config->use_environment >= 0); - assert(config->dev_mode >= 0); - - return _PyStatus_OK(); -} - - -/* Read the configuration from: - - - command line arguments - - environment variables - - Py_xxx global configuration variables - - the LC_CTYPE locale */ -PyStatus -_PyPreConfig_Read(PyPreConfig *config, const _PyArgv *args) -{ - PyStatus status; - - status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - preconfig_get_global_vars(config); - - /* Copy LC_CTYPE locale, since it's modified later */ - const char *loc = setlocale(LC_CTYPE, NULL); - if (loc == NULL) { - return _PyStatus_ERR("failed to LC_CTYPE locale"); - } - char *init_ctype_locale = _PyMem_RawStrdup(loc); - if (init_ctype_locale == NULL) { - return _PyStatus_NO_MEMORY(); - } - - /* Save the config to be able to restore it if encodings change */ - PyPreConfig save_config; - - status = _PyPreConfig_InitFromPreConfig(&save_config, config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* Set LC_CTYPE to the user preferred locale */ - if (config->configure_locale) { - _Py_SetLocaleFromEnv(LC_CTYPE); - } - - _PyPreCmdline cmdline = _PyPreCmdline_INIT; - int init_utf8_mode = Py_UTF8Mode; -#ifdef MS_WINDOWS - int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag; -#endif - - if (args) { - status = _PyPreCmdline_SetArgv(&cmdline, args); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - } - - int locale_coerced = 0; - int loops = 0; - - while (1) { - int utf8_mode = config->utf8_mode; - - /* Watchdog to prevent an infinite loop */ - loops++; - if (loops == 3) { - status = _PyStatus_ERR("Encoding changed twice while " - "reading the configuration"); - goto done; - } - - /* bpo-34207: Py_DecodeLocale() and Py_EncodeLocale() depend - on Py_UTF8Mode and Py_LegacyWindowsFSEncodingFlag. */ - Py_UTF8Mode = config->utf8_mode; -#ifdef MS_WINDOWS - Py_LegacyWindowsFSEncodingFlag = config->legacy_windows_fs_encoding; -#endif - - status = preconfig_read(config, &cmdline); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - /* The legacy C locale assumes ASCII as the default text encoding, which - * causes problems not only for the CPython runtime, but also other - * components like GNU readline. - * - * Accordingly, when the CLI detects it, it attempts to coerce it to a - * more capable UTF-8 based alternative. - * - * See the documentation of the PYTHONCOERCECLOCALE setting for more - * details. - */ - int encoding_changed = 0; - if (config->coerce_c_locale && !locale_coerced) { - locale_coerced = 1; - _Py_CoerceLegacyLocale(0); - encoding_changed = 1; - } - - if (utf8_mode == -1) { - if (config->utf8_mode == 1) { - /* UTF-8 Mode enabled */ - encoding_changed = 1; - } - } - else { - if (config->utf8_mode != utf8_mode) { - encoding_changed = 1; - } - } - - if (!encoding_changed) { - break; - } - - /* Reset the configuration before reading again the configuration, - just keep UTF-8 Mode value. */ - int new_utf8_mode = config->utf8_mode; - int new_coerce_c_locale = config->coerce_c_locale; - preconfig_copy(config, &save_config); - config->utf8_mode = new_utf8_mode; - config->coerce_c_locale = new_coerce_c_locale; - - /* The encoding changed: read again the configuration - with the new encoding */ - } - status = _PyStatus_OK(); - -done: - if (init_ctype_locale != NULL) { - setlocale(LC_CTYPE, init_ctype_locale); - PyMem_RawFree(init_ctype_locale); - } - Py_UTF8Mode = init_utf8_mode ; -#ifdef MS_WINDOWS - Py_LegacyWindowsFSEncodingFlag = init_legacy_encoding; -#endif - _PyPreCmdline_Clear(&cmdline); - return status; -} - - -/* Write the pre-configuration: - - - set the memory allocators - - set Py_xxx global configuration variables - - set the LC_CTYPE locale (coerce C locale, PEP 538) and set the UTF-8 mode - (PEP 540) - - The applied configuration is written into _PyRuntime.preconfig. - If the C locale cannot be coerced, set coerce_c_locale to 0. - - Do nothing if called after Py_Initialize(): ignore the new - pre-configuration. */ -PyStatus -_PyPreConfig_Write(const PyPreConfig *src_config) -{ - PyPreConfig config; - - PyStatus status = _PyPreConfig_InitFromPreConfig(&config, src_config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (_PyRuntime.core_initialized) { - /* bpo-34008: Calling this functions after Py_Initialize() ignores - the new configuration. */ - return _PyStatus_OK(); - } - - PyMemAllocatorName name = (PyMemAllocatorName)config.allocator; - if (name != PYMEM_ALLOCATOR_NOT_SET) { - if (_PyMem_SetupAllocators(name) < 0) { - return _PyStatus_ERR("Unknown PYTHONMALLOC allocator"); - } - } - - preconfig_set_global_vars(&config); - - if (config.configure_locale) { - if (config.coerce_c_locale) { - if (!_Py_CoerceLegacyLocale(config.coerce_c_locale_warn)) { - /* C locale not coerced */ - config.coerce_c_locale = 0; - } - } - - /* Set LC_CTYPE to the user preferred locale */ - _Py_SetLocaleFromEnv(LC_CTYPE); - } - - /* Write the new pre-configuration into _PyRuntime */ - preconfig_copy(&_PyRuntime.preconfig, &config); - - return _PyStatus_OK(); -} +#include "Python.h" +#include "pycore_getopt.h" // _PyOS_GetOpt() +#include "pycore_initconfig.h" // _PyArgv +#include "pycore_pymem.h" // _PyMem_GetAllocatorName() +#include "pycore_runtime.h" // _PyRuntime_Initialize() +#include <locale.h> // setlocale() + + +#define DECODE_LOCALE_ERR(NAME, LEN) \ + (((LEN) == -2) \ + ? _PyStatus_ERR("cannot decode " NAME) \ + : _PyStatus_NO_MEMORY()) + + +/* Forward declarations */ +static void +preconfig_copy(PyPreConfig *config, const PyPreConfig *config2); + + +/* --- File system encoding/errors -------------------------------- */ + +/* The filesystem encoding is chosen by config_init_fs_encoding(), + see also initfsencoding(). + + Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors + are encoded to UTF-8. */ +const char *Py_FileSystemDefaultEncoding = NULL; +int Py_HasFileSystemDefaultEncoding = 0; +const char *Py_FileSystemDefaultEncodeErrors = NULL; +int _Py_HasFileSystemDefaultEncodeErrors = 0; + +void +_Py_ClearFileSystemEncoding(void) +{ + if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) { + PyMem_RawFree((char*)Py_FileSystemDefaultEncoding); + Py_FileSystemDefaultEncoding = NULL; + } + if (!_Py_HasFileSystemDefaultEncodeErrors && Py_FileSystemDefaultEncodeErrors) { + PyMem_RawFree((char*)Py_FileSystemDefaultEncodeErrors); + Py_FileSystemDefaultEncodeErrors = NULL; + } +} + + +/* Set Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors + global configuration variables. */ +int +_Py_SetFileSystemEncoding(const char *encoding, const char *errors) +{ + char *encoding2 = _PyMem_RawStrdup(encoding); + if (encoding2 == NULL) { + return -1; + } + + char *errors2 = _PyMem_RawStrdup(errors); + if (errors2 == NULL) { + PyMem_RawFree(encoding2); + return -1; + } + + _Py_ClearFileSystemEncoding(); + + Py_FileSystemDefaultEncoding = encoding2; + Py_HasFileSystemDefaultEncoding = 0; + + Py_FileSystemDefaultEncodeErrors = errors2; + _Py_HasFileSystemDefaultEncodeErrors = 0; + return 0; +} + + +/* --- _PyArgv ---------------------------------------------------- */ + +/* Decode bytes_argv using Py_DecodeLocale() */ +PyStatus +_PyArgv_AsWstrList(const _PyArgv *args, PyWideStringList *list) +{ + PyWideStringList wargv = _PyWideStringList_INIT; + if (args->use_bytes_argv) { + size_t size = sizeof(wchar_t*) * args->argc; + wargv.items = (wchar_t **)PyMem_RawMalloc(size); + if (wargv.items == NULL) { + return _PyStatus_NO_MEMORY(); + } + + for (Py_ssize_t i = 0; i < args->argc; i++) { + size_t len; + wchar_t *arg = Py_DecodeLocale(args->bytes_argv[i], &len); + if (arg == NULL) { + _PyWideStringList_Clear(&wargv); + return DECODE_LOCALE_ERR("command line arguments", + (Py_ssize_t)len); + } + wargv.items[i] = arg; + wargv.length++; + } + + _PyWideStringList_Clear(list); + *list = wargv; + } + else { + wargv.length = args->argc; + wargv.items = (wchar_t **)args->wchar_argv; + if (_PyWideStringList_Copy(list, &wargv) < 0) { + return _PyStatus_NO_MEMORY(); + } + } + return _PyStatus_OK(); +} + + +/* --- _PyPreCmdline ------------------------------------------------- */ + +void +_PyPreCmdline_Clear(_PyPreCmdline *cmdline) +{ + _PyWideStringList_Clear(&cmdline->argv); + _PyWideStringList_Clear(&cmdline->xoptions); +} + + +PyStatus +_PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, const _PyArgv *args) +{ + return _PyArgv_AsWstrList(args, &cmdline->argv); +} + + +static void +precmdline_get_preconfig(_PyPreCmdline *cmdline, const PyPreConfig *config) +{ +#define COPY_ATTR(ATTR) \ + if (config->ATTR != -1) { \ + cmdline->ATTR = config->ATTR; \ + } + + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(dev_mode); + +#undef COPY_ATTR +} + + +static void +precmdline_set_preconfig(const _PyPreCmdline *cmdline, PyPreConfig *config) +{ +#define COPY_ATTR(ATTR) \ + config->ATTR = cmdline->ATTR + + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(dev_mode); + +#undef COPY_ATTR +} + + +PyStatus +_PyPreCmdline_SetConfig(const _PyPreCmdline *cmdline, PyConfig *config) +{ +#define COPY_ATTR(ATTR) \ + config->ATTR = cmdline->ATTR + + PyStatus status = _PyWideStringList_Extend(&config->xoptions, &cmdline->xoptions); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(dev_mode); + return _PyStatus_OK(); + +#undef COPY_ATTR +} + + +/* Parse the command line arguments */ +static PyStatus +precmdline_parse_cmdline(_PyPreCmdline *cmdline) +{ + const PyWideStringList *argv = &cmdline->argv; + + _PyOS_ResetGetOpt(); + /* Don't log parsing errors into stderr here: PyConfig_Read() + is responsible for that */ + _PyOS_opterr = 0; + do { + int longindex = -1; + int c = _PyOS_GetOpt(argv->length, argv->items, &longindex); + + if (c == EOF || c == 'c' || c == 'm') { + break; + } + + switch (c) { + case 'E': + cmdline->use_environment = 0; + break; + + case 'I': + cmdline->isolated = 1; + break; + + case 'X': + { + PyStatus status = PyWideStringList_Append(&cmdline->xoptions, + _PyOS_optarg); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + break; + } + + default: + /* ignore other argument: + handled by PyConfig_Read() */ + break; + } + } while (1); + + return _PyStatus_OK(); +} + + +PyStatus +_PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig) +{ + precmdline_get_preconfig(cmdline, preconfig); + + if (preconfig->parse_argv) { + PyStatus status = precmdline_parse_cmdline(cmdline); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + /* isolated, use_environment */ + if (cmdline->isolated < 0) { + cmdline->isolated = 0; + } + if (cmdline->isolated > 0) { + cmdline->use_environment = 0; + } + if (cmdline->use_environment < 0) { + cmdline->use_environment = 0; + } + + /* dev_mode */ + if ((cmdline->dev_mode < 0) + && (_Py_get_xoption(&cmdline->xoptions, L"dev") + || _Py_GetEnv(cmdline->use_environment, "PYTHONDEVMODE"))) + { + cmdline->dev_mode = 1; + } + if (cmdline->dev_mode < 0) { + cmdline->dev_mode = 0; + } + + assert(cmdline->use_environment >= 0); + assert(cmdline->isolated >= 0); + assert(cmdline->dev_mode >= 0); + + return _PyStatus_OK(); +} + + +/* --- PyPreConfig ----------------------------------------------- */ + + +void +_PyPreConfig_InitCompatConfig(PyPreConfig *config) +{ + memset(config, 0, sizeof(*config)); + + config->_config_init = (int)_PyConfig_INIT_COMPAT; + config->parse_argv = 0; + config->isolated = -1; + config->use_environment = -1; + config->configure_locale = 1; + + /* bpo-36443: C locale coercion (PEP 538) and UTF-8 Mode (PEP 540) + are disabled by default using the Compat configuration. + + Py_UTF8Mode=1 enables the UTF-8 mode. PYTHONUTF8 environment variable + is ignored (even if use_environment=1). */ + config->utf8_mode = 0; + config->coerce_c_locale = 0; + config->coerce_c_locale_warn = 0; + + config->dev_mode = -1; + config->allocator = PYMEM_ALLOCATOR_NOT_SET; +#ifdef MS_WINDOWS + config->legacy_windows_fs_encoding = -1; +#endif +} + + +void +PyPreConfig_InitPythonConfig(PyPreConfig *config) +{ + _PyPreConfig_InitCompatConfig(config); + + config->_config_init = (int)_PyConfig_INIT_PYTHON; + config->isolated = 0; + config->parse_argv = 1; + config->use_environment = 1; + /* Set to -1 to enable C locale coercion (PEP 538) and UTF-8 Mode (PEP 540) + depending on the LC_CTYPE locale, PYTHONUTF8 and PYTHONCOERCECLOCALE + environment variables. */ + config->coerce_c_locale = -1; + config->coerce_c_locale_warn = -1; + config->utf8_mode = -1; +#ifdef MS_WINDOWS + config->legacy_windows_fs_encoding = 0; +#endif +} + + +void +PyPreConfig_InitIsolatedConfig(PyPreConfig *config) +{ + _PyPreConfig_InitCompatConfig(config); + + config->_config_init = (int)_PyConfig_INIT_ISOLATED; + config->configure_locale = 0; + config->isolated = 1; + config->use_environment = 0; + config->utf8_mode = 0; + config->dev_mode = 0; +#ifdef MS_WINDOWS + config->legacy_windows_fs_encoding = 0; +#endif +} + + +PyStatus +_PyPreConfig_InitFromPreConfig(PyPreConfig *config, + const PyPreConfig *config2) +{ + PyPreConfig_InitPythonConfig(config); + preconfig_copy(config, config2); + return _PyStatus_OK(); +} + + +void +_PyPreConfig_InitFromConfig(PyPreConfig *preconfig, const PyConfig *config) +{ + _PyConfigInitEnum config_init = (_PyConfigInitEnum)config->_config_init; + switch (config_init) { + case _PyConfig_INIT_PYTHON: + PyPreConfig_InitPythonConfig(preconfig); + break; + case _PyConfig_INIT_ISOLATED: + PyPreConfig_InitIsolatedConfig(preconfig); + break; + case _PyConfig_INIT_COMPAT: + default: + _PyPreConfig_InitCompatConfig(preconfig); + } + + _PyPreConfig_GetConfig(preconfig, config); +} + + +static void +preconfig_copy(PyPreConfig *config, const PyPreConfig *config2) +{ +#define COPY_ATTR(ATTR) config->ATTR = config2->ATTR + + COPY_ATTR(_config_init); + COPY_ATTR(parse_argv); + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(configure_locale); + COPY_ATTR(dev_mode); + COPY_ATTR(coerce_c_locale); + COPY_ATTR(coerce_c_locale_warn); + COPY_ATTR(utf8_mode); + COPY_ATTR(allocator); +#ifdef MS_WINDOWS + COPY_ATTR(legacy_windows_fs_encoding); +#endif + +#undef COPY_ATTR +} + + +PyObject* +_PyPreConfig_AsDict(const PyPreConfig *config) +{ + PyObject *dict; + + dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + +#define SET_ITEM_INT(ATTR) \ + do { \ + PyObject *obj = PyLong_FromLong(config->ATTR); \ + if (obj == NULL) { \ + goto fail; \ + } \ + int res = PyDict_SetItemString(dict, #ATTR, obj); \ + Py_DECREF(obj); \ + if (res < 0) { \ + goto fail; \ + } \ + } while (0) + + SET_ITEM_INT(_config_init); + SET_ITEM_INT(parse_argv); + SET_ITEM_INT(isolated); + SET_ITEM_INT(use_environment); + SET_ITEM_INT(configure_locale); + SET_ITEM_INT(coerce_c_locale); + SET_ITEM_INT(coerce_c_locale_warn); + SET_ITEM_INT(utf8_mode); +#ifdef MS_WINDOWS + SET_ITEM_INT(legacy_windows_fs_encoding); +#endif + SET_ITEM_INT(dev_mode); + SET_ITEM_INT(allocator); + return dict; + +fail: + Py_DECREF(dict); + return NULL; + +#undef SET_ITEM_INT +} + + +void +_PyPreConfig_GetConfig(PyPreConfig *preconfig, const PyConfig *config) +{ +#define COPY_ATTR(ATTR) \ + if (config->ATTR != -1) { \ + preconfig->ATTR = config->ATTR; \ + } + + COPY_ATTR(parse_argv); + COPY_ATTR(isolated); + COPY_ATTR(use_environment); + COPY_ATTR(dev_mode); + +#undef COPY_ATTR +} + + +static void +preconfig_get_global_vars(PyPreConfig *config) +{ + if (config->_config_init != _PyConfig_INIT_COMPAT) { + /* Python and Isolated configuration ignore global variables */ + return; + } + +#define COPY_FLAG(ATTR, VALUE) \ + if (config->ATTR < 0) { \ + config->ATTR = VALUE; \ + } +#define COPY_NOT_FLAG(ATTR, VALUE) \ + if (config->ATTR < 0) { \ + config->ATTR = !(VALUE); \ + } + + COPY_FLAG(isolated, Py_IsolatedFlag); + COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); + if (Py_UTF8Mode > 0) { + config->utf8_mode = Py_UTF8Mode; + } +#ifdef MS_WINDOWS + COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag); +#endif + +#undef COPY_FLAG +#undef COPY_NOT_FLAG +} + + +static void +preconfig_set_global_vars(const PyPreConfig *config) +{ +#define COPY_FLAG(ATTR, VAR) \ + if (config->ATTR >= 0) { \ + VAR = config->ATTR; \ + } +#define COPY_NOT_FLAG(ATTR, VAR) \ + if (config->ATTR >= 0) { \ + VAR = !config->ATTR; \ + } + + COPY_FLAG(isolated, Py_IsolatedFlag); + COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); +#ifdef MS_WINDOWS + COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag); +#endif + COPY_FLAG(utf8_mode, Py_UTF8Mode); + +#undef COPY_FLAG +#undef COPY_NOT_FLAG +} + + +const char* +_Py_GetEnv(int use_environment, const char *name) +{ + assert(use_environment >= 0); + + if (!use_environment) { + return NULL; + } + + const char *var = getenv(name); + if (var && var[0] != '\0') { + return var; + } + else { + return NULL; + } +} + + +int +_Py_str_to_int(const char *str, int *result) +{ + const char *endptr = str; + errno = 0; + long value = strtol(str, (char **)&endptr, 10); + if (*endptr != '\0' || errno == ERANGE) { + return -1; + } + if (value < INT_MIN || value > INT_MAX) { + return -1; + } + + *result = (int)value; + return 0; +} + + +void +_Py_get_env_flag(int use_environment, int *flag, const char *name) +{ + const char *var = _Py_GetEnv(use_environment, name); + if (!var) { + return; + } + int value; + if (_Py_str_to_int(var, &value) < 0 || value < 0) { + /* PYTHONDEBUG=text and PYTHONDEBUG=-2 behave as PYTHONDEBUG=1 */ + value = 1; + } + if (*flag < value) { + *flag = value; + } +} + + +const wchar_t* +_Py_get_xoption(const PyWideStringList *xoptions, const wchar_t *name) +{ + for (Py_ssize_t i=0; i < xoptions->length; i++) { + const wchar_t *option = xoptions->items[i]; + size_t len; + wchar_t *sep = wcschr(option, L'='); + if (sep != NULL) { + len = (sep - option); + } + else { + len = wcslen(option); + } + if (wcsncmp(option, name, len) == 0 && name[len] == L'\0') { + return option; + } + } + return NULL; +} + + +static PyStatus +preconfig_init_utf8_mode(PyPreConfig *config, const _PyPreCmdline *cmdline) +{ +#ifdef MS_WINDOWS + if (config->legacy_windows_fs_encoding) { + config->utf8_mode = 0; + } +#endif + + if (config->utf8_mode >= 0) { + return _PyStatus_OK(); + } + + const wchar_t *xopt; + xopt = _Py_get_xoption(&cmdline->xoptions, L"utf8"); + if (xopt) { + wchar_t *sep = wcschr(xopt, L'='); + if (sep) { + xopt = sep + 1; + if (wcscmp(xopt, L"1") == 0) { + config->utf8_mode = 1; + } + else if (wcscmp(xopt, L"0") == 0) { + config->utf8_mode = 0; + } + else { + return _PyStatus_ERR("invalid -X utf8 option value"); + } + } + else { + config->utf8_mode = 1; + } + return _PyStatus_OK(); + } + + const char *opt = _Py_GetEnv(config->use_environment, "PYTHONUTF8"); + if (opt) { + if (strcmp(opt, "1") == 0) { + config->utf8_mode = 1; + } + else if (strcmp(opt, "0") == 0) { + config->utf8_mode = 0; + } + else { + return _PyStatus_ERR("invalid PYTHONUTF8 environment " + "variable value"); + } + return _PyStatus_OK(); + } + + +#ifndef MS_WINDOWS + if (config->utf8_mode < 0) { + /* The C locale and the POSIX locale enable the UTF-8 Mode (PEP 540) */ + const char *ctype_loc = setlocale(LC_CTYPE, NULL); + if (ctype_loc != NULL + && (strcmp(ctype_loc, "C") == 0 + || strcmp(ctype_loc, "POSIX") == 0)) + { + config->utf8_mode = 1; + } + } +#endif + + if (config->utf8_mode < 0) { + config->utf8_mode = 0; + } + return _PyStatus_OK(); +} + + +static void +preconfig_init_coerce_c_locale(PyPreConfig *config) +{ + if (!config->configure_locale) { + config->coerce_c_locale = 0; + config->coerce_c_locale_warn = 0; + return; + } + + const char *env = _Py_GetEnv(config->use_environment, "PYTHONCOERCECLOCALE"); + if (env) { + if (strcmp(env, "0") == 0) { + if (config->coerce_c_locale < 0) { + config->coerce_c_locale = 0; + } + } + else if (strcmp(env, "warn") == 0) { + if (config->coerce_c_locale_warn < 0) { + config->coerce_c_locale_warn = 1; + } + } + else { + if (config->coerce_c_locale < 0) { + config->coerce_c_locale = 1; + } + } + } + + /* Test if coerce_c_locale equals to -1 or equals to 1: + PYTHONCOERCECLOCALE=1 doesn't imply that the C locale is always coerced. + It is only coerced if if the LC_CTYPE locale is "C". */ + if (config->coerce_c_locale < 0 || config->coerce_c_locale == 1) { + /* The C locale enables the C locale coercion (PEP 538) */ + if (_Py_LegacyLocaleDetected(0)) { + config->coerce_c_locale = 2; + } + else { + config->coerce_c_locale = 0; + } + } + + if (config->coerce_c_locale_warn < 0) { + config->coerce_c_locale_warn = 0; + } +} + + +static PyStatus +preconfig_init_allocator(PyPreConfig *config) +{ + if (config->allocator == PYMEM_ALLOCATOR_NOT_SET) { + /* bpo-34247. The PYTHONMALLOC environment variable has the priority + over PYTHONDEV env var and "-X dev" command line option. + For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory + allocators to "malloc" (and not to "debug"). */ + const char *envvar = _Py_GetEnv(config->use_environment, "PYTHONMALLOC"); + if (envvar) { + PyMemAllocatorName name; + if (_PyMem_GetAllocatorName(envvar, &name) < 0) { + return _PyStatus_ERR("PYTHONMALLOC: unknown allocator"); + } + config->allocator = (int)name; + } + } + + if (config->dev_mode && config->allocator == PYMEM_ALLOCATOR_NOT_SET) { + config->allocator = PYMEM_ALLOCATOR_DEBUG; + } + return _PyStatus_OK(); +} + + +static PyStatus +preconfig_read(PyPreConfig *config, _PyPreCmdline *cmdline) +{ + PyStatus status; + + status = _PyPreCmdline_Read(cmdline, config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + precmdline_set_preconfig(cmdline, config); + + /* legacy_windows_fs_encoding, coerce_c_locale, utf8_mode */ +#ifdef MS_WINDOWS + _Py_get_env_flag(config->use_environment, + &config->legacy_windows_fs_encoding, + "PYTHONLEGACYWINDOWSFSENCODING"); +#endif + + preconfig_init_coerce_c_locale(config); + + status = preconfig_init_utf8_mode(config, cmdline); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* allocator */ + status = preconfig_init_allocator(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + assert(config->coerce_c_locale >= 0); + assert(config->coerce_c_locale_warn >= 0); +#ifdef MS_WINDOWS + assert(config->legacy_windows_fs_encoding >= 0); +#endif + assert(config->utf8_mode >= 0); + assert(config->isolated >= 0); + assert(config->use_environment >= 0); + assert(config->dev_mode >= 0); + + return _PyStatus_OK(); +} + + +/* Read the configuration from: + + - command line arguments + - environment variables + - Py_xxx global configuration variables + - the LC_CTYPE locale */ +PyStatus +_PyPreConfig_Read(PyPreConfig *config, const _PyArgv *args) +{ + PyStatus status; + + status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + preconfig_get_global_vars(config); + + /* Copy LC_CTYPE locale, since it's modified later */ + const char *loc = setlocale(LC_CTYPE, NULL); + if (loc == NULL) { + return _PyStatus_ERR("failed to LC_CTYPE locale"); + } + char *init_ctype_locale = _PyMem_RawStrdup(loc); + if (init_ctype_locale == NULL) { + return _PyStatus_NO_MEMORY(); + } + + /* Save the config to be able to restore it if encodings change */ + PyPreConfig save_config; + + status = _PyPreConfig_InitFromPreConfig(&save_config, config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* Set LC_CTYPE to the user preferred locale */ + if (config->configure_locale) { + _Py_SetLocaleFromEnv(LC_CTYPE); + } + + _PyPreCmdline cmdline = _PyPreCmdline_INIT; + int init_utf8_mode = Py_UTF8Mode; +#ifdef MS_WINDOWS + int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag; +#endif + + if (args) { + status = _PyPreCmdline_SetArgv(&cmdline, args); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + } + + int locale_coerced = 0; + int loops = 0; + + while (1) { + int utf8_mode = config->utf8_mode; + + /* Watchdog to prevent an infinite loop */ + loops++; + if (loops == 3) { + status = _PyStatus_ERR("Encoding changed twice while " + "reading the configuration"); + goto done; + } + + /* bpo-34207: Py_DecodeLocale() and Py_EncodeLocale() depend + on Py_UTF8Mode and Py_LegacyWindowsFSEncodingFlag. */ + Py_UTF8Mode = config->utf8_mode; +#ifdef MS_WINDOWS + Py_LegacyWindowsFSEncodingFlag = config->legacy_windows_fs_encoding; +#endif + + status = preconfig_read(config, &cmdline); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + /* The legacy C locale assumes ASCII as the default text encoding, which + * causes problems not only for the CPython runtime, but also other + * components like GNU readline. + * + * Accordingly, when the CLI detects it, it attempts to coerce it to a + * more capable UTF-8 based alternative. + * + * See the documentation of the PYTHONCOERCECLOCALE setting for more + * details. + */ + int encoding_changed = 0; + if (config->coerce_c_locale && !locale_coerced) { + locale_coerced = 1; + _Py_CoerceLegacyLocale(0); + encoding_changed = 1; + } + + if (utf8_mode == -1) { + if (config->utf8_mode == 1) { + /* UTF-8 Mode enabled */ + encoding_changed = 1; + } + } + else { + if (config->utf8_mode != utf8_mode) { + encoding_changed = 1; + } + } + + if (!encoding_changed) { + break; + } + + /* Reset the configuration before reading again the configuration, + just keep UTF-8 Mode value. */ + int new_utf8_mode = config->utf8_mode; + int new_coerce_c_locale = config->coerce_c_locale; + preconfig_copy(config, &save_config); + config->utf8_mode = new_utf8_mode; + config->coerce_c_locale = new_coerce_c_locale; + + /* The encoding changed: read again the configuration + with the new encoding */ + } + status = _PyStatus_OK(); + +done: + if (init_ctype_locale != NULL) { + setlocale(LC_CTYPE, init_ctype_locale); + PyMem_RawFree(init_ctype_locale); + } + Py_UTF8Mode = init_utf8_mode ; +#ifdef MS_WINDOWS + Py_LegacyWindowsFSEncodingFlag = init_legacy_encoding; +#endif + _PyPreCmdline_Clear(&cmdline); + return status; +} + + +/* Write the pre-configuration: + + - set the memory allocators + - set Py_xxx global configuration variables + - set the LC_CTYPE locale (coerce C locale, PEP 538) and set the UTF-8 mode + (PEP 540) + + The applied configuration is written into _PyRuntime.preconfig. + If the C locale cannot be coerced, set coerce_c_locale to 0. + + Do nothing if called after Py_Initialize(): ignore the new + pre-configuration. */ +PyStatus +_PyPreConfig_Write(const PyPreConfig *src_config) +{ + PyPreConfig config; + + PyStatus status = _PyPreConfig_InitFromPreConfig(&config, src_config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (_PyRuntime.core_initialized) { + /* bpo-34008: Calling this functions after Py_Initialize() ignores + the new configuration. */ + return _PyStatus_OK(); + } + + PyMemAllocatorName name = (PyMemAllocatorName)config.allocator; + if (name != PYMEM_ALLOCATOR_NOT_SET) { + if (_PyMem_SetupAllocators(name) < 0) { + return _PyStatus_ERR("Unknown PYTHONMALLOC allocator"); + } + } + + preconfig_set_global_vars(&config); + + if (config.configure_locale) { + if (config.coerce_c_locale) { + if (!_Py_CoerceLegacyLocale(config.coerce_c_locale_warn)) { + /* C locale not coerced */ + config.coerce_c_locale = 0; + } + } + + /* Set LC_CTYPE to the user preferred locale */ + _Py_SetLocaleFromEnv(LC_CTYPE); + } + + /* Write the new pre-configuration into _PyRuntime */ + preconfig_copy(&_PyRuntime.preconfig, &config); + + return _PyStatus_OK(); +} diff --git a/contrib/tools/python3/src/Python/pyarena.c b/contrib/tools/python3/src/Python/pyarena.c index 21b57c819d..aefb787e55 100644 --- a/contrib/tools/python3/src/Python/pyarena.c +++ b/contrib/tools/python3/src/Python/pyarena.c @@ -49,7 +49,7 @@ struct _arena { */ block *a_head; - /* Pointer to the block currently used for allocation. Its + /* Pointer to the block currently used for allocation. Its ab_next field should be NULL. If it is not-null after a call to block_alloc(), it means a new block has been allocated and a_cur should be reset to point it. @@ -57,7 +57,7 @@ struct _arena { block *a_cur; /* A Python list object containing references to all the PyObject - pointers associated with this arena. They will be DECREFed + pointers associated with this arena. They will be DECREFed when the arena is freed. */ PyObject *a_objects; @@ -160,7 +160,7 @@ PyArena_Free(PyArena *arena) #if defined(Py_DEBUG) /* fprintf(stderr, - "alloc=%zu size=%zu blocks=%zu block_size=%zu big=%zu objects=%zu\n", + "alloc=%zu size=%zu blocks=%zu block_size=%zu big=%zu objects=%zu\n", arena->total_allocs, arena->total_size, arena->total_blocks, arena->total_block_size, arena->total_big_blocks, PyList_Size(arena->a_objects)); diff --git a/contrib/tools/python3/src/Python/pyhash.c b/contrib/tools/python3/src/Python/pyhash.c index 674471aadd..3843079fbb 100644 --- a/contrib/tools/python3/src/Python/pyhash.c +++ b/contrib/tools/python3/src/Python/pyhash.c @@ -129,22 +129,22 @@ _Py_HashDouble(double v) } Py_hash_t -_Py_HashPointerRaw(const void *p) +_Py_HashPointerRaw(const void *p) { size_t y = (size_t)p; /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid excessive hash collisions for dicts and sets */ y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4)); - return (Py_hash_t)y; -} - -Py_hash_t -_Py_HashPointer(const void *p) -{ - Py_hash_t x = _Py_HashPointerRaw(p); - if (x == -1) { + return (Py_hash_t)y; +} + +Py_hash_t +_Py_HashPointer(const void *p) +{ + Py_hash_t x = _Py_HashPointerRaw(p); + if (x == -1) { x = -2; - } + } return x; } @@ -372,7 +372,7 @@ static PyHash_FuncDef PyHash_Func = {fnv, "fnv", 8 * SIZEOF_PY_HASH_T, static uint64_t siphash24(uint64_t k0, uint64_t k1, const void *src, Py_ssize_t src_sz) { uint64_t b = (uint64_t)src_sz << 56; - const uint8_t *in = (const uint8_t*)src; + const uint8_t *in = (const uint8_t*)src; uint64_t v0 = k0 ^ 0x736f6d6570736575ULL; uint64_t v1 = k1 ^ 0x646f72616e646f6dULL; @@ -426,13 +426,13 @@ _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz) #if Py_HASH_ALGORITHM == Py_HASH_SIPHASH24 -static Py_hash_t -pysiphash(const void *src, Py_ssize_t src_sz) { - return (Py_hash_t)siphash24( - _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1), - src, src_sz); -} - +static Py_hash_t +pysiphash(const void *src, Py_ssize_t src_sz) { + return (Py_hash_t)siphash24( + _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1), + src, src_sz); +} + static PyHash_FuncDef PyHash_Func = {pysiphash, "siphash24", 64, 128}; #endif diff --git a/contrib/tools/python3/src/Python/pylifecycle.c b/contrib/tools/python3/src/Python/pylifecycle.c index 8a348e9a63..7f591179ac 100644 --- a/contrib/tools/python3/src/Python/pylifecycle.c +++ b/contrib/tools/python3/src/Python/pylifecycle.c @@ -3,42 +3,42 @@ #include "Python.h" #include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ - -#include "pycore_ceval.h" // _PyEval_FiniGIL() -#include "pycore_context.h" // _PyContext_Init() -#include "pycore_fileutils.h" // _Py_ResetForceASCII() -#include "pycore_import.h" // _PyImport_Cleanup() -#include "pycore_initconfig.h" // _PyStatus_OK() -#include "pycore_object.h" // _PyDebug_PrintTotalRefs() -#include "pycore_pathconfig.h" // _PyConfig_WritePathConfig() -#include "pycore_pyerrors.h" // _PyErr_Occurred() -#include "pycore_pylifecycle.h" // _PyErr_Print() -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_sysmodule.h" // _PySys_ClearAuditHooks() -#include "pycore_traceback.h" // _Py_DumpTracebackThreads() - -#include "grammar.h" // PyGrammar_RemoveAccelerators() -#include <locale.h> // setlocale() - +#undef Yield /* undefine macro conflicting with <winbase.h> */ + +#include "pycore_ceval.h" // _PyEval_FiniGIL() +#include "pycore_context.h" // _PyContext_Init() +#include "pycore_fileutils.h" // _Py_ResetForceASCII() +#include "pycore_import.h" // _PyImport_Cleanup() +#include "pycore_initconfig.h" // _PyStatus_OK() +#include "pycore_object.h" // _PyDebug_PrintTotalRefs() +#include "pycore_pathconfig.h" // _PyConfig_WritePathConfig() +#include "pycore_pyerrors.h" // _PyErr_Occurred() +#include "pycore_pylifecycle.h" // _PyErr_Print() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_sysmodule.h" // _PySys_ClearAuditHooks() +#include "pycore_traceback.h" // _Py_DumpTracebackThreads() + +#include "grammar.h" // PyGrammar_RemoveAccelerators() +#include <locale.h> // setlocale() + #ifdef HAVE_SIGNAL_H -# include <signal.h> // SIG_IGN +# include <signal.h> // SIG_IGN #endif #ifdef HAVE_LANGINFO_H -# include <langinfo.h> // nl_langinfo(CODESET) +# include <langinfo.h> // nl_langinfo(CODESET) #endif #ifdef MS_WINDOWS -# undef BYTE -# include "windows.h" +# undef BYTE +# include "windows.h" - extern PyTypeObject PyWindowsConsoleIO_Type; -# define PyWindowsConsoleIO_Check(op) \ - (PyObject_TypeCheck((op), &PyWindowsConsoleIO_Type)) + extern PyTypeObject PyWindowsConsoleIO_Type; +# define PyWindowsConsoleIO_Check(op) \ + (PyObject_TypeCheck((op), &PyWindowsConsoleIO_Type)) #endif - + _Py_IDENTIFIER(flush); _Py_IDENTIFIER(name); _Py_IDENTIFIER(stdin); @@ -52,20 +52,20 @@ extern "C" { extern grammar _PyParser_Grammar; /* From graminit.c */ -/* Forward declarations */ -static PyStatus add_main_module(PyInterpreterState *interp); -static PyStatus init_import_site(void); -static PyStatus init_set_builtins_open(void); -static PyStatus init_sys_streams(PyThreadState *tstate); -static void call_py_exitfuncs(PyThreadState *tstate); -static void wait_for_thread_shutdown(PyThreadState *tstate); -static void call_ll_exitfuncs(_PyRuntimeState *runtime); +/* Forward declarations */ +static PyStatus add_main_module(PyInterpreterState *interp); +static PyStatus init_import_site(void); +static PyStatus init_set_builtins_open(void); +static PyStatus init_sys_streams(PyThreadState *tstate); +static void call_py_exitfuncs(PyThreadState *tstate); +static void wait_for_thread_shutdown(PyThreadState *tstate); +static void call_ll_exitfuncs(_PyRuntimeState *runtime); -int _Py_UnhandledKeyboardInterrupt = 0; +int _Py_UnhandledKeyboardInterrupt = 0; _PyRuntimeState _PyRuntime = _PyRuntimeState_INIT; -static int runtime_initialized = 0; +static int runtime_initialized = 0; -PyStatus +PyStatus _PyRuntime_Initialize(void) { /* XXX We only initialize once in the process, which aligns with @@ -74,10 +74,10 @@ _PyRuntime_Initialize(void) every Py_Initialize() call, but doing so breaks the runtime. This is because the runtime state is not properly finalized currently. */ - if (runtime_initialized) { - return _PyStatus_OK(); + if (runtime_initialized) { + return _PyStatus_OK(); } - runtime_initialized = 1; + runtime_initialized = 1; return _PyRuntimeState_Init(&_PyRuntime); } @@ -86,13 +86,13 @@ void _PyRuntime_Finalize(void) { _PyRuntimeState_Fini(&_PyRuntime); - runtime_initialized = 0; + runtime_initialized = 0; } int _Py_IsFinalizing(void) { - return _PyRuntimeState_GetFinalizing(&_PyRuntime) != NULL; + return _PyRuntimeState_GetFinalizing(&_PyRuntime) != NULL; } /* Hack to force loading of object files */ @@ -138,78 +138,78 @@ Py_IsInitialized(void) */ -static PyStatus -init_importlib(PyThreadState *tstate, PyObject *sysmod) +static PyStatus +init_importlib(PyThreadState *tstate, PyObject *sysmod) { PyObject *importlib; PyObject *impmod; PyObject *value; - PyInterpreterState *interp = tstate->interp; - int verbose = _PyInterpreterState_GetConfig(interp)->verbose; + PyInterpreterState *interp = tstate->interp; + int verbose = _PyInterpreterState_GetConfig(interp)->verbose; /* Import _importlib through its frozen version, _frozen_importlib. */ if (PyImport_ImportFrozenModule("_frozen_importlib") <= 0) { - return _PyStatus_ERR("can't import _frozen_importlib"); + return _PyStatus_ERR("can't import _frozen_importlib"); } - else if (verbose) { + else if (verbose) { PySys_FormatStderr("import _frozen_importlib # frozen\n"); } importlib = PyImport_AddModule("_frozen_importlib"); if (importlib == NULL) { - return _PyStatus_ERR("couldn't get _frozen_importlib from sys.modules"); + return _PyStatus_ERR("couldn't get _frozen_importlib from sys.modules"); } interp->importlib = importlib; Py_INCREF(interp->importlib); interp->import_func = PyDict_GetItemString(interp->builtins, "__import__"); if (interp->import_func == NULL) - return _PyStatus_ERR("__import__ not found"); + return _PyStatus_ERR("__import__ not found"); Py_INCREF(interp->import_func); /* Import the _imp module */ impmod = PyInit__imp(); if (impmod == NULL) { - return _PyStatus_ERR("can't import _imp"); + return _PyStatus_ERR("can't import _imp"); } - else if (verbose) { + else if (verbose) { PySys_FormatStderr("import _imp # builtin\n"); } if (_PyImport_SetModuleString("_imp", impmod) < 0) { - return _PyStatus_ERR("can't save _imp to sys.modules"); + return _PyStatus_ERR("can't save _imp to sys.modules"); } /* Install importlib as the implementation of import */ value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod); if (value == NULL) { - _PyErr_Print(tstate); - return _PyStatus_ERR("importlib install failed"); + _PyErr_Print(tstate); + return _PyStatus_ERR("importlib install failed"); } Py_DECREF(value); Py_DECREF(impmod); - return _PyStatus_OK(); + return _PyStatus_OK(); } -static PyStatus -init_importlib_external(PyThreadState *tstate) +static PyStatus +init_importlib_external(PyThreadState *tstate) { PyObject *value; - value = PyObject_CallMethod(tstate->interp->importlib, + value = PyObject_CallMethod(tstate->interp->importlib, "_install_external_importers", ""); if (value == NULL) { - _PyErr_Print(tstate); - return _PyStatus_ERR("external importer setup failed"); + _PyErr_Print(tstate); + return _PyStatus_ERR("external importer setup failed"); } Py_DECREF(value); value = PyImport_ImportModule("__res"); if (value == NULL) { PyErr_Print(); - return _PyStatus_ERR("can't import __res"); + return _PyStatus_ERR("can't import __res"); } Py_DECREF(value); - return _PyImportZip_Init(tstate); + return _PyImportZip_Init(tstate); } /* Helper functions to better handle the legacy C locale @@ -233,18 +233,18 @@ init_importlib_external(PyThreadState *tstate) */ int -_Py_LegacyLocaleDetected(int warn) +_Py_LegacyLocaleDetected(int warn) { #ifndef MS_WINDOWS - if (!warn) { - const char *locale_override = getenv("LC_ALL"); - if (locale_override != NULL && *locale_override != '\0') { - /* Don't coerce C locale if the LC_ALL environment variable - is set */ - return 0; - } - } - + if (!warn) { + const char *locale_override = getenv("LC_ALL"); + if (locale_override != NULL && *locale_override != '\0') { + /* Don't coerce C locale if the LC_ALL environment variable + is set */ + return 0; + } + } + /* On non-Windows systems, the C locale is considered a legacy locale */ /* XXX (ncoghlan): some platforms (notably Mac OS X) don't appear to treat * the POSIX locale as a simple alias for the C locale, so @@ -258,7 +258,7 @@ _Py_LegacyLocaleDetected(int warn) #endif } -#ifndef MS_WINDOWS +#ifndef MS_WINDOWS static const char *_C_LOCALE_WARNING = "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " @@ -266,14 +266,14 @@ static const char *_C_LOCALE_WARNING = "locales is recommended.\n"; static void -emit_stderr_warning_for_legacy_locale(_PyRuntimeState *runtime) +emit_stderr_warning_for_legacy_locale(_PyRuntimeState *runtime) { - const PyPreConfig *preconfig = &runtime->preconfig; - if (preconfig->coerce_c_locale_warn && _Py_LegacyLocaleDetected(1)) { - PySys_FormatStderr("%s", _C_LOCALE_WARNING); + const PyPreConfig *preconfig = &runtime->preconfig; + if (preconfig->coerce_c_locale_warn && _Py_LegacyLocaleDetected(1)) { + PySys_FormatStderr("%s", _C_LOCALE_WARNING); } } -#endif /* !defined(MS_WINDOWS) */ +#endif /* !defined(MS_WINDOWS) */ typedef struct _CandidateLocale { const char *locale_name; /* The locale to try as a coercion target */ @@ -286,18 +286,18 @@ static _LocaleCoercionTarget _TARGET_LOCALES[] = { {NULL} }; - -int -_Py_IsLocaleCoercionTarget(const char *ctype_loc) + +int +_Py_IsLocaleCoercionTarget(const char *ctype_loc) { - const _LocaleCoercionTarget *target = NULL; - for (target = _TARGET_LOCALES; target->locale_name; target++) { - if (strcmp(ctype_loc, target->locale_name) == 0) { - return 1; + const _LocaleCoercionTarget *target = NULL; + for (target = _TARGET_LOCALES; target->locale_name; target++) { + if (strcmp(ctype_loc, target->locale_name) == 0) { + return 1; } - } - return 0; -} + } + return 0; +} #ifdef PY_COERCE_C_LOCALE @@ -305,8 +305,8 @@ static const char C_LOCALE_COERCION_WARNING[] = "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale " "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; -static int -_coerce_default_locale_settings(int warn, const _LocaleCoercionTarget *target) +static int +_coerce_default_locale_settings(int warn, const _LocaleCoercionTarget *target) { const char *newloc = target->locale_name; @@ -317,28 +317,28 @@ _coerce_default_locale_settings(int warn, const _LocaleCoercionTarget *target) if (setenv("LC_CTYPE", newloc, 1)) { fprintf(stderr, "Error setting LC_CTYPE, skipping C locale coercion\n"); - return 0; + return 0; } - if (warn) { + if (warn) { fprintf(stderr, C_LOCALE_COERCION_WARNING, newloc); } /* Reconfigure with the overridden environment variables */ _Py_SetLocaleFromEnv(LC_ALL); - return 1; + return 1; } #endif -int -_Py_CoerceLegacyLocale(int warn) +int +_Py_CoerceLegacyLocale(int warn) { - int coerced = 0; + int coerced = 0; #ifdef PY_COERCE_C_LOCALE char *oldloc = NULL; oldloc = _PyMem_RawStrdup(setlocale(LC_CTYPE, NULL)); if (oldloc == NULL) { - return coerced; + return coerced; } const char *locale_override = getenv("LC_ALL"); @@ -349,7 +349,7 @@ _Py_CoerceLegacyLocale(int warn) const char *new_locale = setlocale(LC_CTYPE, target->locale_name); if (new_locale != NULL) { -#if !defined(_Py_FORCE_UTF8_LOCALE) && defined(HAVE_LANGINFO_H) && defined(CODESET) +#if !defined(_Py_FORCE_UTF8_LOCALE) && defined(HAVE_LANGINFO_H) && defined(CODESET) /* Also ensure that nl_langinfo works in this locale */ char *codeset = nl_langinfo(CODESET); if (!codeset || *codeset == '\0') { @@ -360,7 +360,7 @@ _Py_CoerceLegacyLocale(int warn) } #endif /* Successfully configured locale, so make it the default */ - coerced = _coerce_default_locale_settings(warn, target); + coerced = _coerce_default_locale_settings(warn, target); goto done; } } @@ -372,7 +372,7 @@ _Py_CoerceLegacyLocale(int warn) done: PyMem_RawFree(oldloc); #endif - return coerced; + return coerced; } /* _Py_SetLocaleFromEnv() is a wrapper around setlocale(category, "") to @@ -441,7 +441,7 @@ _Py_SetLocaleFromEnv(int category) /* Global initializations. Can be undone by Py_Finalize(). Don't call this twice without an intervening Py_Finalize() call. - Every call to Py_InitializeFromConfig, Py_Initialize or Py_InitializeEx + Every call to Py_InitializeFromConfig, Py_Initialize or Py_InitializeEx must have a corresponding call to Py_Finalize. Locking: you must hold the interpreter lock while calling these APIs. @@ -450,56 +450,56 @@ _Py_SetLocaleFromEnv(int category) */ -static PyStatus -pyinit_core_reconfigure(_PyRuntimeState *runtime, - PyThreadState **tstate_p, - const PyConfig *config) +static PyStatus +pyinit_core_reconfigure(_PyRuntimeState *runtime, + PyThreadState **tstate_p, + const PyConfig *config) { - PyStatus status; - PyThreadState *tstate = _PyThreadState_GET(); - if (!tstate) { - return _PyStatus_ERR("failed to read thread state"); + PyStatus status; + PyThreadState *tstate = _PyThreadState_GET(); + if (!tstate) { + return _PyStatus_ERR("failed to read thread state"); } - *tstate_p = tstate; + *tstate_p = tstate; - PyInterpreterState *interp = tstate->interp; - if (interp == NULL) { - return _PyStatus_ERR("can't make main interpreter"); + PyInterpreterState *interp = tstate->interp; + if (interp == NULL) { + return _PyStatus_ERR("can't make main interpreter"); } - status = _PyConfig_Write(config, runtime); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + status = _PyConfig_Write(config, runtime); + if (_PyStatus_EXCEPTION(status)) { + return status; + } - status = _PyInterpreterState_SetConfig(interp, config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - config = _PyInterpreterState_GetConfig(interp); + status = _PyInterpreterState_SetConfig(interp, config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + config = _PyInterpreterState_GetConfig(interp); - if (config->_install_importlib) { - status = _PyConfig_WritePathConfig(config); - if (_PyStatus_EXCEPTION(status)) { - return status; + if (config->_install_importlib) { + status = _PyConfig_WritePathConfig(config); + if (_PyStatus_EXCEPTION(status)) { + return status; } } - return _PyStatus_OK(); -} + return _PyStatus_OK(); +} -static PyStatus -pycore_init_runtime(_PyRuntimeState *runtime, - const PyConfig *config) -{ - if (runtime->initialized) { - return _PyStatus_ERR("main interpreter already initialized"); +static PyStatus +pycore_init_runtime(_PyRuntimeState *runtime, + const PyConfig *config) +{ + if (runtime->initialized) { + return _PyStatus_ERR("main interpreter already initialized"); } - PyStatus status = _PyConfig_Write(config, runtime); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + PyStatus status = _PyConfig_Write(config, runtime); + if (_PyStatus_EXCEPTION(status)) { + return status; + } /* Py_Finalize leaves _Py_Finalizing set in order to help daemon * threads behave a little more gracefully at interpreter shutdown. @@ -510,676 +510,676 @@ pycore_init_runtime(_PyRuntimeState *runtime, * threads still hanging around from a previous Py_Initialize/Finalize * pair :( */ - _PyRuntimeState_SetFinalizing(runtime, NULL); - - status = _Py_HashRandomization_Init(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - status = _PyInterpreterState_Enable(runtime); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); -} - - -static PyStatus -init_interp_create_gil(PyThreadState *tstate) -{ - PyStatus status; - - /* finalize_interp_delete() comment explains why _PyEval_FiniGIL() is - only called here. */ - _PyEval_FiniGIL(tstate); - - /* Auto-thread-state API */ - status = _PyGILState_Init(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* Create the GIL and take it */ - status = _PyEval_InitGIL(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - return _PyStatus_OK(); -} - - -static PyStatus -pycore_create_interpreter(_PyRuntimeState *runtime, - const PyConfig *config, - PyThreadState **tstate_p) -{ - PyInterpreterState *interp = PyInterpreterState_New(); + _PyRuntimeState_SetFinalizing(runtime, NULL); + + status = _Py_HashRandomization_Init(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = _PyInterpreterState_Enable(runtime); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); +} + + +static PyStatus +init_interp_create_gil(PyThreadState *tstate) +{ + PyStatus status; + + /* finalize_interp_delete() comment explains why _PyEval_FiniGIL() is + only called here. */ + _PyEval_FiniGIL(tstate); + + /* Auto-thread-state API */ + status = _PyGILState_Init(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* Create the GIL and take it */ + status = _PyEval_InitGIL(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + return _PyStatus_OK(); +} + + +static PyStatus +pycore_create_interpreter(_PyRuntimeState *runtime, + const PyConfig *config, + PyThreadState **tstate_p) +{ + PyInterpreterState *interp = PyInterpreterState_New(); if (interp == NULL) { - return _PyStatus_ERR("can't make main interpreter"); + return _PyStatus_ERR("can't make main interpreter"); } - PyStatus status = _PyInterpreterState_SetConfig(interp, config); - if (_PyStatus_EXCEPTION(status)) { - return status; + PyStatus status = _PyInterpreterState_SetConfig(interp, config); + if (_PyStatus_EXCEPTION(status)) { + return status; } PyThreadState *tstate = PyThreadState_New(interp); - if (tstate == NULL) { - return _PyStatus_ERR("can't make first thread"); - } + if (tstate == NULL) { + return _PyStatus_ERR("can't make first thread"); + } (void) PyThreadState_Swap(tstate); - status = init_interp_create_gil(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - *tstate_p = tstate; - return _PyStatus_OK(); -} - - -static PyStatus -pycore_init_types(PyThreadState *tstate) -{ - PyStatus status; - int is_main_interp = _Py_IsMainInterpreter(tstate); - - status = _PyGC_Init(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (is_main_interp) { - status = _PyTypes_Init(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - - if (!_PyLong_Init(tstate)) { - return _PyStatus_ERR("can't init longs"); - } - - if (is_main_interp) { - status = _PyUnicode_Init(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - status = _PyExc_Init(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (is_main_interp) { - if (!_PyFloat_Init()) { - return _PyStatus_ERR("can't init float"); - } - - if (_PyStructSequence_Init() < 0) { - return _PyStatus_ERR("can't initialize structseq"); - } - } - - status = _PyErr_Init(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (is_main_interp) { - if (!_PyContext_Init()) { - return _PyStatus_ERR("can't init context"); - } - } - - return _PyStatus_OK(); -} - - -static PyStatus -pycore_init_builtins(PyThreadState *tstate) -{ - assert(!_PyErr_Occurred(tstate)); - - PyObject *bimod = _PyBuiltin_Init(tstate); - if (bimod == NULL) { - goto error; - } - - PyInterpreterState *interp = tstate->interp; - if (_PyImport_FixupBuiltin(bimod, "builtins", interp->modules) < 0) { - goto error; - } - - PyObject *builtins_dict = PyModule_GetDict(bimod); - if (builtins_dict == NULL) { - goto error; - } - Py_INCREF(builtins_dict); - interp->builtins = builtins_dict; - - PyStatus status = _PyBuiltins_AddExceptions(bimod); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - interp->builtins_copy = PyDict_Copy(interp->builtins); - if (interp->builtins_copy == NULL) { - goto error; - } - Py_DECREF(bimod); - - assert(!_PyErr_Occurred(tstate)); - - return _PyStatus_OK(); - -error: - Py_XDECREF(bimod); - return _PyStatus_ERR("can't initialize builtins module"); -} - - -static PyStatus -pycore_init_import_warnings(PyThreadState *tstate, PyObject *sysmod) -{ - assert(!_PyErr_Occurred(tstate)); - - PyStatus status = _PyImportHooks_Init(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - if (_Py_IsMainInterpreter(tstate)) { - /* Initialize _warnings. */ - status = _PyWarnings_InitState(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (config->_install_importlib) { - status = _PyConfig_WritePathConfig(config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - } + status = init_interp_create_gil(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + *tstate_p = tstate; + return _PyStatus_OK(); +} + + +static PyStatus +pycore_init_types(PyThreadState *tstate) +{ + PyStatus status; + int is_main_interp = _Py_IsMainInterpreter(tstate); + + status = _PyGC_Init(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (is_main_interp) { + status = _PyTypes_Init(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + + if (!_PyLong_Init(tstate)) { + return _PyStatus_ERR("can't init longs"); + } + + if (is_main_interp) { + status = _PyUnicode_Init(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + status = _PyExc_Init(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (is_main_interp) { + if (!_PyFloat_Init()) { + return _PyStatus_ERR("can't init float"); + } + + if (_PyStructSequence_Init() < 0) { + return _PyStatus_ERR("can't initialize structseq"); + } + } + + status = _PyErr_Init(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (is_main_interp) { + if (!_PyContext_Init()) { + return _PyStatus_ERR("can't init context"); + } + } + + return _PyStatus_OK(); +} + + +static PyStatus +pycore_init_builtins(PyThreadState *tstate) +{ + assert(!_PyErr_Occurred(tstate)); + + PyObject *bimod = _PyBuiltin_Init(tstate); + if (bimod == NULL) { + goto error; + } + + PyInterpreterState *interp = tstate->interp; + if (_PyImport_FixupBuiltin(bimod, "builtins", interp->modules) < 0) { + goto error; + } + + PyObject *builtins_dict = PyModule_GetDict(bimod); + if (builtins_dict == NULL) { + goto error; + } + Py_INCREF(builtins_dict); + interp->builtins = builtins_dict; + + PyStatus status = _PyBuiltins_AddExceptions(bimod); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + interp->builtins_copy = PyDict_Copy(interp->builtins); + if (interp->builtins_copy == NULL) { + goto error; + } + Py_DECREF(bimod); + + assert(!_PyErr_Occurred(tstate)); + + return _PyStatus_OK(); + +error: + Py_XDECREF(bimod); + return _PyStatus_ERR("can't initialize builtins module"); +} + + +static PyStatus +pycore_init_import_warnings(PyThreadState *tstate, PyObject *sysmod) +{ + assert(!_PyErr_Occurred(tstate)); + + PyStatus status = _PyImportHooks_Init(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + if (_Py_IsMainInterpreter(tstate)) { + /* Initialize _warnings. */ + status = _PyWarnings_InitState(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (config->_install_importlib) { + status = _PyConfig_WritePathConfig(config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + } /* This call sets up builtin and frozen import support */ - if (config->_install_importlib) { - status = init_importlib(tstate, sysmod); - if (_PyStatus_EXCEPTION(status)) { - return status; + if (config->_install_importlib) { + status = init_importlib(tstate, sysmod); + if (_PyStatus_EXCEPTION(status)) { + return status; } } - - assert(!_PyErr_Occurred(tstate)); - - return _PyStatus_OK(); -} - - -static PyStatus -pycore_interp_init(PyThreadState *tstate) -{ - PyStatus status; - PyObject *sysmod = NULL; - - status = pycore_init_types(tstate); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = _PySys_Create(tstate, &sysmod); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = pycore_init_builtins(tstate); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - status = pycore_init_import_warnings(tstate, sysmod); - -done: - /* sys.modules['sys'] contains a strong reference to the module */ - Py_XDECREF(sysmod); - return status; -} - - -static PyStatus -pyinit_config(_PyRuntimeState *runtime, - PyThreadState **tstate_p, - const PyConfig *config) -{ - PyStatus status = pycore_init_runtime(runtime, config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - PyThreadState *tstate; - status = pycore_create_interpreter(runtime, config, &tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - *tstate_p = tstate; - - status = pycore_interp_init(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - + + assert(!_PyErr_Occurred(tstate)); + + return _PyStatus_OK(); +} + + +static PyStatus +pycore_interp_init(PyThreadState *tstate) +{ + PyStatus status; + PyObject *sysmod = NULL; + + status = pycore_init_types(tstate); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = _PySys_Create(tstate, &sysmod); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = pycore_init_builtins(tstate); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = pycore_init_import_warnings(tstate, sysmod); + +done: + /* sys.modules['sys'] contains a strong reference to the module */ + Py_XDECREF(sysmod); + return status; +} + + +static PyStatus +pyinit_config(_PyRuntimeState *runtime, + PyThreadState **tstate_p, + const PyConfig *config) +{ + PyStatus status = pycore_init_runtime(runtime, config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + PyThreadState *tstate; + status = pycore_create_interpreter(runtime, config, &tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + *tstate_p = tstate; + + status = pycore_interp_init(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + /* Only when we get here is the runtime core fully initialized */ - runtime->core_initialized = 1; - return _PyStatus_OK(); -} - - -PyStatus -_Py_PreInitializeFromPyArgv(const PyPreConfig *src_config, const _PyArgv *args) -{ - PyStatus status; - - if (src_config == NULL) { - return _PyStatus_ERR("preinitialization config is NULL"); - } - - status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - _PyRuntimeState *runtime = &_PyRuntime; - - if (runtime->preinitialized) { - /* If it's already configured: ignored the new configuration */ - return _PyStatus_OK(); - } - - /* Note: preinitialized remains 1 on error, it is only set to 0 - at exit on success. */ - runtime->preinitializing = 1; - - PyPreConfig config; - - status = _PyPreConfig_InitFromPreConfig(&config, src_config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - status = _PyPreConfig_Read(&config, args); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - status = _PyPreConfig_Write(&config); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - runtime->preinitializing = 0; - runtime->preinitialized = 1; - return _PyStatus_OK(); -} - - -PyStatus -Py_PreInitializeFromBytesArgs(const PyPreConfig *src_config, Py_ssize_t argc, char **argv) -{ - _PyArgv args = {.use_bytes_argv = 1, .argc = argc, .bytes_argv = argv}; - return _Py_PreInitializeFromPyArgv(src_config, &args); -} - - -PyStatus -Py_PreInitializeFromArgs(const PyPreConfig *src_config, Py_ssize_t argc, wchar_t **argv) -{ - _PyArgv args = {.use_bytes_argv = 0, .argc = argc, .wchar_argv = argv}; - return _Py_PreInitializeFromPyArgv(src_config, &args); -} - - -PyStatus -Py_PreInitialize(const PyPreConfig *src_config) -{ - return _Py_PreInitializeFromPyArgv(src_config, NULL); -} - - -PyStatus -_Py_PreInitializeFromConfig(const PyConfig *config, - const _PyArgv *args) -{ - assert(config != NULL); - - PyStatus status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - _PyRuntimeState *runtime = &_PyRuntime; - - if (runtime->preinitialized) { - /* Already initialized: do nothing */ - return _PyStatus_OK(); - } - - PyPreConfig preconfig; - - _PyPreConfig_InitFromConfig(&preconfig, config); - - if (!config->parse_argv) { - return Py_PreInitialize(&preconfig); - } - else if (args == NULL) { - _PyArgv config_args = { - .use_bytes_argv = 0, - .argc = config->argv.length, - .wchar_argv = config->argv.items}; - return _Py_PreInitializeFromPyArgv(&preconfig, &config_args); - } + runtime->core_initialized = 1; + return _PyStatus_OK(); +} + + +PyStatus +_Py_PreInitializeFromPyArgv(const PyPreConfig *src_config, const _PyArgv *args) +{ + PyStatus status; + + if (src_config == NULL) { + return _PyStatus_ERR("preinitialization config is NULL"); + } + + status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + _PyRuntimeState *runtime = &_PyRuntime; + + if (runtime->preinitialized) { + /* If it's already configured: ignored the new configuration */ + return _PyStatus_OK(); + } + + /* Note: preinitialized remains 1 on error, it is only set to 0 + at exit on success. */ + runtime->preinitializing = 1; + + PyPreConfig config; + + status = _PyPreConfig_InitFromPreConfig(&config, src_config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = _PyPreConfig_Read(&config, args); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = _PyPreConfig_Write(&config); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + runtime->preinitializing = 0; + runtime->preinitialized = 1; + return _PyStatus_OK(); +} + + +PyStatus +Py_PreInitializeFromBytesArgs(const PyPreConfig *src_config, Py_ssize_t argc, char **argv) +{ + _PyArgv args = {.use_bytes_argv = 1, .argc = argc, .bytes_argv = argv}; + return _Py_PreInitializeFromPyArgv(src_config, &args); +} + + +PyStatus +Py_PreInitializeFromArgs(const PyPreConfig *src_config, Py_ssize_t argc, wchar_t **argv) +{ + _PyArgv args = {.use_bytes_argv = 0, .argc = argc, .wchar_argv = argv}; + return _Py_PreInitializeFromPyArgv(src_config, &args); +} + + +PyStatus +Py_PreInitialize(const PyPreConfig *src_config) +{ + return _Py_PreInitializeFromPyArgv(src_config, NULL); +} + + +PyStatus +_Py_PreInitializeFromConfig(const PyConfig *config, + const _PyArgv *args) +{ + assert(config != NULL); + + PyStatus status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + _PyRuntimeState *runtime = &_PyRuntime; + + if (runtime->preinitialized) { + /* Already initialized: do nothing */ + return _PyStatus_OK(); + } + + PyPreConfig preconfig; + + _PyPreConfig_InitFromConfig(&preconfig, config); + + if (!config->parse_argv) { + return Py_PreInitialize(&preconfig); + } + else if (args == NULL) { + _PyArgv config_args = { + .use_bytes_argv = 0, + .argc = config->argv.length, + .wchar_argv = config->argv.items}; + return _Py_PreInitializeFromPyArgv(&preconfig, &config_args); + } else { - return _Py_PreInitializeFromPyArgv(&preconfig, args); - } -} - - -/* Begin interpreter initialization - * - * On return, the first thread and interpreter state have been created, - * but the compiler, signal handling, multithreading and - * multiple interpreter support, and codec infrastructure are not yet - * available. - * - * The import system will support builtin and frozen modules only. - * The only supported io is writing to sys.stderr - * - * If any operation invoked by this function fails, a fatal error is - * issued and the function does not return. - * - * Any code invoked from this function should *not* assume it has access - * to the Python C API (unless the API is explicitly listed as being - * safe to call without calling Py_Initialize first) - */ -static PyStatus -pyinit_core(_PyRuntimeState *runtime, - const PyConfig *src_config, - PyThreadState **tstate_p) -{ - PyStatus status; - - status = _Py_PreInitializeFromConfig(src_config, NULL); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - PyConfig config; - _PyConfig_InitCompatConfig(&config); - - status = _PyConfig_Copy(&config, src_config); - if (_PyStatus_EXCEPTION(status)) { + return _Py_PreInitializeFromPyArgv(&preconfig, args); + } +} + + +/* Begin interpreter initialization + * + * On return, the first thread and interpreter state have been created, + * but the compiler, signal handling, multithreading and + * multiple interpreter support, and codec infrastructure are not yet + * available. + * + * The import system will support builtin and frozen modules only. + * The only supported io is writing to sys.stderr + * + * If any operation invoked by this function fails, a fatal error is + * issued and the function does not return. + * + * Any code invoked from this function should *not* assume it has access + * to the Python C API (unless the API is explicitly listed as being + * safe to call without calling Py_Initialize first) + */ +static PyStatus +pyinit_core(_PyRuntimeState *runtime, + const PyConfig *src_config, + PyThreadState **tstate_p) +{ + PyStatus status; + + status = _Py_PreInitializeFromConfig(src_config, NULL); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + PyConfig config; + _PyConfig_InitCompatConfig(&config); + + status = _PyConfig_Copy(&config, src_config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + status = PyConfig_Read(&config); + if (_PyStatus_EXCEPTION(status)) { + goto done; + } + + if (!runtime->core_initialized) { + status = pyinit_config(runtime, tstate_p, &config); + } + else { + status = pyinit_core_reconfigure(runtime, tstate_p, &config); + } + if (_PyStatus_EXCEPTION(status)) { goto done; } - status = PyConfig_Read(&config); - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - - if (!runtime->core_initialized) { - status = pyinit_config(runtime, tstate_p, &config); - } - else { - status = pyinit_core_reconfigure(runtime, tstate_p, &config); - } - if (_PyStatus_EXCEPTION(status)) { - goto done; - } - done: - PyConfig_Clear(&config); - return status; + PyConfig_Clear(&config); + return status; } - + /* Py_Initialize() has already been called: update the main interpreter configuration. Example of bpo-34008: Py_Main() called after Py_Initialize(). */ -static PyStatus -_Py_ReconfigureMainInterpreter(PyThreadState *tstate) +static PyStatus +_Py_ReconfigureMainInterpreter(PyThreadState *tstate) { - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - - PyObject *argv = _PyWideStringList_AsList(&config->argv); - if (argv == NULL) { - return _PyStatus_NO_MEMORY(); \ + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + + PyObject *argv = _PyWideStringList_AsList(&config->argv); + if (argv == NULL) { + return _PyStatus_NO_MEMORY(); \ + } + + int res = PyDict_SetItemString(tstate->interp->sysdict, "argv", argv); + Py_DECREF(argv); + if (res < 0) { + return _PyStatus_ERR("fail to set sys.argv"); } - - int res = PyDict_SetItemString(tstate->interp->sysdict, "argv", argv); - Py_DECREF(argv); - if (res < 0) { - return _PyStatus_ERR("fail to set sys.argv"); - } - return _PyStatus_OK(); + return _PyStatus_OK(); } - -static PyStatus -init_interp_main(PyThreadState *tstate) + +static PyStatus +init_interp_main(PyThreadState *tstate) { - assert(!_PyErr_Occurred(tstate)); + assert(!_PyErr_Occurred(tstate)); - PyStatus status; - int is_main_interp = _Py_IsMainInterpreter(tstate); - PyInterpreterState *interp = tstate->interp; - const PyConfig *config = _PyInterpreterState_GetConfig(interp); + PyStatus status; + int is_main_interp = _Py_IsMainInterpreter(tstate); + PyInterpreterState *interp = tstate->interp; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); - if (!config->_install_importlib) { + if (!config->_install_importlib) { /* Special mode for freeze_importlib: run with no import system * * This means anything which needs support from extension modules * or pure Python code in the standard library won't work. */ - if (is_main_interp) { - interp->runtime->initialized = 1; - } - return _PyStatus_OK(); + if (is_main_interp) { + interp->runtime->initialized = 1; + } + return _PyStatus_OK(); } - if (is_main_interp) { - if (_PyTime_Init() < 0) { - return _PyStatus_ERR("can't initialize time"); - } + if (is_main_interp) { + if (_PyTime_Init() < 0) { + return _PyStatus_ERR("can't initialize time"); + } } - if (_PySys_InitMain(tstate) < 0) { - return _PyStatus_ERR("can't finish initializing sys"); + if (_PySys_InitMain(tstate) < 0) { + return _PyStatus_ERR("can't finish initializing sys"); } - status = init_importlib_external(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; + status = init_importlib_external(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; } - if (is_main_interp) { - /* initialize the faulthandler module */ - status = _PyFaulthandler_Init(config->faulthandler); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + if (is_main_interp) { + /* initialize the faulthandler module */ + status = _PyFaulthandler_Init(config->faulthandler); + if (_PyStatus_EXCEPTION(status)) { + return status; + } } - status = _PyUnicode_InitEncodings(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; + status = _PyUnicode_InitEncodings(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; } - if (is_main_interp) { - if (_PySignal_Init(config->install_signal_handlers) < 0) { - return _PyStatus_ERR("can't initialize signals"); - } - - if (_PyTraceMalloc_Init(config->tracemalloc) < 0) { - return _PyStatus_ERR("can't initialize tracemalloc"); - } + if (is_main_interp) { + if (_PySignal_Init(config->install_signal_handlers) < 0) { + return _PyStatus_ERR("can't initialize signals"); + } + + if (_PyTraceMalloc_Init(config->tracemalloc) < 0) { + return _PyStatus_ERR("can't initialize tracemalloc"); + } } - status = init_sys_streams(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + status = init_sys_streams(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } - status = init_set_builtins_open(); - if (_PyStatus_EXCEPTION(status)) { - return status; + status = init_set_builtins_open(); + if (_PyStatus_EXCEPTION(status)) { + return status; } - status = add_main_module(interp); - if (_PyStatus_EXCEPTION(status)) { - return status; + status = add_main_module(interp); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (is_main_interp) { + /* Initialize warnings. */ + PyObject *warnoptions = PySys_GetObject("warnoptions"); + if (warnoptions != NULL && PyList_Size(warnoptions) > 0) + { + PyObject *warnings_module = PyImport_ImportModule("warnings"); + if (warnings_module == NULL) { + fprintf(stderr, "'import warnings' failed; traceback:\n"); + _PyErr_Print(tstate); + } + Py_XDECREF(warnings_module); + } + + interp->runtime->initialized = 1; } - if (is_main_interp) { - /* Initialize warnings. */ - PyObject *warnoptions = PySys_GetObject("warnoptions"); - if (warnoptions != NULL && PyList_Size(warnoptions) > 0) - { - PyObject *warnings_module = PyImport_ImportModule("warnings"); - if (warnings_module == NULL) { - fprintf(stderr, "'import warnings' failed; traceback:\n"); - _PyErr_Print(tstate); - } - Py_XDECREF(warnings_module); + if (config->site_import) { + status = init_import_site(); + if (_PyStatus_EXCEPTION(status)) { + return status; } - - interp->runtime->initialized = 1; } - if (config->site_import) { - status = init_import_site(); - if (_PyStatus_EXCEPTION(status)) { - return status; + if (is_main_interp) { +#ifndef MS_WINDOWS + emit_stderr_warning_for_legacy_locale(interp->runtime); +#endif + } + + assert(!_PyErr_Occurred(tstate)); + + return _PyStatus_OK(); +} + + +/* Update interpreter state based on supplied configuration settings + * + * After calling this function, most of the restrictions on the interpreter + * are lifted. The only remaining incomplete settings are those related + * to the main module (sys.argv[0], __main__ metadata) + * + * Calling this when the interpreter is not initializing, is already + * initialized or without a valid current thread state is a fatal error. + * Other errors should be reported as normal Python exceptions with a + * non-zero return code. + */ +static PyStatus +pyinit_main(PyThreadState *tstate) +{ + PyInterpreterState *interp = tstate->interp; + if (!interp->runtime->core_initialized) { + return _PyStatus_ERR("runtime core not initialized"); + } + + if (interp->runtime->initialized) { + return _Py_ReconfigureMainInterpreter(tstate); + } + + PyStatus status = init_interp_main(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + return _PyStatus_OK(); +} + + +PyStatus +_Py_InitializeMain(void) +{ + PyStatus status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + return pyinit_main(tstate); +} + + +PyStatus +Py_InitializeFromConfig(const PyConfig *config) +{ + if (config == NULL) { + return _PyStatus_ERR("initialization config is NULL"); + } + + PyStatus status; + + status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + _PyRuntimeState *runtime = &_PyRuntime; + + PyThreadState *tstate = NULL; + status = pyinit_core(runtime, config, &tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + config = _PyInterpreterState_GetConfig(tstate->interp); + + if (config->_init_main) { + status = pyinit_main(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; } } - - if (is_main_interp) { -#ifndef MS_WINDOWS - emit_stderr_warning_for_legacy_locale(interp->runtime); -#endif - } - - assert(!_PyErr_Occurred(tstate)); - - return _PyStatus_OK(); -} - - -/* Update interpreter state based on supplied configuration settings - * - * After calling this function, most of the restrictions on the interpreter - * are lifted. The only remaining incomplete settings are those related - * to the main module (sys.argv[0], __main__ metadata) - * - * Calling this when the interpreter is not initializing, is already - * initialized or without a valid current thread state is a fatal error. - * Other errors should be reported as normal Python exceptions with a - * non-zero return code. - */ -static PyStatus -pyinit_main(PyThreadState *tstate) -{ - PyInterpreterState *interp = tstate->interp; - if (!interp->runtime->core_initialized) { - return _PyStatus_ERR("runtime core not initialized"); - } - - if (interp->runtime->initialized) { - return _Py_ReconfigureMainInterpreter(tstate); - } - - PyStatus status = init_interp_main(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); -} - - -PyStatus -_Py_InitializeMain(void) -{ - PyStatus status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - return pyinit_main(tstate); -} - - -PyStatus -Py_InitializeFromConfig(const PyConfig *config) -{ - if (config == NULL) { - return _PyStatus_ERR("initialization config is NULL"); - } - - PyStatus status; - - status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - _PyRuntimeState *runtime = &_PyRuntime; - - PyThreadState *tstate = NULL; - status = pyinit_core(runtime, config, &tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - config = _PyInterpreterState_GetConfig(tstate->interp); - - if (config->_init_main) { - status = pyinit_main(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - return _PyStatus_OK(); + + return _PyStatus_OK(); } void Py_InitializeEx(int install_sigs) { - PyStatus status; - - status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); - } - _PyRuntimeState *runtime = &_PyRuntime; - - if (runtime->initialized) { + PyStatus status; + + status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + Py_ExitStatusException(status); + } + _PyRuntimeState *runtime = &_PyRuntime; + + if (runtime->initialized) { /* bpo-33932: Calling Py_Initialize() twice does nothing. */ return; } - PyConfig config; - _PyConfig_InitCompatConfig(&config); - + PyConfig config; + _PyConfig_InitCompatConfig(&config); + config.install_signal_handlers = install_sigs; - status = Py_InitializeFromConfig(&config); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); + status = Py_InitializeFromConfig(&config); + if (_PyStatus_EXCEPTION(status)) { + Py_ExitStatusException(status); } } @@ -1217,7 +1217,7 @@ flush_std_files(void) int status = 0; if (fout != NULL && fout != Py_None && !file_is_closed(fout)) { - tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); + tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_flush); if (tmp == NULL) { PyErr_WriteUnraisable(fout); status = -1; @@ -1227,7 +1227,7 @@ flush_std_files(void) } if (ferr != NULL && ferr != Py_None && !file_is_closed(ferr)) { - tmp = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); + tmp = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); if (tmp == NULL) { PyErr_Clear(); status = -1; @@ -1253,161 +1253,161 @@ flush_std_files(void) */ - -static void -finalize_interp_types(PyThreadState *tstate, int is_main_interp) -{ - if (is_main_interp) { - /* Sundry finalizers */ - _PyAST_Fini(); - _PyFrame_Fini(); - _PyTuple_Fini(); - _PyList_Fini(); - _PySet_Fini(); - _PyBytes_Fini(); - } - - _PyLong_Fini(tstate); - - if (is_main_interp) { - _PyFloat_Fini(); - _PyDict_Fini(); - _PySlice_Fini(); - } - - _PyWarnings_Fini(tstate->interp); - - if (is_main_interp) { - _Py_HashRandomization_Fini(); - _PyArg_Fini(); - _PyAsyncGen_Fini(); - _PyContext_Fini(); - } - - /* Cleanup Unicode implementation */ - _PyUnicode_Fini(tstate); - - if (is_main_interp) { - _Py_ClearFileSystemEncoding(); - } -} - - -static void -finalize_interp_clear(PyThreadState *tstate) -{ - int is_main_interp = _Py_IsMainInterpreter(tstate); - - /* Clear interpreter state and all thread states */ - PyInterpreterState_Clear(tstate->interp); - - /* Trigger a GC collection on subinterpreters*/ - if (!is_main_interp) { - _PyGC_CollectNoFail(); - } - - /* Clear all loghooks */ - /* Both _PySys_Audit function and users still need PyObject, such as tuple. - Call _PySys_ClearAuditHooks when PyObject available. */ - if (is_main_interp) { - _PySys_ClearAuditHooks(tstate); - } - - finalize_interp_types(tstate, is_main_interp); - - if (is_main_interp) { - /* XXX Still allocated: - - various static ad-hoc pointers to interned strings - - int and float free list blocks - - whatever various modules and libraries allocate - */ - - PyGrammar_RemoveAccelerators(&_PyParser_Grammar); - - _PyExc_Fini(); - } - - _PyGC_Fini(tstate); -} - - -static void -finalize_interp_delete(PyThreadState *tstate) -{ - if (_Py_IsMainInterpreter(tstate)) { - /* Cleanup auto-thread-state */ - _PyGILState_Fini(tstate); - } - - /* We can't call _PyEval_FiniGIL() here because destroying the GIL lock can - fail when it is being awaited by another running daemon thread (see - bpo-9901). Instead pycore_create_interpreter() destroys the previously - created GIL, which ensures that Py_Initialize / Py_FinalizeEx can be - called multiple times. */ - - PyInterpreterState_Delete(tstate->interp); -} - - + +static void +finalize_interp_types(PyThreadState *tstate, int is_main_interp) +{ + if (is_main_interp) { + /* Sundry finalizers */ + _PyAST_Fini(); + _PyFrame_Fini(); + _PyTuple_Fini(); + _PyList_Fini(); + _PySet_Fini(); + _PyBytes_Fini(); + } + + _PyLong_Fini(tstate); + + if (is_main_interp) { + _PyFloat_Fini(); + _PyDict_Fini(); + _PySlice_Fini(); + } + + _PyWarnings_Fini(tstate->interp); + + if (is_main_interp) { + _Py_HashRandomization_Fini(); + _PyArg_Fini(); + _PyAsyncGen_Fini(); + _PyContext_Fini(); + } + + /* Cleanup Unicode implementation */ + _PyUnicode_Fini(tstate); + + if (is_main_interp) { + _Py_ClearFileSystemEncoding(); + } +} + + +static void +finalize_interp_clear(PyThreadState *tstate) +{ + int is_main_interp = _Py_IsMainInterpreter(tstate); + + /* Clear interpreter state and all thread states */ + PyInterpreterState_Clear(tstate->interp); + + /* Trigger a GC collection on subinterpreters*/ + if (!is_main_interp) { + _PyGC_CollectNoFail(); + } + + /* Clear all loghooks */ + /* Both _PySys_Audit function and users still need PyObject, such as tuple. + Call _PySys_ClearAuditHooks when PyObject available. */ + if (is_main_interp) { + _PySys_ClearAuditHooks(tstate); + } + + finalize_interp_types(tstate, is_main_interp); + + if (is_main_interp) { + /* XXX Still allocated: + - various static ad-hoc pointers to interned strings + - int and float free list blocks + - whatever various modules and libraries allocate + */ + + PyGrammar_RemoveAccelerators(&_PyParser_Grammar); + + _PyExc_Fini(); + } + + _PyGC_Fini(tstate); +} + + +static void +finalize_interp_delete(PyThreadState *tstate) +{ + if (_Py_IsMainInterpreter(tstate)) { + /* Cleanup auto-thread-state */ + _PyGILState_Fini(tstate); + } + + /* We can't call _PyEval_FiniGIL() here because destroying the GIL lock can + fail when it is being awaited by another running daemon thread (see + bpo-9901). Instead pycore_create_interpreter() destroys the previously + created GIL, which ensures that Py_Initialize / Py_FinalizeEx can be + called multiple times. */ + + PyInterpreterState_Delete(tstate->interp); +} + + int Py_FinalizeEx(void) { int status = 0; - _PyRuntimeState *runtime = &_PyRuntime; - if (!runtime->initialized) { + _PyRuntimeState *runtime = &_PyRuntime; + if (!runtime->initialized) { return status; - } + } + + /* Get current thread state and interpreter pointer */ + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + + // Wrap up existing "threading"-module-created, non-daemon threads. + wait_for_thread_shutdown(tstate); - /* Get current thread state and interpreter pointer */ - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - - // Wrap up existing "threading"-module-created, non-daemon threads. - wait_for_thread_shutdown(tstate); + // Make any remaining pending calls. + _Py_FinishPendingCalls(tstate); - // Make any remaining pending calls. - _Py_FinishPendingCalls(tstate); - /* The interpreter is still entirely intact at this point, and the * exit funcs may be relying on that. In particular, if some thread * or exit func is still waiting to do an import, the import machinery * expects Py_IsInitialized() to return true. So don't say the - * runtime is uninitialized until after the exit funcs have run. + * runtime is uninitialized until after the exit funcs have run. * Note that Threading.py uses an exit func to do a join on all the * threads created thru it, so this also protects pending imports in * the threads created via Threading. */ - call_py_exitfuncs(tstate); + call_py_exitfuncs(tstate); /* Copy the core config, PyInterpreterState_Delete() free the core config memory */ #ifdef Py_REF_DEBUG - int show_ref_count = tstate->interp->config.show_ref_count; + int show_ref_count = tstate->interp->config.show_ref_count; #endif #ifdef Py_TRACE_REFS - int dump_refs = tstate->interp->config.dump_refs; + int dump_refs = tstate->interp->config.dump_refs; #endif #ifdef WITH_PYMALLOC - int malloc_stats = tstate->interp->config.malloc_stats; + int malloc_stats = tstate->interp->config.malloc_stats; #endif - /* Remaining daemon threads will automatically exit - when they attempt to take the GIL (ex: PyEval_RestoreThread()). */ - _PyRuntimeState_SetFinalizing(runtime, tstate); - runtime->initialized = 0; - runtime->core_initialized = 0; - - /* Destroy the state of all threads of the interpreter, except of the - current thread. In practice, only daemon threads should still be alive, - except if wait_for_thread_shutdown() has been cancelled by CTRL+C. - Clear frames of other threads to call objects destructors. Destructors - will be called in the current Python thread. Since - _PyRuntimeState_SetFinalizing() has been called, no other Python thread - can take the GIL at this point: if they try, they will exit - immediately. */ - _PyThreadState_DeleteExcept(runtime, tstate); - + /* Remaining daemon threads will automatically exit + when they attempt to take the GIL (ex: PyEval_RestoreThread()). */ + _PyRuntimeState_SetFinalizing(runtime, tstate); + runtime->initialized = 0; + runtime->core_initialized = 0; + + /* Destroy the state of all threads of the interpreter, except of the + current thread. In practice, only daemon threads should still be alive, + except if wait_for_thread_shutdown() has been cancelled by CTRL+C. + Clear frames of other threads to call objects destructors. Destructors + will be called in the current Python thread. Since + _PyRuntimeState_SetFinalizing() has been called, no other Python thread + can take the GIL at this point: if they try, they will exit + immediately. */ + _PyThreadState_DeleteExcept(runtime, tstate); + /* Flush sys.stdout and sys.stderr */ if (flush_std_files() < 0) { status = -1; @@ -1431,11 +1431,11 @@ Py_FinalizeEx(void) _PyGC_CollectIfEnabled(); /* Destroy all modules */ - _PyImport_Cleanup(tstate); + _PyImport_Cleanup(tstate); + + /* Print debug stats if any */ + _PyEval_Fini(); - /* Print debug stats if any */ - _PyEval_Fini(); - /* Flush sys.stdout and sys.stderr (again, in case more was printed) */ if (flush_std_files() < 0) { status = -1; @@ -1493,8 +1493,8 @@ Py_FinalizeEx(void) } #endif /* Py_TRACE_REFS */ - finalize_interp_clear(tstate); - finalize_interp_delete(tstate); + finalize_interp_clear(tstate); + finalize_interp_delete(tstate); #ifdef Py_TRACE_REFS /* Display addresses (& refcnts) of all objects still alive. @@ -1511,7 +1511,7 @@ Py_FinalizeEx(void) } #endif - call_ll_exitfuncs(runtime); + call_ll_exitfuncs(runtime); _PyRuntime_Finalize(); return status; @@ -1523,7 +1523,7 @@ Py_Finalize(void) Py_FinalizeEx(); } - + /* Create and initialize a new interpreter and thread, and return the new thread. This requires that Py_Initialize() has been called first. @@ -1537,107 +1537,107 @@ Py_Finalize(void) */ -static PyStatus -new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) +static PyStatus +new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) { - PyStatus status; + PyStatus status; - status = _PyRuntime_Initialize(); - if (_PyStatus_EXCEPTION(status)) { - return status; + status = _PyRuntime_Initialize(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + _PyRuntimeState *runtime = &_PyRuntime; + + if (!runtime->initialized) { + return _PyStatus_ERR("Py_Initialize must be called first"); } - _PyRuntimeState *runtime = &_PyRuntime; - if (!runtime->initialized) { - return _PyStatus_ERR("Py_Initialize must be called first"); - } - /* Issue #10915, #15751: The GIL API doesn't work with multiple interpreters: disable PyGILState_Check(). */ - runtime->gilstate.check_enabled = 0; + runtime->gilstate.check_enabled = 0; - PyInterpreterState *interp = PyInterpreterState_New(); + PyInterpreterState *interp = PyInterpreterState_New(); if (interp == NULL) { *tstate_p = NULL; - return _PyStatus_OK(); + return _PyStatus_OK(); } - PyThreadState *tstate = PyThreadState_New(interp); + PyThreadState *tstate = PyThreadState_New(interp); if (tstate == NULL) { PyInterpreterState_Delete(interp); *tstate_p = NULL; - return _PyStatus_OK(); + return _PyStatus_OK(); } - PyThreadState *save_tstate = PyThreadState_Swap(tstate); + PyThreadState *save_tstate = PyThreadState_Swap(tstate); /* Copy the current interpreter config into the new interpreter */ - const PyConfig *config; + const PyConfig *config; if (save_tstate != NULL) { - config = _PyInterpreterState_GetConfig(save_tstate->interp); - } - else - { + config = _PyInterpreterState_GetConfig(save_tstate->interp); + } + else + { /* No current thread state, copy from the main interpreter */ PyInterpreterState *main_interp = PyInterpreterState_Main(); - config = _PyInterpreterState_GetConfig(main_interp); + config = _PyInterpreterState_GetConfig(main_interp); + } + + status = _PyInterpreterState_SetConfig(interp, config); + if (_PyStatus_EXCEPTION(status)) { + goto error; } + interp->config._isolated_interpreter = isolated_subinterpreter; - status = _PyInterpreterState_SetConfig(interp, config); - if (_PyStatus_EXCEPTION(status)) { - goto error; + status = init_interp_create_gil(tstate); + if (_PyStatus_EXCEPTION(status)) { + goto error; } - interp->config._isolated_interpreter = isolated_subinterpreter; - - status = init_interp_create_gil(tstate); - if (_PyStatus_EXCEPTION(status)) { - goto error; + + status = pycore_interp_init(tstate); + if (_PyStatus_EXCEPTION(status)) { + goto error; } - status = pycore_interp_init(tstate); - if (_PyStatus_EXCEPTION(status)) { - goto error; - } - - status = init_interp_main(tstate); - if (_PyStatus_EXCEPTION(status)) { - goto error; + status = init_interp_main(tstate); + if (_PyStatus_EXCEPTION(status)) { + goto error; } *tstate_p = tstate; - return _PyStatus_OK(); + return _PyStatus_OK(); + +error: + *tstate_p = NULL; -error: - *tstate_p = NULL; - /* Oops, it didn't work. Undo it all. */ PyErr_PrintEx(0); PyThreadState_Clear(tstate); PyThreadState_Delete(tstate); PyInterpreterState_Delete(interp); - PyThreadState_Swap(save_tstate); + PyThreadState_Swap(save_tstate); - return status; + return status; } PyThreadState * -_Py_NewInterpreter(int isolated_subinterpreter) +_Py_NewInterpreter(int isolated_subinterpreter) { - PyThreadState *tstate = NULL; - PyStatus status = new_interpreter(&tstate, isolated_subinterpreter); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); + PyThreadState *tstate = NULL; + PyStatus status = new_interpreter(&tstate, isolated_subinterpreter); + if (_PyStatus_EXCEPTION(status)) { + Py_ExitStatusException(status); } return tstate; } -PyThreadState * -Py_NewInterpreter(void) -{ - return _Py_NewInterpreter(0); -} - +PyThreadState * +Py_NewInterpreter(void) +{ + return _Py_NewInterpreter(0); +} + /* Delete an interpreter and its last thread. This requires that the given thread state is current, that the thread has no remaining frames, and that it is its interpreter's only remaining thread. @@ -1655,53 +1655,53 @@ Py_EndInterpreter(PyThreadState *tstate) { PyInterpreterState *interp = tstate->interp; - if (tstate != _PyThreadState_GET()) { - Py_FatalError("thread is not current"); - } - if (tstate->frame != NULL) { - Py_FatalError("thread still has a frame"); - } - interp->finalizing = 1; + if (tstate != _PyThreadState_GET()) { + Py_FatalError("thread is not current"); + } + if (tstate->frame != NULL) { + Py_FatalError("thread still has a frame"); + } + interp->finalizing = 1; - // Wrap up existing "threading"-module-created, non-daemon threads. - wait_for_thread_shutdown(tstate); + // Wrap up existing "threading"-module-created, non-daemon threads. + wait_for_thread_shutdown(tstate); - call_py_exitfuncs(tstate); + call_py_exitfuncs(tstate); - if (tstate != interp->tstate_head || tstate->next != NULL) { - Py_FatalError("not the last thread"); - } + if (tstate != interp->tstate_head || tstate->next != NULL) { + Py_FatalError("not the last thread"); + } - _PyImport_Cleanup(tstate); - finalize_interp_clear(tstate); - finalize_interp_delete(tstate); + _PyImport_Cleanup(tstate); + finalize_interp_clear(tstate); + finalize_interp_delete(tstate); } /* Add the __main__ module */ -static PyStatus +static PyStatus add_main_module(PyInterpreterState *interp) { PyObject *m, *d, *loader, *ann_dict; m = PyImport_AddModule("__main__"); if (m == NULL) - return _PyStatus_ERR("can't create __main__ module"); + return _PyStatus_ERR("can't create __main__ module"); d = PyModule_GetDict(m); ann_dict = PyDict_New(); if ((ann_dict == NULL) || (PyDict_SetItemString(d, "__annotations__", ann_dict) < 0)) { - return _PyStatus_ERR("Failed to initialize __main__.__annotations__"); + return _PyStatus_ERR("Failed to initialize __main__.__annotations__"); } Py_DECREF(ann_dict); if (PyDict_GetItemString(d, "__builtins__") == NULL) { PyObject *bimod = PyImport_ImportModule("builtins"); if (bimod == NULL) { - return _PyStatus_ERR("Failed to retrieve builtins module"); + return _PyStatus_ERR("Failed to retrieve builtins module"); } if (PyDict_SetItemString(d, "__builtins__", bimod) < 0) { - return _PyStatus_ERR("Failed to initialize __main__.__builtins__"); + return _PyStatus_ERR("Failed to initialize __main__.__builtins__"); } Py_DECREF(bimod); } @@ -1717,28 +1717,28 @@ add_main_module(PyInterpreterState *interp) PyObject *loader = PyObject_GetAttrString(interp->importlib, "BuiltinImporter"); if (loader == NULL) { - return _PyStatus_ERR("Failed to retrieve BuiltinImporter"); + return _PyStatus_ERR("Failed to retrieve BuiltinImporter"); } if (PyDict_SetItemString(d, "__loader__", loader) < 0) { - return _PyStatus_ERR("Failed to initialize __main__.__loader__"); + return _PyStatus_ERR("Failed to initialize __main__.__loader__"); } Py_DECREF(loader); } - return _PyStatus_OK(); + return _PyStatus_OK(); } /* Import the site module (not into __main__ though) */ -static PyStatus -init_import_site(void) +static PyStatus +init_import_site(void) { PyObject *m; m = PyImport_ImportModule("site"); if (m == NULL) { - return _PyStatus_ERR("Failed to import the site module"); + return _PyStatus_ERR("Failed to import the site module"); } Py_DECREF(m); - return _PyStatus_OK(); + return _PyStatus_OK(); } /* Check if a file descriptor is valid or not. @@ -1746,42 +1746,42 @@ init_import_site(void) static int is_valid_fd(int fd) { -/* dup() is faster than fstat(): fstat() can require input/output operations, - whereas dup() doesn't. There is a low risk of EMFILE/ENFILE at Python - startup. Problem: dup() doesn't check if the file descriptor is valid on - some platforms. - - bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other - side of the pipe is closed, dup(1) succeed, whereas fstat(1, &st) fails with - EBADF. FreeBSD has similar issue (bpo-32849). - - Only use dup() on platforms where dup() is enough to detect invalid FD in - corner cases: on Linux and Windows (bpo-32849). */ -#if defined(__linux__) || defined(MS_WINDOWS) - if (fd < 0) { - return 0; - } +/* dup() is faster than fstat(): fstat() can require input/output operations, + whereas dup() doesn't. There is a low risk of EMFILE/ENFILE at Python + startup. Problem: dup() doesn't check if the file descriptor is valid on + some platforms. + + bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other + side of the pipe is closed, dup(1) succeed, whereas fstat(1, &st) fails with + EBADF. FreeBSD has similar issue (bpo-32849). + + Only use dup() on platforms where dup() is enough to detect invalid FD in + corner cases: on Linux and Windows (bpo-32849). */ +#if defined(__linux__) || defined(MS_WINDOWS) + if (fd < 0) { + return 0; + } int fd2; - + _Py_BEGIN_SUPPRESS_IPH fd2 = dup(fd); - if (fd2 >= 0) { + if (fd2 >= 0) { close(fd2); - } + } _Py_END_SUPPRESS_IPH - - return (fd2 >= 0); -#else - struct stat st; - return (fstat(fd, &st) == 0); + + return (fd2 >= 0); +#else + struct stat st; + return (fstat(fd, &st) == 0); #endif } /* returns Py_None if the fd is not valid */ static PyObject* -create_stdio(const PyConfig *config, PyObject* io, +create_stdio(const PyConfig *config, PyObject* io, int fd, int write_mode, const char* name, - const wchar_t* encoding, const wchar_t* errors) + const wchar_t* encoding, const wchar_t* errors) { PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res; const char* mode; @@ -1792,7 +1792,7 @@ create_stdio(const PyConfig *config, PyObject* io, _Py_IDENTIFIER(isatty); _Py_IDENTIFIER(TextIOWrapper); _Py_IDENTIFIER(mode); - const int buffered_stdio = config->buffered_stdio; + const int buffered_stdio = config->buffered_stdio; if (!is_valid_fd(fd)) Py_RETURN_NONE; @@ -1802,7 +1802,7 @@ create_stdio(const PyConfig *config, PyObject* io, depends on the presence of a read1() method which only exists on buffered streams. */ - if (!buffered_stdio && write_mode) + if (!buffered_stdio && write_mode) buffering = 0; else buffering = -1; @@ -1810,10 +1810,10 @@ create_stdio(const PyConfig *config, PyObject* io, mode = "wb"; else mode = "rb"; - buf = _PyObject_CallMethodId(io, &PyId_open, "isiOOOO", + buf = _PyObject_CallMethodId(io, &PyId_open, "isiOOOO", fd, mode, buffering, Py_None, Py_None, /* encoding, errors */ - Py_None, Py_False); /* newline, closefd */ + Py_None, Py_False); /* newline, closefd */ if (buf == NULL) goto error; @@ -1831,24 +1831,24 @@ create_stdio(const PyConfig *config, PyObject* io, #ifdef MS_WINDOWS /* Windows console IO is always UTF-8 encoded */ if (PyWindowsConsoleIO_Check(raw)) - encoding = L"utf-8"; + encoding = L"utf-8"; #endif text = PyUnicode_FromString(name); if (text == NULL || _PyObject_SetAttrId(raw, &PyId_name, text) < 0) goto error; - res = _PyObject_CallMethodIdNoArgs(raw, &PyId_isatty); + res = _PyObject_CallMethodIdNoArgs(raw, &PyId_isatty); if (res == NULL) goto error; isatty = PyObject_IsTrue(res); Py_DECREF(res); if (isatty == -1) goto error; - if (!buffered_stdio) + if (!buffered_stdio) write_through = Py_True; else write_through = Py_False; - if (buffered_stdio && (isatty || fd == fileno(stderr))) + if (buffered_stdio && (isatty || fd == fileno(stderr))) line_buffering = Py_True; else line_buffering = Py_False; @@ -1867,25 +1867,25 @@ create_stdio(const PyConfig *config, PyObject* io, newline = "\n"; #endif - PyObject *encoding_str = PyUnicode_FromWideChar(encoding, -1); - if (encoding_str == NULL) { - Py_CLEAR(buf); - goto error; - } - - PyObject *errors_str = PyUnicode_FromWideChar(errors, -1); - if (errors_str == NULL) { - Py_CLEAR(buf); - Py_CLEAR(encoding_str); - goto error; - } - - stream = _PyObject_CallMethodId(io, &PyId_TextIOWrapper, "OOOsOO", - buf, encoding_str, errors_str, + PyObject *encoding_str = PyUnicode_FromWideChar(encoding, -1); + if (encoding_str == NULL) { + Py_CLEAR(buf); + goto error; + } + + PyObject *errors_str = PyUnicode_FromWideChar(errors, -1); + if (errors_str == NULL) { + Py_CLEAR(buf); + Py_CLEAR(encoding_str); + goto error; + } + + stream = _PyObject_CallMethodId(io, &PyId_TextIOWrapper, "OOOsOO", + buf, encoding_str, errors_str, newline, line_buffering, write_through); Py_CLEAR(buf); - Py_CLEAR(encoding_str); - Py_CLEAR(errors_str); + Py_CLEAR(encoding_str); + Py_CLEAR(errors_str); if (stream == NULL) goto error; @@ -1915,69 +1915,69 @@ error: return NULL; } -/* Set builtins.open to io.OpenWrapper */ -static PyStatus -init_set_builtins_open(void) +/* Set builtins.open to io.OpenWrapper */ +static PyStatus +init_set_builtins_open(void) { PyObject *iomod = NULL, *wrapper; PyObject *bimod = NULL; - PyStatus res = _PyStatus_OK(); - - if (!(iomod = PyImport_ImportModule("io"))) { - goto error; - } - - if (!(bimod = PyImport_ImportModule("builtins"))) { - goto error; - } - - if (!(wrapper = PyObject_GetAttrString(iomod, "OpenWrapper"))) { - goto error; - } - - /* Set builtins.open */ - if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) { - Py_DECREF(wrapper); - goto error; - } - Py_DECREF(wrapper); - goto done; - -error: - res = _PyStatus_ERR("can't initialize io.open"); - -done: - Py_XDECREF(bimod); - Py_XDECREF(iomod); - return res; -} - - -/* Initialize sys.stdin, stdout, stderr and builtins.open */ -static PyStatus -init_sys_streams(PyThreadState *tstate) -{ - PyObject *iomod = NULL; + PyStatus res = _PyStatus_OK(); + + if (!(iomod = PyImport_ImportModule("io"))) { + goto error; + } + + if (!(bimod = PyImport_ImportModule("builtins"))) { + goto error; + } + + if (!(wrapper = PyObject_GetAttrString(iomod, "OpenWrapper"))) { + goto error; + } + + /* Set builtins.open */ + if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) { + Py_DECREF(wrapper); + goto error; + } + Py_DECREF(wrapper); + goto done; + +error: + res = _PyStatus_ERR("can't initialize io.open"); + +done: + Py_XDECREF(bimod); + Py_XDECREF(iomod); + return res; +} + + +/* Initialize sys.stdin, stdout, stderr and builtins.open */ +static PyStatus +init_sys_streams(PyThreadState *tstate) +{ + PyObject *iomod = NULL; PyObject *m; PyObject *std = NULL; int fd; PyObject * encoding_attr; - PyStatus res = _PyStatus_OK(); - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); - - /* Check that stdin is not a directory - Using shell redirection, you can redirect stdin to a directory, - crashing the Python interpreter. Catch this common mistake here - and output a useful error message. Note that under MS Windows, - the shell already prevents that. */ -#ifndef MS_WINDOWS - struct _Py_stat_struct sb; - if (_Py_fstat_noraise(fileno(stdin), &sb) == 0 && - S_ISDIR(sb.st_mode)) { - return _PyStatus_ERR("<stdin> is a directory, cannot continue"); - } -#endif - + PyStatus res = _PyStatus_OK(); + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + + /* Check that stdin is not a directory + Using shell redirection, you can redirect stdin to a directory, + crashing the Python interpreter. Catch this common mistake here + and output a useful error message. Note that under MS Windows, + the shell already prevents that. */ +#ifndef MS_WINDOWS + struct _Py_stat_struct sb; + if (_Py_fstat_noraise(fileno(stdin), &sb) == 0 && + S_ISDIR(sb.st_mode)) { + return _PyStatus_ERR("<stdin> is a directory, cannot continue"); + } +#endif + /* Hack to avoid a nasty recursion issue when Python is invoked in verbose mode: pre-import the Latin-1 and UTF-8 codecs */ if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) { @@ -2000,9 +2000,9 @@ init_sys_streams(PyThreadState *tstate) * and fileno() may point to an invalid file descriptor. For example * GUI apps don't have valid standard streams by default. */ - std = create_stdio(config, iomod, fd, 0, "<stdin>", - config->stdio_encoding, - config->stdio_errors); + std = create_stdio(config, iomod, fd, 0, "<stdin>", + config->stdio_encoding, + config->stdio_errors); if (std == NULL) goto error; PySys_SetObject("__stdin__", std); @@ -2011,9 +2011,9 @@ init_sys_streams(PyThreadState *tstate) /* Set sys.stdout */ fd = fileno(stdout); - std = create_stdio(config, iomod, fd, 1, "<stdout>", - config->stdio_encoding, - config->stdio_errors); + std = create_stdio(config, iomod, fd, 1, "<stdout>", + config->stdio_encoding, + config->stdio_errors); if (std == NULL) goto error; PySys_SetObject("__stdout__", std); @@ -2023,9 +2023,9 @@ init_sys_streams(PyThreadState *tstate) #if 1 /* Disable this if you have trouble debugging bootstrap stuff */ /* Set sys.stderr, replaces the preliminary stderr */ fd = fileno(stderr); - std = create_stdio(config, iomod, fd, 1, "<stderr>", - config->stdio_encoding, - L"backslashreplace"); + std = create_stdio(config, iomod, fd, 1, "<stderr>", + config->stdio_encoding, + L"backslashreplace"); if (std == NULL) goto error; @@ -2040,7 +2040,7 @@ init_sys_streams(PyThreadState *tstate) } Py_DECREF(encoding_attr); } - _PyErr_Clear(tstate); /* Not a fatal error if codec isn't available */ + _PyErr_Clear(tstate); /* Not a fatal error if codec isn't available */ if (PySys_SetObject("__stderr__", std) < 0) { Py_DECREF(std); @@ -2056,24 +2056,24 @@ init_sys_streams(PyThreadState *tstate) goto done; error: - res = _PyStatus_ERR("can't initialize sys standard streams"); + res = _PyStatus_ERR("can't initialize sys standard streams"); done: - _Py_ClearStandardStreamEncoding(); + _Py_ClearStandardStreamEncoding(); Py_XDECREF(iomod); return res; } static void -_Py_FatalError_DumpTracebacks(int fd, PyInterpreterState *interp, - PyThreadState *tstate) +_Py_FatalError_DumpTracebacks(int fd, PyInterpreterState *interp, + PyThreadState *tstate) { fputc('\n', stderr); fflush(stderr); /* display the current Python stack */ - _Py_DumpTracebackThreads(fd, interp, tstate); + _Py_DumpTracebackThreads(fd, interp, tstate); } /* Print the current exception (if an exception is set) with its traceback, @@ -2085,13 +2085,13 @@ _Py_FatalError_DumpTracebacks(int fd, PyInterpreterState *interp, Return 1 if the traceback was displayed, 0 otherwise. */ static int -_Py_FatalError_PrintExc(PyThreadState *tstate) +_Py_FatalError_PrintExc(PyThreadState *tstate) { PyObject *ferr, *res; PyObject *exception, *v, *tb; int has_tb; - _PyErr_Fetch(tstate, &exception, &v, &tb); + _PyErr_Fetch(tstate, &exception, &v, &tb); if (exception == NULL) { /* No current exception */ return 0; @@ -2104,7 +2104,7 @@ _Py_FatalError_PrintExc(PyThreadState *tstate) return 0; } - _PyErr_NormalizeException(tstate, &exception, &v, &tb); + _PyErr_NormalizeException(tstate, &exception, &v, &tb); if (tb == NULL) { tb = Py_None; Py_INCREF(tb); @@ -2122,13 +2122,13 @@ _Py_FatalError_PrintExc(PyThreadState *tstate) Py_XDECREF(tb); /* sys.stderr may be buffered: call sys.stderr.flush() */ - res = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); - if (res == NULL) { - _PyErr_Clear(tstate); - } - else { + res = _PyObject_CallMethodIdNoArgs(ferr, &PyId_flush); + if (res == NULL) { + _PyErr_Clear(tstate); + } + else { Py_DECREF(res); - } + } return has_tb; } @@ -2170,108 +2170,108 @@ fatal_output_debug(const char *msg) } #endif - -static void -fatal_error_dump_runtime(FILE *stream, _PyRuntimeState *runtime) -{ - fprintf(stream, "Python runtime state: "); - PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); - if (finalizing) { - fprintf(stream, "finalizing (tstate=%p)", finalizing); - } - else if (runtime->initialized) { - fprintf(stream, "initialized"); - } - else if (runtime->core_initialized) { - fprintf(stream, "core initialized"); - } - else if (runtime->preinitialized) { - fprintf(stream, "preinitialized"); - } - else if (runtime->preinitializing) { - fprintf(stream, "preinitializing"); - } - else { - fprintf(stream, "unknown"); - } - fprintf(stream, "\n"); - fflush(stream); -} - - -static inline void _Py_NO_RETURN -fatal_error_exit(int status) -{ - if (status < 0) { -#if defined(MS_WINDOWS) && defined(_DEBUG) - DebugBreak(); -#endif - abort(); - } - else { - exit(status); - } -} - - + +static void +fatal_error_dump_runtime(FILE *stream, _PyRuntimeState *runtime) +{ + fprintf(stream, "Python runtime state: "); + PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); + if (finalizing) { + fprintf(stream, "finalizing (tstate=%p)", finalizing); + } + else if (runtime->initialized) { + fprintf(stream, "initialized"); + } + else if (runtime->core_initialized) { + fprintf(stream, "core initialized"); + } + else if (runtime->preinitialized) { + fprintf(stream, "preinitialized"); + } + else if (runtime->preinitializing) { + fprintf(stream, "preinitializing"); + } + else { + fprintf(stream, "unknown"); + } + fprintf(stream, "\n"); + fflush(stream); +} + + +static inline void _Py_NO_RETURN +fatal_error_exit(int status) +{ + if (status < 0) { +#if defined(MS_WINDOWS) && defined(_DEBUG) + DebugBreak(); +#endif + abort(); + } + else { + exit(status); + } +} + + static void _Py_NO_RETURN -fatal_error(FILE *stream, int header, const char *prefix, const char *msg, - int status) +fatal_error(FILE *stream, int header, const char *prefix, const char *msg, + int status) { - const int fd = fileno(stream); + const int fd = fileno(stream); static int reentrant = 0; if (reentrant) { /* Py_FatalError() caused a second fatal error. Example: flush_std_files() raises a recursion error. */ - fatal_error_exit(status); + fatal_error_exit(status); } reentrant = 1; - if (header) { - fprintf(stream, "Fatal Python error: "); - if (prefix) { - fputs(prefix, stream); - fputs(": ", stream); - } - if (msg) { - fputs(msg, stream); - } - else { - fprintf(stream, "<message not set>"); - } - fputs("\n", stream); - fflush(stream); - } - - _PyRuntimeState *runtime = &_PyRuntime; - fatal_error_dump_runtime(stream, runtime); - - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - PyInterpreterState *interp = NULL; - if (tstate != NULL) { - interp = tstate->interp; - } - + if (header) { + fprintf(stream, "Fatal Python error: "); + if (prefix) { + fputs(prefix, stream); + fputs(": ", stream); + } + if (msg) { + fputs(msg, stream); + } + else { + fprintf(stream, "<message not set>"); + } + fputs("\n", stream); + fflush(stream); + } + + _PyRuntimeState *runtime = &_PyRuntime; + fatal_error_dump_runtime(stream, runtime); + + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + PyInterpreterState *interp = NULL; + if (tstate != NULL) { + interp = tstate->interp; + } + /* Check if the current thread has a Python thread state - and holds the GIL. - - tss_tstate is NULL if Py_FatalError() is called from a C thread which - has no Python thread state. - - tss_tstate != tstate if the current Python thread does not hold the GIL. - */ + and holds the GIL. + + tss_tstate is NULL if Py_FatalError() is called from a C thread which + has no Python thread state. + + tss_tstate != tstate if the current Python thread does not hold the GIL. + */ PyThreadState *tss_tstate = PyGILState_GetThisThreadState(); - int has_tstate_and_gil = (tss_tstate != NULL && tss_tstate == tstate); + int has_tstate_and_gil = (tss_tstate != NULL && tss_tstate == tstate); if (has_tstate_and_gil) { /* If an exception is set, print the exception with its traceback */ - if (!_Py_FatalError_PrintExc(tss_tstate)) { + if (!_Py_FatalError_PrintExc(tss_tstate)) { /* No exception is set, or an exception is set without traceback */ - _Py_FatalError_DumpTracebacks(fd, interp, tss_tstate); + _Py_FatalError_DumpTracebacks(fd, interp, tss_tstate); } } else { - _Py_FatalError_DumpTracebacks(fd, interp, tss_tstate); + _Py_FatalError_DumpTracebacks(fd, interp, tss_tstate); } /* The main purpose of faulthandler is to display the traceback. @@ -2290,72 +2290,72 @@ fatal_error(FILE *stream, int header, const char *prefix, const char *msg, fatal_output_debug(msg); #endif /* MS_WINDOWS */ - fatal_error_exit(status); + fatal_error_exit(status); } - -#undef Py_FatalError - + +#undef Py_FatalError + void _Py_NO_RETURN Py_FatalError(const char *msg) { - fatal_error(stderr, 1, NULL, msg, -1); + fatal_error(stderr, 1, NULL, msg, -1); } - + void _Py_NO_RETURN -_Py_FatalErrorFunc(const char *func, const char *msg) -{ - fatal_error(stderr, 1, func, msg, -1); -} - - -void _Py_NO_RETURN -_Py_FatalErrorFormat(const char *func, const char *format, ...) -{ - static int reentrant = 0; - if (reentrant) { - /* _Py_FatalErrorFormat() caused a second fatal error */ - fatal_error_exit(-1); - } - reentrant = 1; - - FILE *stream = stderr; - fprintf(stream, "Fatal Python error: "); - if (func) { - fputs(func, stream); - fputs(": ", stream); - } - fflush(stream); - - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - vfprintf(stream, format, vargs); - va_end(vargs); - - fputs("\n", stream); - fflush(stream); - - fatal_error(stream, 0, NULL, NULL, -1); -} - - -void _Py_NO_RETURN -Py_ExitStatusException(PyStatus status) -{ - if (_PyStatus_IS_EXIT(status)) { - exit(status.exitcode); - } - else if (_PyStatus_IS_ERROR(status)) { - fatal_error(stderr, 1, status.func, status.err_msg, 1); - } - else { - Py_FatalError("Py_ExitStatusException() must not be called on success"); - } +_Py_FatalErrorFunc(const char *func, const char *msg) +{ + fatal_error(stderr, 1, func, msg, -1); +} + + +void _Py_NO_RETURN +_Py_FatalErrorFormat(const char *func, const char *format, ...) +{ + static int reentrant = 0; + if (reentrant) { + /* _Py_FatalErrorFormat() caused a second fatal error */ + fatal_error_exit(-1); + } + reentrant = 1; + + FILE *stream = stderr; + fprintf(stream, "Fatal Python error: "); + if (func) { + fputs(func, stream); + fputs(": ", stream); + } + fflush(stream); + + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + vfprintf(stream, format, vargs); + va_end(vargs); + + fputs("\n", stream); + fflush(stream); + + fatal_error(stream, 0, NULL, NULL, -1); +} + + +void _Py_NO_RETURN +Py_ExitStatusException(PyStatus status) +{ + if (_PyStatus_IS_EXIT(status)) { + exit(status.exitcode); + } + else if (_PyStatus_IS_ERROR(status)) { + fatal_error(stderr, 1, status.func, status.err_msg, 1); + } + else { + Py_FatalError("Py_ExitStatusException() must not be called on success"); + } } /* Clean up and exit */ @@ -2363,7 +2363,7 @@ Py_ExitStatusException(PyStatus status) /* For the atexit module. */ void _Py_PyAtExit(void (*func)(PyObject *), PyObject *module) { - PyInterpreterState *is = _PyInterpreterState_GET(); + PyInterpreterState *is = _PyInterpreterState_GET(); /* Guard against API misuse (see bpo-17852) */ assert(is->pyexitfunc == NULL || is->pyexitfunc == func); @@ -2373,14 +2373,14 @@ void _Py_PyAtExit(void (*func)(PyObject *), PyObject *module) } static void -call_py_exitfuncs(PyThreadState *tstate) +call_py_exitfuncs(PyThreadState *tstate) { - PyInterpreterState *interp = tstate->interp; - if (interp->pyexitfunc == NULL) + PyInterpreterState *interp = tstate->interp; + if (interp->pyexitfunc == NULL) return; - (*interp->pyexitfunc)(interp->pyexitmodule); - _PyErr_Clear(tstate); + (*interp->pyexitfunc)(interp->pyexitmodule); + _PyErr_Clear(tstate); } /* Wait until threading._shutdown completes, provided @@ -2388,19 +2388,19 @@ call_py_exitfuncs(PyThreadState *tstate) The shutdown routine will wait until all non-daemon "threading" threads have completed. */ static void -wait_for_thread_shutdown(PyThreadState *tstate) +wait_for_thread_shutdown(PyThreadState *tstate) { _Py_IDENTIFIER(_shutdown); PyObject *result; PyObject *threading = _PyImport_GetModuleId(&PyId_threading); if (threading == NULL) { - if (_PyErr_Occurred(tstate)) { - PyErr_WriteUnraisable(NULL); - } - /* else: threading not imported */ + if (_PyErr_Occurred(tstate)) { + PyErr_WriteUnraisable(NULL); + } + /* else: threading not imported */ return; } - result = _PyObject_CallMethodIdNoArgs(threading, &PyId__shutdown); + result = _PyObject_CallMethodIdNoArgs(threading, &PyId__shutdown); if (result == NULL) { PyErr_WriteUnraisable(threading); } @@ -2420,22 +2420,22 @@ int Py_AtExit(void (*func)(void)) } static void -call_ll_exitfuncs(_PyRuntimeState *runtime) +call_ll_exitfuncs(_PyRuntimeState *runtime) { - while (runtime->nexitfuncs > 0) { - /* pop last function from the list */ - runtime->nexitfuncs--; - void (*exitfunc)(void) = runtime->exitfuncs[runtime->nexitfuncs]; - runtime->exitfuncs[runtime->nexitfuncs] = NULL; + while (runtime->nexitfuncs > 0) { + /* pop last function from the list */ + runtime->nexitfuncs--; + void (*exitfunc)(void) = runtime->exitfuncs[runtime->nexitfuncs]; + runtime->exitfuncs[runtime->nexitfuncs] = NULL; + + exitfunc(); + } - exitfunc(); - } - fflush(stdout); fflush(stderr); } -void _Py_NO_RETURN +void _Py_NO_RETURN Py_Exit(int sts) { if (Py_FinalizeEx() < 0) { @@ -2451,8 +2451,8 @@ Py_Exit(int sts) * All of the code in this function must only use async-signal-safe functions, * listed at `man 7 signal` or * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html. - * - * If this function is updated, update also _posix_spawn() of subprocess.py. + * + * If this function is updated, update also _posix_spawn() of subprocess.py. */ void _Py_RestoreSignals(void) diff --git a/contrib/tools/python3/src/Python/pymath.c b/contrib/tools/python3/src/Python/pymath.c index 479a6a12d4..a08a0e7961 100644 --- a/contrib/tools/python3/src/Python/pymath.c +++ b/contrib/tools/python3/src/Python/pymath.c @@ -79,18 +79,18 @@ round(double x) return copysign(y, x); } #endif /* HAVE_ROUND */ - -static const unsigned int BitLengthTable[32] = { - 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 -}; - -unsigned int _Py_bit_length(unsigned long d) { - unsigned int d_bits = 0; - while (d >= 32) { - d_bits += 6; - d >>= 6; - } - d_bits += BitLengthTable[d]; - return d_bits; -} + +static const unsigned int BitLengthTable[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 +}; + +unsigned int _Py_bit_length(unsigned long d) { + unsigned int d_bits = 0; + while (d >= 32) { + d_bits += 6; + d >>= 6; + } + d_bits += BitLengthTable[d]; + return d_bits; +} diff --git a/contrib/tools/python3/src/Python/pystate.c b/contrib/tools/python3/src/Python/pystate.c index df351b853f..c3520c336a 100644 --- a/contrib/tools/python3/src/Python/pystate.c +++ b/contrib/tools/python3/src/Python/pystate.c @@ -2,13 +2,13 @@ /* Thread and interpreter state structures and their interfaces */ #include "Python.h" -#include "pycore_ceval.h" -#include "pycore_initconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" -#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_sysmodule.h" +#include "pycore_ceval.h" +#include "pycore_initconfig.h" +#include "pycore_pyerrors.h" +#include "pycore_pylifecycle.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_sysmodule.h" /* -------------------------------------------------------------------------- CAUTION @@ -33,37 +33,37 @@ to avoid the expense of doing their own locking). extern "C" { #endif -#define _PyRuntimeGILState_GetThreadState(gilstate) \ - ((PyThreadState*)_Py_atomic_load_relaxed(&(gilstate)->tstate_current)) -#define _PyRuntimeGILState_SetThreadState(gilstate, value) \ - _Py_atomic_store_relaxed(&(gilstate)->tstate_current, \ - (uintptr_t)(value)) - -/* Forward declarations */ -static PyThreadState *_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate); -static void _PyThreadState_Delete(PyThreadState *tstate, int check_current); - - -static PyStatus +#define _PyRuntimeGILState_GetThreadState(gilstate) \ + ((PyThreadState*)_Py_atomic_load_relaxed(&(gilstate)->tstate_current)) +#define _PyRuntimeGILState_SetThreadState(gilstate, value) \ + _Py_atomic_store_relaxed(&(gilstate)->tstate_current, \ + (uintptr_t)(value)) + +/* Forward declarations */ +static PyThreadState *_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate); +static void _PyThreadState_Delete(PyThreadState *tstate, int check_current); + + +static PyStatus _PyRuntimeState_Init_impl(_PyRuntimeState *runtime) { - /* We preserve the hook across init, because there is - currently no public API to set it between runtime - initialization and interpreter initialization. */ - void *open_code_hook = runtime->open_code_hook; - void *open_code_userdata = runtime->open_code_userdata; - _Py_AuditHookEntry *audit_hook_head = runtime->audit_hook_head; - + /* We preserve the hook across init, because there is + currently no public API to set it between runtime + initialization and interpreter initialization. */ + void *open_code_hook = runtime->open_code_hook; + void *open_code_userdata = runtime->open_code_userdata; + _Py_AuditHookEntry *audit_hook_head = runtime->audit_hook_head; + memset(runtime, 0, sizeof(*runtime)); - runtime->open_code_hook = open_code_hook; - runtime->open_code_userdata = open_code_userdata; - runtime->audit_hook_head = audit_hook_head; - - _PyEval_InitRuntimeState(&runtime->ceval); + runtime->open_code_hook = open_code_hook; + runtime->open_code_userdata = open_code_userdata; + runtime->audit_hook_head = audit_hook_head; + + _PyEval_InitRuntimeState(&runtime->ceval); + + PyPreConfig_InitPythonConfig(&runtime->preconfig); - PyPreConfig_InitPythonConfig(&runtime->preconfig); - runtime->gilstate.check_enabled = 1; /* A TSS key must be initialized with Py_tss_NEEDS_INIT @@ -73,22 +73,22 @@ _PyRuntimeState_Init_impl(_PyRuntimeState *runtime) runtime->interpreters.mutex = PyThread_allocate_lock(); if (runtime->interpreters.mutex == NULL) { - return _PyStatus_ERR("Can't initialize threads for interpreter"); + return _PyStatus_ERR("Can't initialize threads for interpreter"); } runtime->interpreters.next_id = -1; - runtime->xidregistry.mutex = PyThread_allocate_lock(); - if (runtime->xidregistry.mutex == NULL) { - return _PyStatus_ERR("Can't initialize threads for cross-interpreter data registry"); - } - - // Set it to the ID of the main thread of the main interpreter. - runtime->main_thread = PyThread_get_thread_ident(); - - return _PyStatus_OK(); + runtime->xidregistry.mutex = PyThread_allocate_lock(); + if (runtime->xidregistry.mutex == NULL) { + return _PyStatus_ERR("Can't initialize threads for cross-interpreter data registry"); + } + + // Set it to the ID of the main thread of the main interpreter. + runtime->main_thread = PyThread_get_thread_ident(); + + return _PyStatus_OK(); } -PyStatus +PyStatus _PyRuntimeState_Init(_PyRuntimeState *runtime) { /* Force default allocator, since _PyRuntimeState_Fini() must @@ -96,10 +96,10 @@ _PyRuntimeState_Init(_PyRuntimeState *runtime) PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - PyStatus status = _PyRuntimeState_Init_impl(runtime); + PyStatus status = _PyRuntimeState_Init_impl(runtime); PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - return status; + return status; } void @@ -114,116 +114,116 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime) runtime->interpreters.mutex = NULL; } - if (runtime->xidregistry.mutex != NULL) { - PyThread_free_lock(runtime->xidregistry.mutex); - runtime->xidregistry.mutex = NULL; - } - + if (runtime->xidregistry.mutex != NULL) { + PyThread_free_lock(runtime->xidregistry.mutex); + runtime->xidregistry.mutex = NULL; + } + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } -#ifdef HAVE_FORK -/* This function is called from PyOS_AfterFork_Child to ensure that - * newly created child processes do not share locks with the parent. - */ - -void -_PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime) -{ - // This was initially set in _PyRuntimeState_Init(). - runtime->main_thread = PyThread_get_thread_ident(); - - /* Force default allocator, since _PyRuntimeState_Fini() must - use the same allocator than this function. */ - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - int interp_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.mutex); - int xidregistry_mutex = _PyThread_at_fork_reinit(&runtime->xidregistry.mutex); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - /* bpo-42540: id_mutex is freed by _PyInterpreterState_Delete, which does - * not force the default allocator. */ - int main_interp_id_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.main->id_mutex); - - if (interp_mutex < 0) { - Py_FatalError("Can't initialize lock for runtime interpreters"); - } - - if (main_interp_id_mutex < 0) { - Py_FatalError("Can't initialize ID lock for main interpreter"); - } - - if (xidregistry_mutex < 0) { - Py_FatalError("Can't initialize lock for cross-interpreter data registry"); - } -} -#endif - -#define HEAD_LOCK(runtime) \ - PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK) -#define HEAD_UNLOCK(runtime) \ - PyThread_release_lock((runtime)->interpreters.mutex) - -/* Forward declaration */ -static void _PyGILState_NoteThreadState( - struct _gilstate_runtime_state *gilstate, PyThreadState* tstate); - -PyStatus +#ifdef HAVE_FORK +/* This function is called from PyOS_AfterFork_Child to ensure that + * newly created child processes do not share locks with the parent. + */ + +void +_PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime) +{ + // This was initially set in _PyRuntimeState_Init(). + runtime->main_thread = PyThread_get_thread_ident(); + + /* Force default allocator, since _PyRuntimeState_Fini() must + use the same allocator than this function. */ + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + int interp_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.mutex); + int xidregistry_mutex = _PyThread_at_fork_reinit(&runtime->xidregistry.mutex); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + /* bpo-42540: id_mutex is freed by _PyInterpreterState_Delete, which does + * not force the default allocator. */ + int main_interp_id_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.main->id_mutex); + + if (interp_mutex < 0) { + Py_FatalError("Can't initialize lock for runtime interpreters"); + } + + if (main_interp_id_mutex < 0) { + Py_FatalError("Can't initialize ID lock for main interpreter"); + } + + if (xidregistry_mutex < 0) { + Py_FatalError("Can't initialize lock for cross-interpreter data registry"); + } +} +#endif + +#define HEAD_LOCK(runtime) \ + PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK) +#define HEAD_UNLOCK(runtime) \ + PyThread_release_lock((runtime)->interpreters.mutex) + +/* Forward declaration */ +static void _PyGILState_NoteThreadState( + struct _gilstate_runtime_state *gilstate, PyThreadState* tstate); + +PyStatus _PyInterpreterState_Enable(_PyRuntimeState *runtime) { - struct pyinterpreters *interpreters = &runtime->interpreters; - interpreters->next_id = 0; + struct pyinterpreters *interpreters = &runtime->interpreters; + interpreters->next_id = 0; /* Py_Finalize() calls _PyRuntimeState_Fini() which clears the mutex. Create a new mutex if needed. */ - if (interpreters->mutex == NULL) { + if (interpreters->mutex == NULL) { /* Force default allocator, since _PyRuntimeState_Fini() must use the same allocator than this function. */ PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - interpreters->mutex = PyThread_allocate_lock(); + interpreters->mutex = PyThread_allocate_lock(); PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - if (interpreters->mutex == NULL) { - return _PyStatus_ERR("Can't initialize threads for interpreter"); + if (interpreters->mutex == NULL) { + return _PyStatus_ERR("Can't initialize threads for interpreter"); } } - return _PyStatus_OK(); + return _PyStatus_OK(); } PyInterpreterState * PyInterpreterState_New(void) { - PyThreadState *tstate = _PyThreadState_GET(); - /* tstate is NULL when Py_InitializeFromConfig() calls - PyInterpreterState_New() to create the main interpreter. */ - if (_PySys_Audit(tstate, "cpython.PyInterpreterState_New", NULL) < 0) { - return NULL; - } + PyThreadState *tstate = _PyThreadState_GET(); + /* tstate is NULL when Py_InitializeFromConfig() calls + PyInterpreterState_New() to create the main interpreter. */ + if (_PySys_Audit(tstate, "cpython.PyInterpreterState_New", NULL) < 0) { + return NULL; + } - PyInterpreterState *interp = PyMem_RawCalloc(1, sizeof(PyInterpreterState)); + PyInterpreterState *interp = PyMem_RawCalloc(1, sizeof(PyInterpreterState)); if (interp == NULL) { return NULL; } interp->id_refcount = -1; - - /* Don't get runtime from tstate since tstate can be NULL */ - _PyRuntimeState *runtime = &_PyRuntime; - interp->runtime = runtime; - - if (_PyEval_InitState(&interp->ceval) < 0) { - goto out_of_memory; - } - - _PyGC_InitState(&interp->gc); - PyConfig_InitPythonConfig(&interp->config); - + + /* Don't get runtime from tstate since tstate can be NULL */ + _PyRuntimeState *runtime = &_PyRuntime; + interp->runtime = runtime; + + if (_PyEval_InitState(&interp->ceval) < 0) { + goto out_of_memory; + } + + _PyGC_InitState(&interp->gc); + PyConfig_InitPythonConfig(&interp->config); + interp->eval_frame = _PyEval_EvalFrameDefault; #ifdef HAVE_DLOPEN #if HAVE_DECL_RTLD_NOW @@ -233,70 +233,70 @@ PyInterpreterState_New(void) #endif #endif - struct pyinterpreters *interpreters = &runtime->interpreters; - - HEAD_LOCK(runtime); - if (interpreters->next_id < 0) { + struct pyinterpreters *interpreters = &runtime->interpreters; + + HEAD_LOCK(runtime); + if (interpreters->next_id < 0) { /* overflow or Py_Initialize() not called! */ - if (tstate != NULL) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "failed to get an interpreter ID"); - } - PyMem_RawFree(interp); + if (tstate != NULL) { + _PyErr_SetString(tstate, PyExc_RuntimeError, + "failed to get an interpreter ID"); + } + PyMem_RawFree(interp); interp = NULL; - } - else { - interp->id = interpreters->next_id; - interpreters->next_id += 1; - interp->next = interpreters->head; - if (interpreters->main == NULL) { - interpreters->main = interp; - } - interpreters->head = interp; - } - HEAD_UNLOCK(runtime); - - if (interp == NULL) { - return NULL; - } - + } + else { + interp->id = interpreters->next_id; + interpreters->next_id += 1; + interp->next = interpreters->head; + if (interpreters->main == NULL) { + interpreters->main = interp; + } + interpreters->head = interp; + } + HEAD_UNLOCK(runtime); + + if (interp == NULL) { + return NULL; + } + interp->tstate_next_unique_id = 0; - interp->audit_hooks = NULL; - + interp->audit_hooks = NULL; + return interp; - -out_of_memory: - if (tstate != NULL) { - _PyErr_NoMemory(tstate); - } - - PyMem_RawFree(interp); - return NULL; -} - - -void -PyInterpreterState_Clear(PyInterpreterState *interp) -{ - _PyRuntimeState *runtime = interp->runtime; - - /* Use the current Python thread state to call audit hooks, - not the current Python thread state of 'interp'. */ - PyThreadState *tstate = _PyThreadState_GET(); - if (_PySys_Audit(tstate, "cpython.PyInterpreterState_Clear", NULL) < 0) { - _PyErr_Clear(tstate); - } - - HEAD_LOCK(runtime); - for (PyThreadState *p = interp->tstate_head; p != NULL; p = p->next) { + +out_of_memory: + if (tstate != NULL) { + _PyErr_NoMemory(tstate); + } + + PyMem_RawFree(interp); + return NULL; +} + + +void +PyInterpreterState_Clear(PyInterpreterState *interp) +{ + _PyRuntimeState *runtime = interp->runtime; + + /* Use the current Python thread state to call audit hooks, + not the current Python thread state of 'interp'. */ + PyThreadState *tstate = _PyThreadState_GET(); + if (_PySys_Audit(tstate, "cpython.PyInterpreterState_Clear", NULL) < 0) { + _PyErr_Clear(tstate); + } + + HEAD_LOCK(runtime); + for (PyThreadState *p = interp->tstate_head; p != NULL; p = p->next) { PyThreadState_Clear(p); - } - HEAD_UNLOCK(runtime); - - Py_CLEAR(interp->audit_hooks); - - PyConfig_Clear(&interp->config); + } + HEAD_UNLOCK(runtime); + + Py_CLEAR(interp->audit_hooks); + + PyConfig_Clear(&interp->config); Py_CLEAR(interp->codec_search_path); Py_CLEAR(interp->codec_search_cache); Py_CLEAR(interp->codec_error_registry); @@ -307,68 +307,68 @@ PyInterpreterState_Clear(PyInterpreterState *interp) Py_CLEAR(interp->builtins_copy); Py_CLEAR(interp->importlib); Py_CLEAR(interp->import_func); - Py_CLEAR(interp->dict); + Py_CLEAR(interp->dict); #ifdef HAVE_FORK Py_CLEAR(interp->before_forkers); Py_CLEAR(interp->after_forkers_parent); Py_CLEAR(interp->after_forkers_child); #endif - if (_PyRuntimeState_GetFinalizing(runtime) == NULL) { - _PyWarnings_Fini(interp); - } - // XXX Once we have one allocator per interpreter (i.e. - // per-interpreter GC) we must ensure that all of the interpreter's - // objects have been cleaned up at the point. + if (_PyRuntimeState_GetFinalizing(runtime) == NULL) { + _PyWarnings_Fini(interp); + } + // XXX Once we have one allocator per interpreter (i.e. + // per-interpreter GC) we must ensure that all of the interpreter's + // objects have been cleaned up at the point. } static void -zapthreads(PyInterpreterState *interp, int check_current) +zapthreads(PyInterpreterState *interp, int check_current) { - PyThreadState *tstate; + PyThreadState *tstate; /* No need to lock the mutex here because this should only happen when the threads are all really dead (XXX famous last words). */ - while ((tstate = interp->tstate_head) != NULL) { - _PyThreadState_Delete(tstate, check_current); + while ((tstate = interp->tstate_head) != NULL) { + _PyThreadState_Delete(tstate, check_current); } } -void -PyInterpreterState_Delete(PyInterpreterState *interp) +void +PyInterpreterState_Delete(PyInterpreterState *interp) { - _PyRuntimeState *runtime = interp->runtime; - struct pyinterpreters *interpreters = &runtime->interpreters; - zapthreads(interp, 0); - - _PyEval_FiniState(&interp->ceval); - - /* Delete current thread. After this, many C API calls become crashy. */ - _PyThreadState_Swap(&runtime->gilstate, NULL); - - HEAD_LOCK(runtime); + _PyRuntimeState *runtime = interp->runtime; + struct pyinterpreters *interpreters = &runtime->interpreters; + zapthreads(interp, 0); + + _PyEval_FiniState(&interp->ceval); + + /* Delete current thread. After this, many C API calls become crashy. */ + _PyThreadState_Swap(&runtime->gilstate, NULL); + + HEAD_LOCK(runtime); PyInterpreterState **p; - for (p = &interpreters->head; ; p = &(*p)->next) { - if (*p == NULL) { - Py_FatalError("NULL interpreter"); - } - if (*p == interp) { + for (p = &interpreters->head; ; p = &(*p)->next) { + if (*p == NULL) { + Py_FatalError("NULL interpreter"); + } + if (*p == interp) { break; - } + } + } + if (interp->tstate_head != NULL) { + Py_FatalError("remaining threads"); } - if (interp->tstate_head != NULL) { - Py_FatalError("remaining threads"); - } *p = interp->next; - - if (interpreters->main == interp) { - interpreters->main = NULL; - if (interpreters->head != NULL) { - Py_FatalError("remaining subinterpreters"); - } - } - HEAD_UNLOCK(runtime); - + + if (interpreters->main == interp) { + interpreters->main = NULL; + if (interpreters->head != NULL) { + Py_FatalError("remaining subinterpreters"); + } + } + HEAD_UNLOCK(runtime); + if (interp->id_mutex != NULL) { PyThread_free_lock(interp->id_mutex); } @@ -376,63 +376,63 @@ PyInterpreterState_Delete(PyInterpreterState *interp) } -/* - * Delete all interpreter states except the main interpreter. If there - * is a current interpreter state, it *must* be the main interpreter. - */ -void -_PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime) -{ - struct _gilstate_runtime_state *gilstate = &runtime->gilstate; - struct pyinterpreters *interpreters = &runtime->interpreters; - - PyThreadState *tstate = _PyThreadState_Swap(gilstate, NULL); - if (tstate != NULL && tstate->interp != interpreters->main) { - Py_FatalError("not main interpreter"); - } - - HEAD_LOCK(runtime); - PyInterpreterState *interp = interpreters->head; - interpreters->head = NULL; - while (interp != NULL) { - if (interp == interpreters->main) { - interpreters->main->next = NULL; - interpreters->head = interp; - interp = interp->next; - continue; - } - - PyInterpreterState_Clear(interp); // XXX must activate? - zapthreads(interp, 1); - if (interp->id_mutex != NULL) { - PyThread_free_lock(interp->id_mutex); - } - PyInterpreterState *prev_interp = interp; - interp = interp->next; - PyMem_RawFree(prev_interp); - } - HEAD_UNLOCK(runtime); - - if (interpreters->head == NULL) { - Py_FatalError("missing main interpreter"); - } - _PyThreadState_Swap(gilstate, tstate); -} - - -PyInterpreterState * -PyInterpreterState_Get(void) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _Py_EnsureTstateNotNULL(tstate); - PyInterpreterState *interp = tstate->interp; - if (interp == NULL) { - Py_FatalError("no current interpreter"); - } - return interp; -} - - +/* + * Delete all interpreter states except the main interpreter. If there + * is a current interpreter state, it *must* be the main interpreter. + */ +void +_PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime) +{ + struct _gilstate_runtime_state *gilstate = &runtime->gilstate; + struct pyinterpreters *interpreters = &runtime->interpreters; + + PyThreadState *tstate = _PyThreadState_Swap(gilstate, NULL); + if (tstate != NULL && tstate->interp != interpreters->main) { + Py_FatalError("not main interpreter"); + } + + HEAD_LOCK(runtime); + PyInterpreterState *interp = interpreters->head; + interpreters->head = NULL; + while (interp != NULL) { + if (interp == interpreters->main) { + interpreters->main->next = NULL; + interpreters->head = interp; + interp = interp->next; + continue; + } + + PyInterpreterState_Clear(interp); // XXX must activate? + zapthreads(interp, 1); + if (interp->id_mutex != NULL) { + PyThread_free_lock(interp->id_mutex); + } + PyInterpreterState *prev_interp = interp; + interp = interp->next; + PyMem_RawFree(prev_interp); + } + HEAD_UNLOCK(runtime); + + if (interpreters->head == NULL) { + Py_FatalError("missing main interpreter"); + } + _PyThreadState_Swap(gilstate, tstate); +} + + +PyInterpreterState * +PyInterpreterState_Get(void) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _Py_EnsureTstateNotNULL(tstate); + PyInterpreterState *interp = tstate->interp; + if (interp == NULL) { + Py_FatalError("no current interpreter"); + } + return interp; +} + + int64_t PyInterpreterState_GetID(PyInterpreterState *interp) { @@ -444,41 +444,41 @@ PyInterpreterState_GetID(PyInterpreterState *interp) } -static PyInterpreterState * -interp_look_up_id(_PyRuntimeState *runtime, int64_t requested_id) +static PyInterpreterState * +interp_look_up_id(_PyRuntimeState *runtime, int64_t requested_id) { - PyInterpreterState *interp = runtime->interpreters.head; + PyInterpreterState *interp = runtime->interpreters.head; while (interp != NULL) { - int64_t id = PyInterpreterState_GetID(interp); - if (id < 0) { + int64_t id = PyInterpreterState_GetID(interp); + if (id < 0) { return NULL; - } - if (requested_id == id) { + } + if (requested_id == id) { return interp; - } + } interp = PyInterpreterState_Next(interp); } return NULL; } -PyInterpreterState * -_PyInterpreterState_LookUpID(int64_t requested_id) -{ - PyInterpreterState *interp = NULL; - if (requested_id >= 0) { - _PyRuntimeState *runtime = &_PyRuntime; - HEAD_LOCK(runtime); - interp = interp_look_up_id(runtime, requested_id); - HEAD_UNLOCK(runtime); - } - if (interp == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_RuntimeError, - "unrecognized interpreter ID %lld", requested_id); - } - return interp; -} - - +PyInterpreterState * +_PyInterpreterState_LookUpID(int64_t requested_id) +{ + PyInterpreterState *interp = NULL; + if (requested_id >= 0) { + _PyRuntimeState *runtime = &_PyRuntime; + HEAD_LOCK(runtime); + interp = interp_look_up_id(runtime, requested_id); + HEAD_UNLOCK(runtime); + } + if (interp == NULL && !PyErr_Occurred()) { + PyErr_Format(PyExc_RuntimeError, + "unrecognized interpreter ID %lld", requested_id); + } + return interp; +} + + int _PyInterpreterState_IDInitref(PyInterpreterState *interp) { @@ -514,122 +514,122 @@ _PyInterpreterState_IDDecref(PyInterpreterState *interp) if (interp->id_mutex == NULL) { return; } - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; PyThread_acquire_lock(interp->id_mutex, WAIT_LOCK); assert(interp->id_refcount != 0); interp->id_refcount -= 1; int64_t refcount = interp->id_refcount; PyThread_release_lock(interp->id_mutex); - if (refcount == 0 && interp->requires_idref) { + if (refcount == 0 && interp->requires_idref) { // XXX Using the "head" thread isn't strictly correct. PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); // XXX Possible GILState issues? - PyThreadState *save_tstate = _PyThreadState_Swap(gilstate, tstate); + PyThreadState *save_tstate = _PyThreadState_Swap(gilstate, tstate); Py_EndInterpreter(tstate); - _PyThreadState_Swap(gilstate, save_tstate); - } -} - -int -_PyInterpreterState_RequiresIDRef(PyInterpreterState *interp) -{ - return interp->requires_idref; -} - -void -_PyInterpreterState_RequireIDRef(PyInterpreterState *interp, int required) -{ - interp->requires_idref = required ? 1 : 0; -} - -PyObject * -_PyInterpreterState_GetMainModule(PyInterpreterState *interp) -{ - if (interp->modules == NULL) { - PyErr_SetString(PyExc_RuntimeError, "interpreter not initialized"); - return NULL; - } - return PyMapping_GetItemString(interp->modules, "__main__"); -} - -PyObject * -PyInterpreterState_GetDict(PyInterpreterState *interp) -{ - if (interp->dict == NULL) { - interp->dict = PyDict_New(); - if (interp->dict == NULL) { - PyErr_Clear(); - } - } - /* Returning NULL means no per-interpreter dict is available. */ - return interp->dict; -} - + _PyThreadState_Swap(gilstate, save_tstate); + } +} + +int +_PyInterpreterState_RequiresIDRef(PyInterpreterState *interp) +{ + return interp->requires_idref; +} + +void +_PyInterpreterState_RequireIDRef(PyInterpreterState *interp, int required) +{ + interp->requires_idref = required ? 1 : 0; +} + +PyObject * +_PyInterpreterState_GetMainModule(PyInterpreterState *interp) +{ + if (interp->modules == NULL) { + PyErr_SetString(PyExc_RuntimeError, "interpreter not initialized"); + return NULL; + } + return PyMapping_GetItemString(interp->modules, "__main__"); +} + +PyObject * +PyInterpreterState_GetDict(PyInterpreterState *interp) +{ + if (interp->dict == NULL) { + interp->dict = PyDict_New(); + if (interp->dict == NULL) { + PyErr_Clear(); + } + } + /* Returning NULL means no per-interpreter dict is available. */ + return interp->dict; +} + static PyThreadState * new_threadstate(PyInterpreterState *interp, int init) { - _PyRuntimeState *runtime = interp->runtime; + _PyRuntimeState *runtime = interp->runtime; PyThreadState *tstate = (PyThreadState *)PyMem_RawMalloc(sizeof(PyThreadState)); - if (tstate == NULL) { - return NULL; - } - - tstate->interp = interp; - - tstate->frame = NULL; - tstate->recursion_depth = 0; - tstate->overflowed = 0; - tstate->recursion_critical = 0; - tstate->stackcheck_counter = 0; - tstate->tracing = 0; - tstate->use_tracing = 0; - tstate->gilstate_counter = 0; - tstate->async_exc = NULL; - tstate->thread_id = PyThread_get_thread_ident(); - - tstate->dict = NULL; - - tstate->curexc_type = NULL; - tstate->curexc_value = NULL; - tstate->curexc_traceback = NULL; - - tstate->exc_state.exc_type = NULL; - tstate->exc_state.exc_value = NULL; - tstate->exc_state.exc_traceback = NULL; - tstate->exc_state.previous_item = NULL; - tstate->exc_info = &tstate->exc_state; - - tstate->c_profilefunc = NULL; - tstate->c_tracefunc = NULL; - tstate->c_profileobj = NULL; - tstate->c_traceobj = NULL; - - tstate->trash_delete_nesting = 0; - tstate->trash_delete_later = NULL; - tstate->on_delete = NULL; - tstate->on_delete_data = NULL; - - tstate->coroutine_origin_tracking_depth = 0; - - tstate->async_gen_firstiter = NULL; - tstate->async_gen_finalizer = NULL; - - tstate->context = NULL; - tstate->context_ver = 1; - - if (init) { - _PyThreadState_Init(tstate); - } - - HEAD_LOCK(runtime); - tstate->id = ++interp->tstate_next_unique_id; - tstate->prev = NULL; - tstate->next = interp->tstate_head; - if (tstate->next) - tstate->next->prev = tstate; - interp->tstate_head = tstate; - HEAD_UNLOCK(runtime); + if (tstate == NULL) { + return NULL; + } + + tstate->interp = interp; + + tstate->frame = NULL; + tstate->recursion_depth = 0; + tstate->overflowed = 0; + tstate->recursion_critical = 0; + tstate->stackcheck_counter = 0; + tstate->tracing = 0; + tstate->use_tracing = 0; + tstate->gilstate_counter = 0; + tstate->async_exc = NULL; + tstate->thread_id = PyThread_get_thread_ident(); + + tstate->dict = NULL; + + tstate->curexc_type = NULL; + tstate->curexc_value = NULL; + tstate->curexc_traceback = NULL; + + tstate->exc_state.exc_type = NULL; + tstate->exc_state.exc_value = NULL; + tstate->exc_state.exc_traceback = NULL; + tstate->exc_state.previous_item = NULL; + tstate->exc_info = &tstate->exc_state; + + tstate->c_profilefunc = NULL; + tstate->c_tracefunc = NULL; + tstate->c_profileobj = NULL; + tstate->c_traceobj = NULL; + + tstate->trash_delete_nesting = 0; + tstate->trash_delete_later = NULL; + tstate->on_delete = NULL; + tstate->on_delete_data = NULL; + + tstate->coroutine_origin_tracking_depth = 0; + + tstate->async_gen_firstiter = NULL; + tstate->async_gen_finalizer = NULL; + + tstate->context = NULL; + tstate->context_ver = 1; + + if (init) { + _PyThreadState_Init(tstate); + } + + HEAD_LOCK(runtime); + tstate->id = ++interp->tstate_next_unique_id; + tstate->prev = NULL; + tstate->next = interp->tstate_head; + if (tstate->next) + tstate->next->prev = tstate; + interp->tstate_head = tstate; + HEAD_UNLOCK(runtime); return tstate; } @@ -647,16 +647,16 @@ _PyThreadState_Prealloc(PyInterpreterState *interp) } void -_PyThreadState_Init(PyThreadState *tstate) +_PyThreadState_Init(PyThreadState *tstate) { - _PyGILState_NoteThreadState(&tstate->interp->runtime->gilstate, tstate); + _PyGILState_NoteThreadState(&tstate->interp->runtime->gilstate, tstate); } PyObject* PyState_FindModule(struct PyModuleDef* module) { Py_ssize_t index = module->m_base.m_index; - PyInterpreterState *state = _PyInterpreterState_GET(); + PyInterpreterState *state = _PyInterpreterState_GET(); PyObject *res; if (module->m_slots) { return NULL; @@ -672,35 +672,35 @@ PyState_FindModule(struct PyModuleDef* module) } int -_PyState_AddModule(PyThreadState *tstate, PyObject* module, struct PyModuleDef* def) +_PyState_AddModule(PyThreadState *tstate, PyObject* module, struct PyModuleDef* def) { if (!def) { - assert(_PyErr_Occurred(tstate)); + assert(_PyErr_Occurred(tstate)); return -1; } if (def->m_slots) { - _PyErr_SetString(tstate, - PyExc_SystemError, - "PyState_AddModule called on module with slots"); + _PyErr_SetString(tstate, + PyExc_SystemError, + "PyState_AddModule called on module with slots"); return -1; } - - PyInterpreterState *interp = tstate->interp; - if (!interp->modules_by_index) { - interp->modules_by_index = PyList_New(0); - if (!interp->modules_by_index) { + + PyInterpreterState *interp = tstate->interp; + if (!interp->modules_by_index) { + interp->modules_by_index = PyList_New(0); + if (!interp->modules_by_index) { return -1; - } + } } - - while (PyList_GET_SIZE(interp->modules_by_index) <= def->m_base.m_index) { - if (PyList_Append(interp->modules_by_index, Py_None) < 0) { + + while (PyList_GET_SIZE(interp->modules_by_index) <= def->m_base.m_index) { + if (PyList_Append(interp->modules_by_index, Py_None) < 0) { return -1; - } - } - + } + } + Py_INCREF(module); - return PyList_SetItem(interp->modules_by_index, + return PyList_SetItem(interp->modules_by_index, def->m_base.m_index, module); } @@ -708,98 +708,98 @@ int PyState_AddModule(PyObject* module, struct PyModuleDef* def) { if (!def) { - Py_FatalError("module definition is NULL"); + Py_FatalError("module definition is NULL"); return -1; } - - PyThreadState *tstate = _PyThreadState_GET(); - PyInterpreterState *interp = tstate->interp; - Py_ssize_t index = def->m_base.m_index; - if (interp->modules_by_index && - index < PyList_GET_SIZE(interp->modules_by_index) && - module == PyList_GET_ITEM(interp->modules_by_index, index)) - { - _Py_FatalErrorFormat(__func__, "module %p already added", module); - return -1; + + PyThreadState *tstate = _PyThreadState_GET(); + PyInterpreterState *interp = tstate->interp; + Py_ssize_t index = def->m_base.m_index; + if (interp->modules_by_index && + index < PyList_GET_SIZE(interp->modules_by_index) && + module == PyList_GET_ITEM(interp->modules_by_index, index)) + { + _Py_FatalErrorFormat(__func__, "module %p already added", module); + return -1; } - return _PyState_AddModule(tstate, module, def); + return _PyState_AddModule(tstate, module, def); } int PyState_RemoveModule(struct PyModuleDef* def) { - PyThreadState *tstate = _PyThreadState_GET(); - PyInterpreterState *interp = tstate->interp; - + PyThreadState *tstate = _PyThreadState_GET(); + PyInterpreterState *interp = tstate->interp; + if (def->m_slots) { - _PyErr_SetString(tstate, - PyExc_SystemError, - "PyState_RemoveModule called on module with slots"); + _PyErr_SetString(tstate, + PyExc_SystemError, + "PyState_RemoveModule called on module with slots"); return -1; } - - Py_ssize_t index = def->m_base.m_index; + + Py_ssize_t index = def->m_base.m_index; if (index == 0) { - Py_FatalError("invalid module index"); + Py_FatalError("invalid module index"); } - if (interp->modules_by_index == NULL) { - Py_FatalError("Interpreters module-list not accessible."); + if (interp->modules_by_index == NULL) { + Py_FatalError("Interpreters module-list not accessible."); } - if (index > PyList_GET_SIZE(interp->modules_by_index)) { - Py_FatalError("Module index out of bounds."); + if (index > PyList_GET_SIZE(interp->modules_by_index)) { + Py_FatalError("Module index out of bounds."); } - + Py_INCREF(Py_None); - return PyList_SetItem(interp->modules_by_index, index, Py_None); + return PyList_SetItem(interp->modules_by_index, index, Py_None); } -/* Used by PyImport_Cleanup() */ +/* Used by PyImport_Cleanup() */ void -_PyInterpreterState_ClearModules(PyInterpreterState *interp) -{ - if (!interp->modules_by_index) { - return; - } - - Py_ssize_t i; - for (i = 0; i < PyList_GET_SIZE(interp->modules_by_index); i++) { - PyObject *m = PyList_GET_ITEM(interp->modules_by_index, i); - if (PyModule_Check(m)) { - /* cleanup the saved copy of module dicts */ - PyModuleDef *md = PyModule_GetDef(m); - if (md) { - Py_CLEAR(md->m_base.m_copy); +_PyInterpreterState_ClearModules(PyInterpreterState *interp) +{ + if (!interp->modules_by_index) { + return; + } + + Py_ssize_t i; + for (i = 0; i < PyList_GET_SIZE(interp->modules_by_index); i++) { + PyObject *m = PyList_GET_ITEM(interp->modules_by_index, i); + if (PyModule_Check(m)) { + /* cleanup the saved copy of module dicts */ + PyModuleDef *md = PyModule_GetDef(m); + if (md) { + Py_CLEAR(md->m_base.m_copy); } } } - - /* Setting modules_by_index to NULL could be dangerous, so we - clear the list instead. */ - if (PyList_SetSlice(interp->modules_by_index, - 0, PyList_GET_SIZE(interp->modules_by_index), - NULL)) { - PyErr_WriteUnraisable(interp->modules_by_index); - } + + /* Setting modules_by_index to NULL could be dangerous, so we + clear the list instead. */ + if (PyList_SetSlice(interp->modules_by_index, + 0, PyList_GET_SIZE(interp->modules_by_index), + NULL)) { + PyErr_WriteUnraisable(interp->modules_by_index); + } } void PyThreadState_Clear(PyThreadState *tstate) { - int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; - - if (verbose && tstate->frame != NULL) { - /* bpo-20526: After the main thread calls - _PyRuntimeState_SetFinalizing() in Py_FinalizeEx(), threads must - exit when trying to take the GIL. If a thread exit in the middle of - _PyEval_EvalFrameDefault(), tstate->frame is not reset to its - previous value. It is more likely with daemon threads, but it can - happen with regular threads if threading._shutdown() fails - (ex: interrupted by CTRL+C). */ + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; + + if (verbose && tstate->frame != NULL) { + /* bpo-20526: After the main thread calls + _PyRuntimeState_SetFinalizing() in Py_FinalizeEx(), threads must + exit when trying to take the GIL. If a thread exit in the middle of + _PyEval_EvalFrameDefault(), tstate->frame is not reset to its + previous value. It is more likely with daemon threads, but it can + happen with regular threads if threading._shutdown() fails + (ex: interrupted by CTRL+C). */ fprintf(stderr, "PyThreadState_Clear: warning: thread still has a frame\n"); - } + } - /* Don't clear tstate->frame: it is a borrowed reference */ + /* Don't clear tstate->frame: it is a borrowed reference */ Py_CLEAR(tstate->dict); Py_CLEAR(tstate->async_exc); @@ -813,7 +813,7 @@ PyThreadState_Clear(PyThreadState *tstate) Py_CLEAR(tstate->exc_state.exc_traceback); /* The stack of exception states should contain just this thread. */ - if (verbose && tstate->exc_info != &tstate->exc_state) { + if (verbose && tstate->exc_info != &tstate->exc_state) { fprintf(stderr, "PyThreadState_Clear: warning: thread still has a generator\n"); } @@ -827,121 +827,121 @@ PyThreadState_Clear(PyThreadState *tstate) Py_CLEAR(tstate->async_gen_finalizer); Py_CLEAR(tstate->context); - - if (tstate->on_delete != NULL) { - tstate->on_delete(tstate->on_delete_data); - } + + if (tstate->on_delete != NULL) { + tstate->on_delete(tstate->on_delete_data); + } } /* Common code for PyThreadState_Delete() and PyThreadState_DeleteCurrent() */ static void -tstate_delete_common(PyThreadState *tstate, - struct _gilstate_runtime_state *gilstate) -{ - _Py_EnsureTstateNotNULL(tstate); - PyInterpreterState *interp = tstate->interp; - if (interp == NULL) { - Py_FatalError("NULL interpreter"); - } - _PyRuntimeState *runtime = interp->runtime; - - HEAD_LOCK(runtime); - if (tstate->prev) { +tstate_delete_common(PyThreadState *tstate, + struct _gilstate_runtime_state *gilstate) +{ + _Py_EnsureTstateNotNULL(tstate); + PyInterpreterState *interp = tstate->interp; + if (interp == NULL) { + Py_FatalError("NULL interpreter"); + } + _PyRuntimeState *runtime = interp->runtime; + + HEAD_LOCK(runtime); + if (tstate->prev) { tstate->prev->next = tstate->next; - } - else { + } + else { interp->tstate_head = tstate->next; - } - if (tstate->next) { + } + if (tstate->next) { tstate->next->prev = tstate->prev; - } - HEAD_UNLOCK(runtime); - - if (gilstate->autoInterpreterState && - PyThread_tss_get(&gilstate->autoTSSkey) == tstate) - { - PyThread_tss_set(&gilstate->autoTSSkey, NULL); + } + HEAD_UNLOCK(runtime); + + if (gilstate->autoInterpreterState && + PyThread_tss_get(&gilstate->autoTSSkey) == tstate) + { + PyThread_tss_set(&gilstate->autoTSSkey, NULL); } } -static void -_PyThreadState_Delete(PyThreadState *tstate, int check_current) +static void +_PyThreadState_Delete(PyThreadState *tstate, int check_current) { - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - if (check_current) { - if (tstate == _PyRuntimeGILState_GetThreadState(gilstate)) { - _Py_FatalErrorFormat(__func__, "tstate %p is still current", tstate); - } - } - tstate_delete_common(tstate, gilstate); - PyMem_RawFree(tstate); + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + if (check_current) { + if (tstate == _PyRuntimeGILState_GetThreadState(gilstate)) { + _Py_FatalErrorFormat(__func__, "tstate %p is still current", tstate); + } + } + tstate_delete_common(tstate, gilstate); + PyMem_RawFree(tstate); } void -PyThreadState_Delete(PyThreadState *tstate) -{ - _PyThreadState_Delete(tstate, 1); -} - - -void -_PyThreadState_DeleteCurrent(PyThreadState *tstate) -{ - _Py_EnsureTstateNotNULL(tstate); - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - tstate_delete_common(tstate, gilstate); - _PyRuntimeGILState_SetThreadState(gilstate, NULL); - _PyEval_ReleaseLock(tstate); - PyMem_RawFree(tstate); -} - -void -PyThreadState_DeleteCurrent(void) -{ - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; - PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); - _PyThreadState_DeleteCurrent(tstate); -} - - +PyThreadState_Delete(PyThreadState *tstate) +{ + _PyThreadState_Delete(tstate, 1); +} + + +void +_PyThreadState_DeleteCurrent(PyThreadState *tstate) +{ + _Py_EnsureTstateNotNULL(tstate); + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + tstate_delete_common(tstate, gilstate); + _PyRuntimeGILState_SetThreadState(gilstate, NULL); + _PyEval_ReleaseLock(tstate); + PyMem_RawFree(tstate); +} + +void +PyThreadState_DeleteCurrent(void) +{ + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); + _PyThreadState_DeleteCurrent(tstate); +} + + /* * Delete all thread states except the one passed as argument. * Note that, if there is a current thread state, it *must* be the one * passed as argument. Also, this won't touch any other interpreters * than the current one, since we don't know which thread state should - * be kept in those other interpreters. + * be kept in those other interpreters. */ void -_PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate) +_PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate) { PyInterpreterState *interp = tstate->interp; - - HEAD_LOCK(runtime); + + HEAD_LOCK(runtime); /* Remove all thread states, except tstate, from the linked list of thread states. This will allow calling PyThreadState_Clear() without holding the lock. */ - PyThreadState *list = interp->tstate_head; - if (list == tstate) { - list = tstate->next; - } - if (tstate->prev) { + PyThreadState *list = interp->tstate_head; + if (list == tstate) { + list = tstate->next; + } + if (tstate->prev) { tstate->prev->next = tstate->next; - } - if (tstate->next) { + } + if (tstate->next) { tstate->next->prev = tstate->prev; - } + } tstate->prev = tstate->next = NULL; interp->tstate_head = tstate; - HEAD_UNLOCK(runtime); - + HEAD_UNLOCK(runtime); + /* Clear and deallocate all stale thread states. Even if this executes Python code, we should be safe since it executes in the current thread, not one of the stale threads. */ - PyThreadState *p, *next; - for (p = list; p; p = next) { + PyThreadState *p, *next; + for (p = list; p; p = next) { next = p->next; PyThreadState_Clear(p); PyMem_RawFree(p); @@ -952,25 +952,25 @@ _PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate) PyThreadState * _PyThreadState_UncheckedGet(void) { - return _PyThreadState_GET(); + return _PyThreadState_GET(); } PyThreadState * PyThreadState_Get(void) { - PyThreadState *tstate = _PyThreadState_GET(); - _Py_EnsureTstateNotNULL(tstate); + PyThreadState *tstate = _PyThreadState_GET(); + _Py_EnsureTstateNotNULL(tstate); return tstate; } PyThreadState * -_PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *newts) +_PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *newts) { - PyThreadState *oldts = _PyRuntimeGILState_GetThreadState(gilstate); + PyThreadState *oldts = _PyRuntimeGILState_GetThreadState(gilstate); - _PyRuntimeGILState_SetThreadState(gilstate, newts); + _PyRuntimeGILState_SetThreadState(gilstate, newts); /* It should not be possible for more than one thread state to be used for a thread. Check this the best we can in debug builds. @@ -981,7 +981,7 @@ _PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *new to it, we need to ensure errno doesn't change. */ int err = errno; - PyThreadState *check = _PyGILState_GetThisThreadState(gilstate); + PyThreadState *check = _PyGILState_GetThisThreadState(gilstate); if (check && check->interp == newts->interp && check != newts) Py_FatalError("Invalid thread state for this thread"); errno = err; @@ -990,12 +990,12 @@ _PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *new return oldts; } -PyThreadState * -PyThreadState_Swap(PyThreadState *newts) -{ - return _PyThreadState_Swap(&_PyRuntime.gilstate, newts); -} - +PyThreadState * +PyThreadState_Swap(PyThreadState *newts) +{ + return _PyThreadState_Swap(&_PyRuntime.gilstate, newts); +} + /* An extension mechanism to store arbitrary additional per-thread state. PyThreadState_GetDict() returns a dictionary that can be used to hold such state; the caller should pick a unique key and store its state there. If @@ -1003,56 +1003,56 @@ PyThreadState_Swap(PyThreadState *newts) and the caller should assume no per-thread state is available. */ PyObject * -_PyThreadState_GetDict(PyThreadState *tstate) -{ - assert(tstate != NULL); - if (tstate->dict == NULL) { - tstate->dict = PyDict_New(); - if (tstate->dict == NULL) { - _PyErr_Clear(tstate); - } - } - return tstate->dict; -} - - -PyObject * +_PyThreadState_GetDict(PyThreadState *tstate) +{ + assert(tstate != NULL); + if (tstate->dict == NULL) { + tstate->dict = PyDict_New(); + if (tstate->dict == NULL) { + _PyErr_Clear(tstate); + } + } + return tstate->dict; +} + + +PyObject * PyThreadState_GetDict(void) { - PyThreadState *tstate = _PyThreadState_GET(); - if (tstate == NULL) { + PyThreadState *tstate = _PyThreadState_GET(); + if (tstate == NULL) { return NULL; } - return _PyThreadState_GetDict(tstate); -} - - -PyInterpreterState * -PyThreadState_GetInterpreter(PyThreadState *tstate) -{ - assert(tstate != NULL); - return tstate->interp; -} - - -PyFrameObject* -PyThreadState_GetFrame(PyThreadState *tstate) -{ - assert(tstate != NULL); - PyFrameObject *frame = tstate->frame; - Py_XINCREF(frame); - return frame; -} - - -uint64_t -PyThreadState_GetID(PyThreadState *tstate) -{ - assert(tstate != NULL); - return tstate->id; -} - - + return _PyThreadState_GetDict(tstate); +} + + +PyInterpreterState * +PyThreadState_GetInterpreter(PyThreadState *tstate) +{ + assert(tstate != NULL); + return tstate->interp; +} + + +PyFrameObject* +PyThreadState_GetFrame(PyThreadState *tstate) +{ + assert(tstate != NULL); + PyFrameObject *frame = tstate->frame; + Py_XINCREF(frame); + return frame; +} + + +uint64_t +PyThreadState_GetID(PyThreadState *tstate) +{ + assert(tstate != NULL); + return tstate->id; +} + + /* Asynchronously raise an exception in a thread. Requested by Just van Rossum and Alex Martelli. To prevent naive misuse, you must write your own extension @@ -1064,8 +1064,8 @@ PyThreadState_GetID(PyThreadState *tstate) int PyThreadState_SetAsyncExc(unsigned long id, PyObject *exc) { - _PyRuntimeState *runtime = &_PyRuntime; - PyInterpreterState *interp = _PyRuntimeState_GetThreadState(runtime)->interp; + _PyRuntimeState *runtime = &_PyRuntime; + PyInterpreterState *interp = _PyRuntimeState_GetThreadState(runtime)->interp; /* Although the GIL is held, a few C API functions can be called * without the GIL held, and in particular some that create and @@ -1073,29 +1073,29 @@ PyThreadState_SetAsyncExc(unsigned long id, PyObject *exc) * list of thread states we're traversing, so to prevent that we lock * head_mutex for the duration. */ - HEAD_LOCK(runtime); - for (PyThreadState *tstate = interp->tstate_head; tstate != NULL; tstate = tstate->next) { - if (tstate->thread_id != id) { - continue; + HEAD_LOCK(runtime); + for (PyThreadState *tstate = interp->tstate_head; tstate != NULL; tstate = tstate->next) { + if (tstate->thread_id != id) { + continue; } - - /* Tricky: we need to decref the current value - * (if any) in tstate->async_exc, but that can in turn - * allow arbitrary Python code to run, including - * perhaps calls to this function. To prevent - * deadlock, we need to release head_mutex before - * the decref. - */ - PyObject *old_exc = tstate->async_exc; - Py_XINCREF(exc); - tstate->async_exc = exc; - HEAD_UNLOCK(runtime); - - Py_XDECREF(old_exc); - _PyEval_SignalAsyncExc(tstate); - return 1; - } - HEAD_UNLOCK(runtime); + + /* Tricky: we need to decref the current value + * (if any) in tstate->async_exc, but that can in turn + * allow arbitrary Python code to run, including + * perhaps calls to this function. To prevent + * deadlock, we need to release head_mutex before + * the decref. + */ + PyObject *old_exc = tstate->async_exc; + Py_XINCREF(exc); + tstate->async_exc = exc; + HEAD_UNLOCK(runtime); + + Py_XDECREF(old_exc); + _PyEval_SignalAsyncExc(tstate); + return 1; + } + HEAD_UNLOCK(runtime); return 0; } @@ -1138,15 +1138,15 @@ PyThreadState_Next(PyThreadState *tstate) { PyObject * _PyThread_CurrentFrames(void) { - PyThreadState *tstate = _PyThreadState_GET(); - if (_PySys_Audit(tstate, "sys._current_frames", NULL) < 0) { - return NULL; - } - - PyObject *result = PyDict_New(); - if (result == NULL) { + PyThreadState *tstate = _PyThreadState_GET(); + if (_PySys_Audit(tstate, "sys._current_frames", NULL) < 0) { + return NULL; + } + + PyObject *result = PyDict_New(); + if (result == NULL) { return NULL; - } + } /* for i in all interpreters: * for t in all of i's thread states: @@ -1154,34 +1154,34 @@ _PyThread_CurrentFrames(void) * Because these lists can mutate even when the GIL is held, we * need to grab head_mutex for the duration. */ - _PyRuntimeState *runtime = tstate->interp->runtime; - HEAD_LOCK(runtime); - PyInterpreterState *i; - for (i = runtime->interpreters.head; i != NULL; i = i->next) { + _PyRuntimeState *runtime = tstate->interp->runtime; + HEAD_LOCK(runtime); + PyInterpreterState *i; + for (i = runtime->interpreters.head; i != NULL; i = i->next) { PyThreadState *t; for (t = i->tstate_head; t != NULL; t = t->next) { - PyFrameObject *frame = t->frame; - if (frame == NULL) { + PyFrameObject *frame = t->frame; + if (frame == NULL) { continue; - } - PyObject *id = PyLong_FromUnsignedLong(t->thread_id); - if (id == NULL) { - goto fail; - } - int stat = PyDict_SetItem(result, id, (PyObject *)frame); + } + PyObject *id = PyLong_FromUnsignedLong(t->thread_id); + if (id == NULL) { + goto fail; + } + int stat = PyDict_SetItem(result, id, (PyObject *)frame); Py_DECREF(id); - if (stat < 0) { - goto fail; - } + if (stat < 0) { + goto fail; + } } } - goto done; - -fail: - Py_CLEAR(result); - -done: - HEAD_UNLOCK(runtime); + goto done; + +fail: + Py_CLEAR(result); + +done: + HEAD_UNLOCK(runtime); return result; } @@ -1199,38 +1199,38 @@ static int PyThreadState_IsCurrent(PyThreadState *tstate) { /* Must be the tstate for this thread */ - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; - assert(_PyGILState_GetThisThreadState(gilstate) == tstate); - return tstate == _PyRuntimeGILState_GetThreadState(gilstate); + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + assert(_PyGILState_GetThisThreadState(gilstate) == tstate); + return tstate == _PyRuntimeGILState_GetThreadState(gilstate); } /* Internal initialization/finalization functions called by Py_Initialize/Py_FinalizeEx */ -PyStatus -_PyGILState_Init(PyThreadState *tstate) -{ - if (!_Py_IsMainInterpreter(tstate)) { - /* Currently, PyGILState is shared by all interpreters. The main - * interpreter is responsible to initialize it. */ - return _PyStatus_OK(); - } - - /* must init with valid states */ - assert(tstate != NULL); - assert(tstate->interp != NULL); - - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - - if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { - return _PyStatus_NO_MEMORY(); - } - gilstate->autoInterpreterState = tstate->interp; - assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL); - assert(tstate->gilstate_counter == 0); - - _PyGILState_NoteThreadState(gilstate, tstate); - return _PyStatus_OK(); +PyStatus +_PyGILState_Init(PyThreadState *tstate) +{ + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, PyGILState is shared by all interpreters. The main + * interpreter is responsible to initialize it. */ + return _PyStatus_OK(); + } + + /* must init with valid states */ + assert(tstate != NULL); + assert(tstate->interp != NULL); + + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + + if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { + return _PyStatus_NO_MEMORY(); + } + gilstate->autoInterpreterState = tstate->interp; + assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL); + assert(tstate->gilstate_counter == 0); + + _PyGILState_NoteThreadState(gilstate, tstate); + return _PyStatus_OK(); } PyInterpreterState * @@ -1240,11 +1240,11 @@ _PyGILState_GetInterpreterStateUnsafe(void) } void -_PyGILState_Fini(PyThreadState *tstate) +_PyGILState_Fini(PyThreadState *tstate) { - struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - PyThread_tss_delete(&gilstate->autoTSSkey); - gilstate->autoInterpreterState = NULL; + struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; + PyThread_tss_delete(&gilstate->autoTSSkey); + gilstate->autoInterpreterState = NULL; } /* Reset the TSS key - called by PyOS_AfterFork_Child(). @@ -1252,20 +1252,20 @@ _PyGILState_Fini(PyThreadState *tstate) * don't reset TSS upon fork(), see issue #10517. */ void -_PyGILState_Reinit(_PyRuntimeState *runtime) +_PyGILState_Reinit(_PyRuntimeState *runtime) { - struct _gilstate_runtime_state *gilstate = &runtime->gilstate; - PyThreadState *tstate = _PyGILState_GetThisThreadState(gilstate); + struct _gilstate_runtime_state *gilstate = &runtime->gilstate; + PyThreadState *tstate = _PyGILState_GetThisThreadState(gilstate); - PyThread_tss_delete(&gilstate->autoTSSkey); - if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { + PyThread_tss_delete(&gilstate->autoTSSkey); + if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { Py_FatalError("Could not allocate TSS entry"); } /* If the thread had an associated auto thread state, reassociate it with * the new key. */ if (tstate && - PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate) != 0) + PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate) != 0) { Py_FatalError("Couldn't create autoTSSkey mapping"); } @@ -1277,14 +1277,14 @@ _PyGILState_Reinit(_PyRuntimeState *runtime) a better fix for SF bug #1010677 than the first one attempted). */ static void -_PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadState* tstate) +_PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadState* tstate) { /* If autoTSSkey isn't initialized, this must be the very first threadstate created in Py_Initialize(). Don't do anything for now (we'll be back here when _PyGILState_Init is called). */ - if (!gilstate->autoInterpreterState) { + if (!gilstate->autoInterpreterState) { return; - } + } /* Stick the thread state for this thread in thread specific storage. @@ -1298,8 +1298,8 @@ _PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadSt The first thread state created for that given OS level thread will "win", which seems reasonable behaviour. */ - if (PyThread_tss_get(&gilstate->autoTSSkey) == NULL) { - if ((PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate)) != 0) { + if (PyThread_tss_get(&gilstate->autoTSSkey) == NULL) { + if ((PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate)) != 0) { Py_FatalError("Couldn't create autoTSSkey mapping"); } } @@ -1309,65 +1309,65 @@ _PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadSt } /* The public functions */ -static PyThreadState * -_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate) -{ - if (gilstate->autoInterpreterState == NULL) - return NULL; - return (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); -} - +static PyThreadState * +_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate) +{ + if (gilstate->autoInterpreterState == NULL) + return NULL; + return (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); +} + PyThreadState * PyGILState_GetThisThreadState(void) { - return _PyGILState_GetThisThreadState(&_PyRuntime.gilstate); + return _PyGILState_GetThisThreadState(&_PyRuntime.gilstate); } int PyGILState_Check(void) { - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; - if (!gilstate->check_enabled) { + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + if (!gilstate->check_enabled) { return 1; - } + } - if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) { + if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) { return 1; } - PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); - if (tstate == NULL) { + PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); + if (tstate == NULL) { return 0; - } + } - return (tstate == _PyGILState_GetThisThreadState(gilstate)); + return (tstate == _PyGILState_GetThisThreadState(gilstate)); } PyGILState_STATE PyGILState_Ensure(void) { - _PyRuntimeState *runtime = &_PyRuntime; - struct _gilstate_runtime_state *gilstate = &runtime->gilstate; + _PyRuntimeState *runtime = &_PyRuntime; + struct _gilstate_runtime_state *gilstate = &runtime->gilstate; /* Note that we do not auto-init Python here - apart from potential races with 2 threads auto-initializing, pep-311 spells out other issues. Embedders are expected to have - called Py_Initialize(). */ - - /* Ensure that _PyEval_InitThreads() and _PyGILState_Init() have been - called by Py_Initialize() */ - assert(_PyEval_ThreadsInitialized(runtime)); - assert(gilstate->autoInterpreterState); - - PyThreadState *tcur = (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); - int current; + called Py_Initialize(). */ + + /* Ensure that _PyEval_InitThreads() and _PyGILState_Init() have been + called by Py_Initialize() */ + assert(_PyEval_ThreadsInitialized(runtime)); + assert(gilstate->autoInterpreterState); + + PyThreadState *tcur = (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); + int current; if (tcur == NULL) { - /* Create a new Python thread state for this thread */ - tcur = PyThreadState_New(gilstate->autoInterpreterState); - if (tcur == NULL) { + /* Create a new Python thread state for this thread */ + tcur = PyThreadState_New(gilstate->autoInterpreterState); + if (tcur == NULL) { Py_FatalError("Couldn't create thread-state for new thread"); - } - + } + /* This is our thread state! We'll need to delete it in the matching call to PyGILState_Release(). */ tcur->gilstate_counter = 0; @@ -1394,41 +1394,41 @@ PyGILState_Ensure(void) void PyGILState_Release(PyGILState_STATE oldstate) { - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate = PyThread_tss_get(&runtime->gilstate.autoTSSkey); - if (tstate == NULL) { + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate = PyThread_tss_get(&runtime->gilstate.autoTSSkey); + if (tstate == NULL) { Py_FatalError("auto-releasing thread-state, " "but no thread-state for this thread"); - } - + } + /* We must hold the GIL and have our thread state current */ /* XXX - remove the check - the assert should be fine, but while this is very new (April 2003), the extra check by release-only users can't hurt. */ - if (!PyThreadState_IsCurrent(tstate)) { - _Py_FatalErrorFormat(__func__, - "thread state %p must be current when releasing", - tstate); - } - assert(PyThreadState_IsCurrent(tstate)); - --tstate->gilstate_counter; - assert(tstate->gilstate_counter >= 0); /* illegal counter value */ + if (!PyThreadState_IsCurrent(tstate)) { + _Py_FatalErrorFormat(__func__, + "thread state %p must be current when releasing", + tstate); + } + assert(PyThreadState_IsCurrent(tstate)); + --tstate->gilstate_counter; + assert(tstate->gilstate_counter >= 0); /* illegal counter value */ /* If we're going to destroy this thread-state, we must * clear it while the GIL is held, as destructors may run. */ - if (tstate->gilstate_counter == 0) { + if (tstate->gilstate_counter == 0) { /* can't have been locked when we created it */ assert(oldstate == PyGILState_UNLOCKED); - PyThreadState_Clear(tstate); + PyThreadState_Clear(tstate); /* Delete the thread-state. Note this releases the GIL too! * It's vital that the GIL be held here, to avoid shutdown * races; see bugs 225673 and 1061968 (that nasty bug has a * habit of coming back). */ - assert(_PyRuntimeGILState_GetThreadState(&runtime->gilstate) == tstate); - _PyThreadState_DeleteCurrent(tstate); + assert(_PyRuntimeGILState_GetThreadState(&runtime->gilstate) == tstate); + _PyThreadState_DeleteCurrent(tstate); } /* Release the lock if necessary */ else if (oldstate == PyGILState_UNLOCKED) @@ -1436,398 +1436,398 @@ PyGILState_Release(PyGILState_STATE oldstate) } -/**************************/ -/* cross-interpreter data */ -/**************************/ - -/* cross-interpreter data */ - -crossinterpdatafunc _PyCrossInterpreterData_Lookup(PyObject *); - -/* This is a separate func from _PyCrossInterpreterData_Lookup in order - to keep the registry code separate. */ -static crossinterpdatafunc -_lookup_getdata(PyObject *obj) -{ - crossinterpdatafunc getdata = _PyCrossInterpreterData_Lookup(obj); - if (getdata == NULL && PyErr_Occurred() == 0) - PyErr_Format(PyExc_ValueError, - "%S does not support cross-interpreter data", obj); - return getdata; -} - -int -_PyObject_CheckCrossInterpreterData(PyObject *obj) -{ - crossinterpdatafunc getdata = _lookup_getdata(obj); - if (getdata == NULL) { - return -1; - } - return 0; -} - -static int -_check_xidata(PyThreadState *tstate, _PyCrossInterpreterData *data) -{ - // data->data can be anything, including NULL, so we don't check it. - - // data->obj may be NULL, so we don't check it. - - if (data->interp < 0) { - _PyErr_SetString(tstate, PyExc_SystemError, "missing interp"); - return -1; - } - - if (data->new_object == NULL) { - _PyErr_SetString(tstate, PyExc_SystemError, "missing new_object func"); - return -1; - } - - // data->free may be NULL, so we don't check it. - - return 0; -} - -int -_PyObject_GetCrossInterpreterData(PyObject *obj, _PyCrossInterpreterData *data) -{ - // PyThreadState_Get() aborts if tstate is NULL. - PyThreadState *tstate = PyThreadState_Get(); - PyInterpreterState *interp = tstate->interp; - - // Reset data before re-populating. - *data = (_PyCrossInterpreterData){0}; - data->free = PyMem_RawFree; // Set a default that may be overridden. - - // Call the "getdata" func for the object. - Py_INCREF(obj); - crossinterpdatafunc getdata = _lookup_getdata(obj); - if (getdata == NULL) { - Py_DECREF(obj); - return -1; - } - int res = getdata(obj, data); - Py_DECREF(obj); - if (res != 0) { - return -1; - } - - // Fill in the blanks and validate the result. - data->interp = interp->id; - if (_check_xidata(tstate, data) != 0) { - _PyCrossInterpreterData_Release(data); - return -1; - } - - return 0; -} - -static void -_release_xidata(void *arg) -{ - _PyCrossInterpreterData *data = (_PyCrossInterpreterData *)arg; - if (data->free != NULL) { - data->free(data->data); - } - Py_XDECREF(data->obj); -} - -static void -_call_in_interpreter(struct _gilstate_runtime_state *gilstate, - PyInterpreterState *interp, - void (*func)(void *), void *arg) -{ - /* We would use Py_AddPendingCall() if it weren't specific to the - * main interpreter (see bpo-33608). In the meantime we take a - * naive approach. - */ - PyThreadState *save_tstate = NULL; - if (interp != _PyRuntimeGILState_GetThreadState(gilstate)->interp) { - // XXX Using the "head" thread isn't strictly correct. - PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); - // XXX Possible GILState issues? - save_tstate = _PyThreadState_Swap(gilstate, tstate); - } - - func(arg); - - // Switch back. - if (save_tstate != NULL) { - _PyThreadState_Swap(gilstate, save_tstate); - } -} - -void -_PyCrossInterpreterData_Release(_PyCrossInterpreterData *data) -{ - if (data->data == NULL && data->obj == NULL) { - // Nothing to release! - return; - } - - // Switch to the original interpreter. - PyInterpreterState *interp = _PyInterpreterState_LookUpID(data->interp); - if (interp == NULL) { - // The interpreter was already destroyed. - if (data->free != NULL) { - // XXX Someone leaked some memory... - } - return; - } - - // "Release" the data and/or the object. - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; - _call_in_interpreter(gilstate, interp, _release_xidata, data); -} - -PyObject * -_PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *data) -{ - return data->new_object(data); -} - -/* registry of {type -> crossinterpdatafunc} */ - -/* For now we use a global registry of shareable classes. An - alternative would be to add a tp_* slot for a class's - crossinterpdatafunc. It would be simpler and more efficient. */ - -static int -_register_xidata(struct _xidregistry *xidregistry, PyTypeObject *cls, - crossinterpdatafunc getdata) -{ - // Note that we effectively replace already registered classes - // rather than failing. - struct _xidregitem *newhead = PyMem_RawMalloc(sizeof(struct _xidregitem)); - if (newhead == NULL) - return -1; - newhead->cls = cls; - newhead->getdata = getdata; - newhead->next = xidregistry->head; - xidregistry->head = newhead; - return 0; -} - -static void _register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry); - -int -_PyCrossInterpreterData_RegisterClass(PyTypeObject *cls, - crossinterpdatafunc getdata) -{ - if (!PyType_Check(cls)) { - PyErr_Format(PyExc_ValueError, "only classes may be registered"); - return -1; - } - if (getdata == NULL) { - PyErr_Format(PyExc_ValueError, "missing 'getdata' func"); - return -1; - } - - // Make sure the class isn't ever deallocated. - Py_INCREF((PyObject *)cls); - - struct _xidregistry *xidregistry = &_PyRuntime.xidregistry ; - PyThread_acquire_lock(xidregistry->mutex, WAIT_LOCK); - if (xidregistry->head == NULL) { - _register_builtins_for_crossinterpreter_data(xidregistry); - } - int res = _register_xidata(xidregistry, cls, getdata); - PyThread_release_lock(xidregistry->mutex); - return res; -} - -/* Cross-interpreter objects are looked up by exact match on the class. - We can reassess this policy when we move from a global registry to a - tp_* slot. */ - -crossinterpdatafunc -_PyCrossInterpreterData_Lookup(PyObject *obj) -{ - struct _xidregistry *xidregistry = &_PyRuntime.xidregistry ; - PyObject *cls = PyObject_Type(obj); - crossinterpdatafunc getdata = NULL; - PyThread_acquire_lock(xidregistry->mutex, WAIT_LOCK); - struct _xidregitem *cur = xidregistry->head; - if (cur == NULL) { - _register_builtins_for_crossinterpreter_data(xidregistry); - cur = xidregistry->head; - } - for(; cur != NULL; cur = cur->next) { - if (cur->cls == (PyTypeObject *)cls) { - getdata = cur->getdata; - break; - } - } - Py_DECREF(cls); - PyThread_release_lock(xidregistry->mutex); - return getdata; -} - -/* cross-interpreter data for builtin types */ - -struct _shared_bytes_data { - char *bytes; - Py_ssize_t len; -}; - -static PyObject * -_new_bytes_object(_PyCrossInterpreterData *data) -{ - struct _shared_bytes_data *shared = (struct _shared_bytes_data *)(data->data); - return PyBytes_FromStringAndSize(shared->bytes, shared->len); -} - -static int -_bytes_shared(PyObject *obj, _PyCrossInterpreterData *data) -{ - struct _shared_bytes_data *shared = PyMem_NEW(struct _shared_bytes_data, 1); - if (PyBytes_AsStringAndSize(obj, &shared->bytes, &shared->len) < 0) { - return -1; - } - data->data = (void *)shared; - Py_INCREF(obj); - data->obj = obj; // Will be "released" (decref'ed) when data released. - data->new_object = _new_bytes_object; - data->free = PyMem_Free; - return 0; -} - -struct _shared_str_data { - int kind; - const void *buffer; - Py_ssize_t len; -}; - -static PyObject * -_new_str_object(_PyCrossInterpreterData *data) -{ - struct _shared_str_data *shared = (struct _shared_str_data *)(data->data); - return PyUnicode_FromKindAndData(shared->kind, shared->buffer, shared->len); -} - -static int -_str_shared(PyObject *obj, _PyCrossInterpreterData *data) -{ - struct _shared_str_data *shared = PyMem_NEW(struct _shared_str_data, 1); - shared->kind = PyUnicode_KIND(obj); - shared->buffer = PyUnicode_DATA(obj); - shared->len = PyUnicode_GET_LENGTH(obj); - data->data = (void *)shared; - Py_INCREF(obj); - data->obj = obj; // Will be "released" (decref'ed) when data released. - data->new_object = _new_str_object; - data->free = PyMem_Free; - return 0; -} - -static PyObject * -_new_long_object(_PyCrossInterpreterData *data) -{ - return PyLong_FromSsize_t((Py_ssize_t)(data->data)); -} - -static int -_long_shared(PyObject *obj, _PyCrossInterpreterData *data) -{ - /* Note that this means the size of shareable ints is bounded by - * sys.maxsize. Hence on 32-bit architectures that is half the - * size of maximum shareable ints on 64-bit. - */ - Py_ssize_t value = PyLong_AsSsize_t(obj); - if (value == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) { - PyErr_SetString(PyExc_OverflowError, "try sending as bytes"); - } - return -1; - } - data->data = (void *)value; - data->obj = NULL; - data->new_object = _new_long_object; - data->free = NULL; - return 0; -} - -static PyObject * -_new_none_object(_PyCrossInterpreterData *data) -{ - // XXX Singleton refcounts are problematic across interpreters... - Py_INCREF(Py_None); - return Py_None; -} - -static int -_none_shared(PyObject *obj, _PyCrossInterpreterData *data) -{ - data->data = NULL; - // data->obj remains NULL - data->new_object = _new_none_object; - data->free = NULL; // There is nothing to free. - return 0; -} - -static void -_register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry) -{ - // None - if (_register_xidata(xidregistry, (PyTypeObject *)PyObject_Type(Py_None), _none_shared) != 0) { - Py_FatalError("could not register None for cross-interpreter sharing"); - } - - // int - if (_register_xidata(xidregistry, &PyLong_Type, _long_shared) != 0) { - Py_FatalError("could not register int for cross-interpreter sharing"); - } - - // bytes - if (_register_xidata(xidregistry, &PyBytes_Type, _bytes_shared) != 0) { - Py_FatalError("could not register bytes for cross-interpreter sharing"); - } - - // str - if (_register_xidata(xidregistry, &PyUnicode_Type, _str_shared) != 0) { - Py_FatalError("could not register str for cross-interpreter sharing"); - } -} - - -_PyFrameEvalFunction -_PyInterpreterState_GetEvalFrameFunc(PyInterpreterState *interp) -{ - return interp->eval_frame; -} - - -void -_PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp, - _PyFrameEvalFunction eval_frame) -{ - interp->eval_frame = eval_frame; -} - - -const PyConfig* -_PyInterpreterState_GetConfig(PyInterpreterState *interp) -{ - return &interp->config; -} - - -PyStatus -_PyInterpreterState_SetConfig(PyInterpreterState *interp, - const PyConfig *config) -{ - return _PyConfig_Copy(&interp->config, config); -} - - -const PyConfig* -_Py_GetConfig(void) -{ - assert(PyGILState_Check()); - PyThreadState *tstate = _PyThreadState_GET(); - return _PyInterpreterState_GetConfig(tstate->interp); -} - +/**************************/ +/* cross-interpreter data */ +/**************************/ + +/* cross-interpreter data */ + +crossinterpdatafunc _PyCrossInterpreterData_Lookup(PyObject *); + +/* This is a separate func from _PyCrossInterpreterData_Lookup in order + to keep the registry code separate. */ +static crossinterpdatafunc +_lookup_getdata(PyObject *obj) +{ + crossinterpdatafunc getdata = _PyCrossInterpreterData_Lookup(obj); + if (getdata == NULL && PyErr_Occurred() == 0) + PyErr_Format(PyExc_ValueError, + "%S does not support cross-interpreter data", obj); + return getdata; +} + +int +_PyObject_CheckCrossInterpreterData(PyObject *obj) +{ + crossinterpdatafunc getdata = _lookup_getdata(obj); + if (getdata == NULL) { + return -1; + } + return 0; +} + +static int +_check_xidata(PyThreadState *tstate, _PyCrossInterpreterData *data) +{ + // data->data can be anything, including NULL, so we don't check it. + + // data->obj may be NULL, so we don't check it. + + if (data->interp < 0) { + _PyErr_SetString(tstate, PyExc_SystemError, "missing interp"); + return -1; + } + + if (data->new_object == NULL) { + _PyErr_SetString(tstate, PyExc_SystemError, "missing new_object func"); + return -1; + } + + // data->free may be NULL, so we don't check it. + + return 0; +} + +int +_PyObject_GetCrossInterpreterData(PyObject *obj, _PyCrossInterpreterData *data) +{ + // PyThreadState_Get() aborts if tstate is NULL. + PyThreadState *tstate = PyThreadState_Get(); + PyInterpreterState *interp = tstate->interp; + + // Reset data before re-populating. + *data = (_PyCrossInterpreterData){0}; + data->free = PyMem_RawFree; // Set a default that may be overridden. + + // Call the "getdata" func for the object. + Py_INCREF(obj); + crossinterpdatafunc getdata = _lookup_getdata(obj); + if (getdata == NULL) { + Py_DECREF(obj); + return -1; + } + int res = getdata(obj, data); + Py_DECREF(obj); + if (res != 0) { + return -1; + } + + // Fill in the blanks and validate the result. + data->interp = interp->id; + if (_check_xidata(tstate, data) != 0) { + _PyCrossInterpreterData_Release(data); + return -1; + } + + return 0; +} + +static void +_release_xidata(void *arg) +{ + _PyCrossInterpreterData *data = (_PyCrossInterpreterData *)arg; + if (data->free != NULL) { + data->free(data->data); + } + Py_XDECREF(data->obj); +} + +static void +_call_in_interpreter(struct _gilstate_runtime_state *gilstate, + PyInterpreterState *interp, + void (*func)(void *), void *arg) +{ + /* We would use Py_AddPendingCall() if it weren't specific to the + * main interpreter (see bpo-33608). In the meantime we take a + * naive approach. + */ + PyThreadState *save_tstate = NULL; + if (interp != _PyRuntimeGILState_GetThreadState(gilstate)->interp) { + // XXX Using the "head" thread isn't strictly correct. + PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); + // XXX Possible GILState issues? + save_tstate = _PyThreadState_Swap(gilstate, tstate); + } + + func(arg); + + // Switch back. + if (save_tstate != NULL) { + _PyThreadState_Swap(gilstate, save_tstate); + } +} + +void +_PyCrossInterpreterData_Release(_PyCrossInterpreterData *data) +{ + if (data->data == NULL && data->obj == NULL) { + // Nothing to release! + return; + } + + // Switch to the original interpreter. + PyInterpreterState *interp = _PyInterpreterState_LookUpID(data->interp); + if (interp == NULL) { + // The interpreter was already destroyed. + if (data->free != NULL) { + // XXX Someone leaked some memory... + } + return; + } + + // "Release" the data and/or the object. + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + _call_in_interpreter(gilstate, interp, _release_xidata, data); +} + +PyObject * +_PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *data) +{ + return data->new_object(data); +} + +/* registry of {type -> crossinterpdatafunc} */ + +/* For now we use a global registry of shareable classes. An + alternative would be to add a tp_* slot for a class's + crossinterpdatafunc. It would be simpler and more efficient. */ + +static int +_register_xidata(struct _xidregistry *xidregistry, PyTypeObject *cls, + crossinterpdatafunc getdata) +{ + // Note that we effectively replace already registered classes + // rather than failing. + struct _xidregitem *newhead = PyMem_RawMalloc(sizeof(struct _xidregitem)); + if (newhead == NULL) + return -1; + newhead->cls = cls; + newhead->getdata = getdata; + newhead->next = xidregistry->head; + xidregistry->head = newhead; + return 0; +} + +static void _register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry); + +int +_PyCrossInterpreterData_RegisterClass(PyTypeObject *cls, + crossinterpdatafunc getdata) +{ + if (!PyType_Check(cls)) { + PyErr_Format(PyExc_ValueError, "only classes may be registered"); + return -1; + } + if (getdata == NULL) { + PyErr_Format(PyExc_ValueError, "missing 'getdata' func"); + return -1; + } + + // Make sure the class isn't ever deallocated. + Py_INCREF((PyObject *)cls); + + struct _xidregistry *xidregistry = &_PyRuntime.xidregistry ; + PyThread_acquire_lock(xidregistry->mutex, WAIT_LOCK); + if (xidregistry->head == NULL) { + _register_builtins_for_crossinterpreter_data(xidregistry); + } + int res = _register_xidata(xidregistry, cls, getdata); + PyThread_release_lock(xidregistry->mutex); + return res; +} + +/* Cross-interpreter objects are looked up by exact match on the class. + We can reassess this policy when we move from a global registry to a + tp_* slot. */ + +crossinterpdatafunc +_PyCrossInterpreterData_Lookup(PyObject *obj) +{ + struct _xidregistry *xidregistry = &_PyRuntime.xidregistry ; + PyObject *cls = PyObject_Type(obj); + crossinterpdatafunc getdata = NULL; + PyThread_acquire_lock(xidregistry->mutex, WAIT_LOCK); + struct _xidregitem *cur = xidregistry->head; + if (cur == NULL) { + _register_builtins_for_crossinterpreter_data(xidregistry); + cur = xidregistry->head; + } + for(; cur != NULL; cur = cur->next) { + if (cur->cls == (PyTypeObject *)cls) { + getdata = cur->getdata; + break; + } + } + Py_DECREF(cls); + PyThread_release_lock(xidregistry->mutex); + return getdata; +} + +/* cross-interpreter data for builtin types */ + +struct _shared_bytes_data { + char *bytes; + Py_ssize_t len; +}; + +static PyObject * +_new_bytes_object(_PyCrossInterpreterData *data) +{ + struct _shared_bytes_data *shared = (struct _shared_bytes_data *)(data->data); + return PyBytes_FromStringAndSize(shared->bytes, shared->len); +} + +static int +_bytes_shared(PyObject *obj, _PyCrossInterpreterData *data) +{ + struct _shared_bytes_data *shared = PyMem_NEW(struct _shared_bytes_data, 1); + if (PyBytes_AsStringAndSize(obj, &shared->bytes, &shared->len) < 0) { + return -1; + } + data->data = (void *)shared; + Py_INCREF(obj); + data->obj = obj; // Will be "released" (decref'ed) when data released. + data->new_object = _new_bytes_object; + data->free = PyMem_Free; + return 0; +} + +struct _shared_str_data { + int kind; + const void *buffer; + Py_ssize_t len; +}; + +static PyObject * +_new_str_object(_PyCrossInterpreterData *data) +{ + struct _shared_str_data *shared = (struct _shared_str_data *)(data->data); + return PyUnicode_FromKindAndData(shared->kind, shared->buffer, shared->len); +} + +static int +_str_shared(PyObject *obj, _PyCrossInterpreterData *data) +{ + struct _shared_str_data *shared = PyMem_NEW(struct _shared_str_data, 1); + shared->kind = PyUnicode_KIND(obj); + shared->buffer = PyUnicode_DATA(obj); + shared->len = PyUnicode_GET_LENGTH(obj); + data->data = (void *)shared; + Py_INCREF(obj); + data->obj = obj; // Will be "released" (decref'ed) when data released. + data->new_object = _new_str_object; + data->free = PyMem_Free; + return 0; +} + +static PyObject * +_new_long_object(_PyCrossInterpreterData *data) +{ + return PyLong_FromSsize_t((Py_ssize_t)(data->data)); +} + +static int +_long_shared(PyObject *obj, _PyCrossInterpreterData *data) +{ + /* Note that this means the size of shareable ints is bounded by + * sys.maxsize. Hence on 32-bit architectures that is half the + * size of maximum shareable ints on 64-bit. + */ + Py_ssize_t value = PyLong_AsSsize_t(obj); + if (value == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { + PyErr_SetString(PyExc_OverflowError, "try sending as bytes"); + } + return -1; + } + data->data = (void *)value; + data->obj = NULL; + data->new_object = _new_long_object; + data->free = NULL; + return 0; +} + +static PyObject * +_new_none_object(_PyCrossInterpreterData *data) +{ + // XXX Singleton refcounts are problematic across interpreters... + Py_INCREF(Py_None); + return Py_None; +} + +static int +_none_shared(PyObject *obj, _PyCrossInterpreterData *data) +{ + data->data = NULL; + // data->obj remains NULL + data->new_object = _new_none_object; + data->free = NULL; // There is nothing to free. + return 0; +} + +static void +_register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry) +{ + // None + if (_register_xidata(xidregistry, (PyTypeObject *)PyObject_Type(Py_None), _none_shared) != 0) { + Py_FatalError("could not register None for cross-interpreter sharing"); + } + + // int + if (_register_xidata(xidregistry, &PyLong_Type, _long_shared) != 0) { + Py_FatalError("could not register int for cross-interpreter sharing"); + } + + // bytes + if (_register_xidata(xidregistry, &PyBytes_Type, _bytes_shared) != 0) { + Py_FatalError("could not register bytes for cross-interpreter sharing"); + } + + // str + if (_register_xidata(xidregistry, &PyUnicode_Type, _str_shared) != 0) { + Py_FatalError("could not register str for cross-interpreter sharing"); + } +} + + +_PyFrameEvalFunction +_PyInterpreterState_GetEvalFrameFunc(PyInterpreterState *interp) +{ + return interp->eval_frame; +} + + +void +_PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp, + _PyFrameEvalFunction eval_frame) +{ + interp->eval_frame = eval_frame; +} + + +const PyConfig* +_PyInterpreterState_GetConfig(PyInterpreterState *interp) +{ + return &interp->config; +} + + +PyStatus +_PyInterpreterState_SetConfig(PyInterpreterState *interp, + const PyConfig *config) +{ + return _PyConfig_Copy(&interp->config, config); +} + + +const PyConfig* +_Py_GetConfig(void) +{ + assert(PyGILState_Check()); + PyThreadState *tstate = _PyThreadState_GET(); + return _PyInterpreterState_GetConfig(tstate->interp); +} + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python3/src/Python/pystrcmp.c b/contrib/tools/python3/src/Python/pystrcmp.c index 728ce79676..9224ce4c70 100644 --- a/contrib/tools/python3/src/Python/pystrcmp.c +++ b/contrib/tools/python3/src/Python/pystrcmp.c @@ -6,25 +6,25 @@ int PyOS_mystrnicmp(const char *s1, const char *s2, Py_ssize_t size) { - const unsigned char *p1, *p2; + const unsigned char *p1, *p2; if (size == 0) return 0; - p1 = (const unsigned char *)s1; - p2 = (const unsigned char *)s2; - for (; (--size > 0) && *p1 && *p2 && (tolower(*p1) == tolower(*p2)); - p1++, p2++) { - ; + p1 = (const unsigned char *)s1; + p2 = (const unsigned char *)s2; + for (; (--size > 0) && *p1 && *p2 && (tolower(*p1) == tolower(*p2)); + p1++, p2++) { + ; } - return tolower(*p1) - tolower(*p2); + return tolower(*p1) - tolower(*p2); } int PyOS_mystricmp(const char *s1, const char *s2) { - const unsigned char *p1 = (const unsigned char *)s1; - const unsigned char *p2 = (const unsigned char *)s2; - for (; *p1 && *p2 && (tolower(*p1) == tolower(*p2)); p1++, p2++) { + const unsigned char *p1 = (const unsigned char *)s1; + const unsigned char *p2 = (const unsigned char *)s2; + for (; *p1 && *p2 && (tolower(*p1) == tolower(*p2)); p1++, p2++) { ; } - return (tolower(*p1) - tolower(*p2)); + return (tolower(*p1) - tolower(*p2)); } diff --git a/contrib/tools/python3/src/Python/pystrhex.c b/contrib/tools/python3/src/Python/pystrhex.c index f467e23082..b74e57ad91 100644 --- a/contrib/tools/python3/src/Python/pystrhex.c +++ b/contrib/tools/python3/src/Python/pystrhex.c @@ -2,142 +2,142 @@ #include "Python.h" -#include "pystrhex.h" - +#include "pystrhex.h" + static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, - const PyObject* sep, int bytes_per_sep_group, - const int return_bytes) + const PyObject* sep, int bytes_per_sep_group, + const int return_bytes) { - assert(arglen >= 0); - - Py_UCS1 sep_char = 0; - if (sep) { - Py_ssize_t seplen = PyObject_Length((PyObject*)sep); - if (seplen < 0) { - return NULL; - } - if (seplen != 1) { - PyErr_SetString(PyExc_ValueError, "sep must be length 1."); - return NULL; - } - if (PyUnicode_Check(sep)) { - if (PyUnicode_READY(sep)) - return NULL; - if (PyUnicode_KIND(sep) != PyUnicode_1BYTE_KIND) { - PyErr_SetString(PyExc_ValueError, "sep must be ASCII."); - return NULL; - } - sep_char = PyUnicode_READ_CHAR(sep, 0); - } - else if (PyBytes_Check(sep)) { - sep_char = PyBytes_AS_STRING(sep)[0]; - } - else { - PyErr_SetString(PyExc_TypeError, "sep must be str or bytes."); - return NULL; - } - if (sep_char > 127 && !return_bytes) { - PyErr_SetString(PyExc_ValueError, "sep must be ASCII."); - return NULL; - } - } - else { - bytes_per_sep_group = 0; - } - - unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group); - Py_ssize_t resultlen = 0; - if (bytes_per_sep_group && arglen > 0) { - /* How many sep characters we'll be inserting. */ - resultlen = (arglen - 1) / abs_bytes_per_sep; - } - /* Bounds checking for our Py_ssize_t indices. */ - if (arglen >= PY_SSIZE_T_MAX / 2 - resultlen) { + assert(arglen >= 0); + + Py_UCS1 sep_char = 0; + if (sep) { + Py_ssize_t seplen = PyObject_Length((PyObject*)sep); + if (seplen < 0) { + return NULL; + } + if (seplen != 1) { + PyErr_SetString(PyExc_ValueError, "sep must be length 1."); + return NULL; + } + if (PyUnicode_Check(sep)) { + if (PyUnicode_READY(sep)) + return NULL; + if (PyUnicode_KIND(sep) != PyUnicode_1BYTE_KIND) { + PyErr_SetString(PyExc_ValueError, "sep must be ASCII."); + return NULL; + } + sep_char = PyUnicode_READ_CHAR(sep, 0); + } + else if (PyBytes_Check(sep)) { + sep_char = PyBytes_AS_STRING(sep)[0]; + } + else { + PyErr_SetString(PyExc_TypeError, "sep must be str or bytes."); + return NULL; + } + if (sep_char > 127 && !return_bytes) { + PyErr_SetString(PyExc_ValueError, "sep must be ASCII."); + return NULL; + } + } + else { + bytes_per_sep_group = 0; + } + + unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group); + Py_ssize_t resultlen = 0; + if (bytes_per_sep_group && arglen > 0) { + /* How many sep characters we'll be inserting. */ + resultlen = (arglen - 1) / abs_bytes_per_sep; + } + /* Bounds checking for our Py_ssize_t indices. */ + if (arglen >= PY_SSIZE_T_MAX / 2 - resultlen) { return PyErr_NoMemory(); - } - resultlen += arglen * 2; - - if ((size_t)abs_bytes_per_sep >= (size_t)arglen) { - bytes_per_sep_group = 0; - abs_bytes_per_sep = 0; - } - - PyObject *retval; - Py_UCS1 *retbuf; + } + resultlen += arglen * 2; + + if ((size_t)abs_bytes_per_sep >= (size_t)arglen) { + bytes_per_sep_group = 0; + abs_bytes_per_sep = 0; + } + + PyObject *retval; + Py_UCS1 *retbuf; if (return_bytes) { /* If _PyBytes_FromSize() were public we could avoid malloc+copy. */ - retval = PyBytes_FromStringAndSize(NULL, resultlen); - if (!retval) { - return NULL; - } - retbuf = (Py_UCS1 *)PyBytes_AS_STRING(retval); - } - else { - retval = PyUnicode_New(resultlen, 127); - if (!retval) { + retval = PyBytes_FromStringAndSize(NULL, resultlen); + if (!retval) { return NULL; - } + } + retbuf = (Py_UCS1 *)PyBytes_AS_STRING(retval); + } + else { + retval = PyUnicode_New(resultlen, 127); + if (!retval) { + return NULL; + } retbuf = PyUnicode_1BYTE_DATA(retval); } - /* Hexlify */ - Py_ssize_t i, j; - unsigned char c; - - if (bytes_per_sep_group == 0) { - for (i = j = 0; i < arglen; ++i) { - assert((j + 1) < resultlen); - c = argbuf[i]; - retbuf[j++] = Py_hexdigits[c >> 4]; - retbuf[j++] = Py_hexdigits[c & 0x0f]; - } - assert(j == resultlen); - } - else { - /* The number of complete chunk+sep periods */ - Py_ssize_t chunks = (arglen - 1) / abs_bytes_per_sep; - Py_ssize_t chunk; - unsigned int k; - - if (bytes_per_sep_group < 0) { - i = j = 0; - for (chunk = 0; chunk < chunks; chunk++) { - for (k = 0; k < abs_bytes_per_sep; k++) { - c = argbuf[i++]; - retbuf[j++] = Py_hexdigits[c >> 4]; - retbuf[j++] = Py_hexdigits[c & 0x0f]; - } - retbuf[j++] = sep_char; - } - while (i < arglen) { - c = argbuf[i++]; - retbuf[j++] = Py_hexdigits[c >> 4]; - retbuf[j++] = Py_hexdigits[c & 0x0f]; - } - assert(j == resultlen); - } - else { - i = arglen - 1; - j = resultlen - 1; - for (chunk = 0; chunk < chunks; chunk++) { - for (k = 0; k < abs_bytes_per_sep; k++) { - c = argbuf[i--]; - retbuf[j--] = Py_hexdigits[c & 0x0f]; - retbuf[j--] = Py_hexdigits[c >> 4]; - } - retbuf[j--] = sep_char; - } - while (i >= 0) { - c = argbuf[i--]; - retbuf[j--] = Py_hexdigits[c & 0x0f]; - retbuf[j--] = Py_hexdigits[c >> 4]; - } - assert(j == -1); - } + /* Hexlify */ + Py_ssize_t i, j; + unsigned char c; + + if (bytes_per_sep_group == 0) { + for (i = j = 0; i < arglen; ++i) { + assert((j + 1) < resultlen); + c = argbuf[i]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } + assert(j == resultlen); + } + else { + /* The number of complete chunk+sep periods */ + Py_ssize_t chunks = (arglen - 1) / abs_bytes_per_sep; + Py_ssize_t chunk; + unsigned int k; + + if (bytes_per_sep_group < 0) { + i = j = 0; + for (chunk = 0; chunk < chunks; chunk++) { + for (k = 0; k < abs_bytes_per_sep; k++) { + c = argbuf[i++]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } + retbuf[j++] = sep_char; + } + while (i < arglen) { + c = argbuf[i++]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } + assert(j == resultlen); + } + else { + i = arglen - 1; + j = resultlen - 1; + for (chunk = 0; chunk < chunks; chunk++) { + for (k = 0; k < abs_bytes_per_sep; k++) { + c = argbuf[i--]; + retbuf[j--] = Py_hexdigits[c & 0x0f]; + retbuf[j--] = Py_hexdigits[c >> 4]; + } + retbuf[j--] = sep_char; + } + while (i >= 0) { + c = argbuf[i--]; + retbuf[j--] = Py_hexdigits[c & 0x0f]; + retbuf[j--] = Py_hexdigits[c >> 4]; + } + assert(j == -1); + } } #ifdef Py_DEBUG - if (!return_bytes) { + if (!return_bytes) { assert(_PyUnicode_CheckConsistency(retval, 1)); } #endif @@ -145,28 +145,28 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, return retval; } -PyObject * _Py_strhex(const char* argbuf, const Py_ssize_t arglen) +PyObject * _Py_strhex(const char* argbuf, const Py_ssize_t arglen) +{ + return _Py_strhex_impl(argbuf, arglen, NULL, 0, 0); +} + +/* Same as above but returns a bytes() instead of str() to avoid the + * need to decode the str() when bytes are needed. */ +PyObject * _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen) +{ + return _Py_strhex_impl(argbuf, arglen, NULL, 0, 1); +} + +/* These variants include support for a separator between every N bytes: */ + +PyObject * _Py_strhex_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group) { - return _Py_strhex_impl(argbuf, arglen, NULL, 0, 0); + return _Py_strhex_impl(argbuf, arglen, sep, bytes_per_group, 0); } /* Same as above but returns a bytes() instead of str() to avoid the * need to decode the str() when bytes are needed. */ -PyObject * _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen) +PyObject * _Py_strhex_bytes_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group) { - return _Py_strhex_impl(argbuf, arglen, NULL, 0, 1); + return _Py_strhex_impl(argbuf, arglen, sep, bytes_per_group, 1); } - -/* These variants include support for a separator between every N bytes: */ - -PyObject * _Py_strhex_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group) -{ - return _Py_strhex_impl(argbuf, arglen, sep, bytes_per_group, 0); -} - -/* Same as above but returns a bytes() instead of str() to avoid the - * need to decode the str() when bytes are needed. */ -PyObject * _Py_strhex_bytes_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group) -{ - return _Py_strhex_impl(argbuf, arglen, sep, bytes_per_group, 1); -} diff --git a/contrib/tools/python3/src/Python/pystrtod.c b/contrib/tools/python3/src/Python/pystrtod.c index a0cfbdd33b..1c8202c776 100644 --- a/contrib/tools/python3/src/Python/pystrtod.c +++ b/contrib/tools/python3/src/Python/pystrtod.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-file-style: "python" -*- */ #include <Python.h> -#include "pycore_dtoa.h" +#include "pycore_dtoa.h" #include <locale.h> /* Case-insensitive string match used for nan and inf detection; t should be @@ -352,15 +352,15 @@ PyOS_string_to_double(const char *s, else if (!endptr && (fail_pos == s || *fail_pos != '\0')) PyErr_Format(PyExc_ValueError, "could not convert string to float: " - "'%.200s'", s); + "'%.200s'", s); else if (fail_pos == s) PyErr_Format(PyExc_ValueError, "could not convert string to float: " - "'%.200s'", s); + "'%.200s'", s); else if (errno == ERANGE && fabs(x) >= 1.0 && overflow_exception) PyErr_Format(overflow_exception, "value too large to convert to float: " - "'%.200s'", s); + "'%.200s'", s); else result = x; @@ -793,7 +793,7 @@ _PyOS_ascii_formatd(char *buffer, /* The fallback code to use if _Py_dg_dtoa is not available. */ -char * PyOS_double_to_string(double val, +char * PyOS_double_to_string(double val, char format_code, int precision, int flags, @@ -1240,7 +1240,7 @@ format_float_short(double d, char format_code, } -char * PyOS_double_to_string(double val, +char * PyOS_double_to_string(double val, char format_code, int precision, int flags, diff --git a/contrib/tools/python3/src/Python/pythonrun.c b/contrib/tools/python3/src/Python/pythonrun.c index 913cdece0a..364101e99d 100644 --- a/contrib/tools/python3/src/Python/pythonrun.c +++ b/contrib/tools/python3/src/Python/pythonrun.c @@ -2,7 +2,7 @@ /* Top level execution of Python code (including in __main__) */ /* To help control the interfaces between the startup, execution and - * shutdown code, the phases are split across separate modules (bootstrap, + * shutdown code, the phases are split across separate modules (bootstrap, * pythonrun, shutdown) */ @@ -11,37 +11,37 @@ #include "Python.h" #include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ - -#include "pycore_interp.h" // PyInterpreterState.importlib -#include "pycore_object.h" // _PyDebug_PrintTotalRefs(), - // _PyType_GetQualName() -#include "pycore_pyerrors.h" // _PyErr_Fetch -#include "pycore_pylifecycle.h" // _Py_UnhandledKeyboardInterrupt -#include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_sysmodule.h" // _PySys_Audit() - -#include "node.h" // node -#include "token.h" // INDENT -#include "parsetok.h" // perrdetail -#include "errcode.h" // E_EOF -#include "code.h" // PyCodeObject -#include "symtable.h" // PySymtable_BuildObject() -#include "ast.h" // PyAST_FromNodeObject() -#include "marshal.h" // PyMarshal_ReadLongFromFile() - -#include "pegen_interface.h" // PyPegen_ASTFrom* - +#undef Yield /* undefine macro conflicting with <winbase.h> */ + +#include "pycore_interp.h" // PyInterpreterState.importlib +#include "pycore_object.h" // _PyDebug_PrintTotalRefs(), + // _PyType_GetQualName() +#include "pycore_pyerrors.h" // _PyErr_Fetch +#include "pycore_pylifecycle.h" // _Py_UnhandledKeyboardInterrupt +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_sysmodule.h" // _PySys_Audit() + +#include "node.h" // node +#include "token.h" // INDENT +#include "parsetok.h" // perrdetail +#include "errcode.h" // E_EOF +#include "code.h" // PyCodeObject +#include "symtable.h" // PySymtable_BuildObject() +#include "ast.h" // PyAST_FromNodeObject() +#include "marshal.h" // PyMarshal_ReadLongFromFile() + +#include "pegen_interface.h" // PyPegen_ASTFrom* + #ifdef MS_WINDOWS -# include "malloc.h" // alloca() +# include "malloc.h" // alloca() #endif #ifdef MS_WINDOWS -# undef BYTE -# include "windows.h" +# undef BYTE +# include "windows.h" #endif - + _Py_IDENTIFIER(builtins); _Py_IDENTIFIER(excepthook); _Py_IDENTIFIER(flush); @@ -59,22 +59,22 @@ _Py_static_string(PyId_string, "<string>"); extern "C" { #endif -extern Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; /* From graminit.c */ +extern Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; /* From graminit.c */ /* Forward */ static void flush_io(void); static PyObject *run_mod(mod_ty, PyObject *, PyObject *, PyObject *, PyCompilerFlags *, PyArena *); -static PyObject *run_pyc_file(FILE *, PyObject *, PyObject *, +static PyObject *run_pyc_file(FILE *, PyObject *, PyObject *, PyCompilerFlags *); static void err_input(perrdetail *); static void err_free(perrdetail *); static int PyRun_InteractiveOneObjectEx(FILE *, PyObject *, PyCompilerFlags *); -static PyObject* pyrun_file(FILE *fp, PyObject *filename, int start, - PyObject *globals, PyObject *locals, int closeit, - PyCompilerFlags *flags); +static PyObject* pyrun_file(FILE *fp, PyObject *filename, int start, + PyObject *globals, PyObject *locals, int closeit, + PyCompilerFlags *flags); + - /* Parse input from a file and execute it */ int PyRun_AnyFileExFlags(FILE *fp, const char *filename, int closeit, @@ -97,10 +97,10 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags * { PyObject *filename, *v; int ret, err; - PyCompilerFlags local_flags = _PyCompilerFlags_INIT; + PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int nomem_count = 0; #ifdef Py_REF_DEBUG - int show_ref_count = _Py_GetConfig()->show_ref_count; + int show_ref_count = _Py_GetConfig()->show_ref_count; #endif filename = PyUnicode_DecodeFSDefault(filename_str); @@ -165,8 +165,8 @@ static int PARSER_FLAGS(PyCompilerFlags *flags) parser_flags |= PyPARSE_IGNORE_COOKIE; if (flags->cf_flags & CO_FUTURE_BARRY_AS_BDFL) parser_flags |= PyPARSE_BARRY_AS_BDFL; - if (flags->cf_flags & PyCF_TYPE_COMMENTS) - parser_flags |= PyPARSE_TYPE_COMMENTS; + if (flags->cf_flags & PyCF_TYPE_COMMENTS) + parser_flags |= PyPARSE_TYPE_COMMENTS; return parser_flags; } @@ -190,7 +190,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, PyArena *arena; const char *ps1 = "", *ps2 = "", *enc = NULL; int errcode = 0; - int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; _Py_IDENTIFIER(encoding); _Py_IDENTIFIER(__main__); @@ -243,17 +243,17 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, Py_XDECREF(oenc); return -1; } - - if (use_peg) { - mod = PyPegen_ASTFromFileObject(fp, filename, Py_single_input, - enc, ps1, ps2, flags, &errcode, arena); - } - else { - mod = PyParser_ASTFromFileObject(fp, filename, enc, - Py_single_input, ps1, ps2, - flags, &errcode, arena); - } - + + if (use_peg) { + mod = PyPegen_ASTFromFileObject(fp, filename, Py_single_input, + enc, ps1, ps2, flags, &errcode, arena); + } + else { + mod = PyParser_ASTFromFileObject(fp, filename, enc, + Py_single_input, ps1, ps2, + flags, &errcode, arena); + } + Py_XDECREF(v); Py_XDECREF(w); Py_XDECREF(oenc); @@ -315,86 +315,86 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename_str, PyCompilerFlags *f the file type, and, if we may close it, at the first few bytes. */ static int -maybe_pyc_file(FILE *fp, PyObject *filename, int closeit) -{ - PyObject *ext = PyUnicode_FromString(".pyc"); - if (ext == NULL) { - return -1; - } - Py_ssize_t endswith = PyUnicode_Tailmatch(filename, ext, 0, PY_SSIZE_T_MAX, +1); - Py_DECREF(ext); - if (endswith) { +maybe_pyc_file(FILE *fp, PyObject *filename, int closeit) +{ + PyObject *ext = PyUnicode_FromString(".pyc"); + if (ext == NULL) { + return -1; + } + Py_ssize_t endswith = PyUnicode_Tailmatch(filename, ext, 0, PY_SSIZE_T_MAX, +1); + Py_DECREF(ext); + if (endswith) { return 1; - } + } /* Only look into the file if we are allowed to close it, since it then should also be seekable. */ - if (!closeit) { - return 0; - } - - /* Read only two bytes of the magic. If the file was opened in - text mode, the bytes 3 and 4 of the magic (\r\n) might not - be read as they are on disk. */ - unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF; - unsigned char buf[2]; - /* Mess: In case of -x, the stream is NOT at its start now, - and ungetc() was used to push back the first newline, - which makes the current stream position formally undefined, - and a x-platform nightmare. - Unfortunately, we have no direct way to know whether -x - was specified. So we use a terrible hack: if the current - stream position is not 0, we assume -x was specified, and - give up. Bug 132850 on SourceForge spells out the - hopelessness of trying anything else (fseek and ftell - don't work predictably x-platform for text-mode files). - */ - int ispyc = 0; - if (ftell(fp) == 0) { - if (fread(buf, 1, 2, fp) == 2 && - ((unsigned int)buf[1]<<8 | buf[0]) == halfmagic) - ispyc = 1; - rewind(fp); - } - return ispyc; -} - - + if (!closeit) { + return 0; + } + + /* Read only two bytes of the magic. If the file was opened in + text mode, the bytes 3 and 4 of the magic (\r\n) might not + be read as they are on disk. */ + unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF; + unsigned char buf[2]; + /* Mess: In case of -x, the stream is NOT at its start now, + and ungetc() was used to push back the first newline, + which makes the current stream position formally undefined, + and a x-platform nightmare. + Unfortunately, we have no direct way to know whether -x + was specified. So we use a terrible hack: if the current + stream position is not 0, we assume -x was specified, and + give up. Bug 132850 on SourceForge spells out the + hopelessness of trying anything else (fseek and ftell + don't work predictably x-platform for text-mode files). + */ + int ispyc = 0; + if (ftell(fp) == 0) { + if (fread(buf, 1, 2, fp) == 2 && + ((unsigned int)buf[1]<<8 | buf[0]) == halfmagic) + ispyc = 1; + rewind(fp); + } + return ispyc; +} + + static int -set_main_loader(PyObject *d, PyObject *filename, const char *loader_name) +set_main_loader(PyObject *d, PyObject *filename, const char *loader_name) { - PyInterpreterState *interp = _PyInterpreterState_GET(); - PyObject *bootstrap = PyObject_GetAttrString(interp->importlib, - "_bootstrap_external"); - if (bootstrap == NULL) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + PyObject *bootstrap = PyObject_GetAttrString(interp->importlib, + "_bootstrap_external"); + if (bootstrap == NULL) { return -1; } - - PyObject *loader_type = PyObject_GetAttrString(bootstrap, loader_name); - Py_DECREF(bootstrap); + + PyObject *loader_type = PyObject_GetAttrString(bootstrap, loader_name); + Py_DECREF(bootstrap); if (loader_type == NULL) { return -1; } - - PyObject *loader = PyObject_CallFunction(loader_type, - "sO", "__main__", filename); + + PyObject *loader = PyObject_CallFunction(loader_type, + "sO", "__main__", filename); Py_DECREF(loader_type); if (loader == NULL) { return -1; } - + if (PyDict_SetItemString(d, "__loader__", loader) < 0) { - Py_DECREF(loader); - return -1; + Py_DECREF(loader); + return -1; } Py_DECREF(loader); - return 0; + return 0; } - -static int -pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, - PyCompilerFlags *flags) + +static int +pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, + PyCompilerFlags *flags) { PyObject *m, *d, *v; int set_file_name = 0, ret = -1; @@ -405,7 +405,7 @@ pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, Py_INCREF(m); d = PyModule_GetDict(m); if (PyDict_GetItemString(d, "__file__") == NULL) { - if (PyDict_SetItemString(d, "__file__", filename) < 0) { + if (PyDict_SetItemString(d, "__file__", filename) < 0) { goto done; } if (PyDict_SetItemString(d, "__cached__", Py_None) < 0) { @@ -413,21 +413,21 @@ pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, } set_file_name = 1; } - - int pyc = maybe_pyc_file(fp, filename, closeit); - if (pyc < 0) { - goto done; - } - - if (pyc) { + + int pyc = maybe_pyc_file(fp, filename, closeit); + if (pyc < 0) { + goto done; + } + + if (pyc) { FILE *pyc_fp; /* Try to run a pyc file. First, re-open in binary */ - if (closeit) { + if (closeit) { fclose(fp); - } - - pyc_fp = _Py_fopen_obj(filename, "rb"); - if (pyc_fp == NULL) { + } + + pyc_fp = _Py_fopen_obj(filename, "rb"); + if (pyc_fp == NULL) { fprintf(stderr, "python: Can't reopen .pyc file\n"); goto done; } @@ -438,17 +438,17 @@ pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, fclose(pyc_fp); goto done; } - v = run_pyc_file(pyc_fp, d, d, flags); + v = run_pyc_file(pyc_fp, d, d, flags); } else { /* When running from stdin, leave __main__.__loader__ alone */ - if (PyUnicode_CompareWithASCIIString(filename, "<stdin>") != 0 && + if (PyUnicode_CompareWithASCIIString(filename, "<stdin>") != 0 && set_main_loader(d, filename, "SourceFileLoader") < 0) { fprintf(stderr, "python: failed to set __main__.__loader__\n"); ret = -1; goto done; } - v = pyrun_file(fp, filename, Py_file_input, d, d, - closeit, flags); + v = pyrun_file(fp, filename, Py_file_input, d, d, + closeit, flags); } flush_io(); if (v == NULL) { @@ -459,34 +459,34 @@ pyrun_simple_file(FILE *fp, PyObject *filename, int closeit, Py_DECREF(v); ret = 0; done: - if (set_file_name) { - if (PyDict_DelItemString(d, "__file__")) { - PyErr_Clear(); - } - if (PyDict_DelItemString(d, "__cached__")) { - PyErr_Clear(); - } - } + if (set_file_name) { + if (PyDict_DelItemString(d, "__file__")) { + PyErr_Clear(); + } + if (PyDict_DelItemString(d, "__cached__")) { + PyErr_Clear(); + } + } Py_XDECREF(m); return ret; } - + +int +PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, + PyCompilerFlags *flags) +{ + PyObject *filename_obj = PyUnicode_DecodeFSDefault(filename); + if (filename_obj == NULL) { + return -1; + } + int res = pyrun_simple_file(fp, filename_obj, closeit, flags); + Py_DECREF(filename_obj); + return res; +} + + int -PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, - PyCompilerFlags *flags) -{ - PyObject *filename_obj = PyUnicode_DecodeFSDefault(filename); - if (filename_obj == NULL) { - return -1; - } - int res = pyrun_simple_file(fp, filename_obj, closeit, flags); - Py_DECREF(filename_obj); - return res; -} - - -int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags) { PyObject *m, *d, *v; @@ -505,9 +505,9 @@ PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags) static int parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename, - Py_ssize_t *lineno, Py_ssize_t *offset, PyObject **text) + Py_ssize_t *lineno, Py_ssize_t *offset, PyObject **text) { - Py_ssize_t hold; + Py_ssize_t hold; PyObject *v; _Py_IDENTIFIER(msg); _Py_IDENTIFIER(filename); @@ -540,7 +540,7 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename, v = _PyObject_GetAttrId(err, &PyId_lineno); if (!v) goto finally; - hold = PyLong_AsSsize_t(v); + hold = PyLong_AsSsize_t(v); Py_DECREF(v); if (hold < 0 && PyErr_Occurred()) goto finally; @@ -553,7 +553,7 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename, *offset = -1; Py_DECREF(v); } else { - hold = PyLong_AsSsize_t(v); + hold = PyLong_AsSsize_t(v); Py_DECREF(v); if (hold < 0 && PyErr_Occurred()) goto finally; @@ -579,95 +579,95 @@ finally: } static void -print_error_text(PyObject *f, Py_ssize_t offset, PyObject *text_obj) +print_error_text(PyObject *f, Py_ssize_t offset, PyObject *text_obj) { - /* Convert text to a char pointer; return if error */ - const char *text = PyUnicode_AsUTF8(text_obj); + /* Convert text to a char pointer; return if error */ + const char *text = PyUnicode_AsUTF8(text_obj); if (text == NULL) return; - /* Convert offset from 1-based to 0-based */ - offset--; - - /* Strip leading whitespace from text, adjusting offset as we go */ - while (*text == ' ' || *text == '\t' || *text == '\f') { - text++; - offset--; - } - - /* Calculate text length excluding trailing newline */ - Py_ssize_t len = strlen(text); - if (len > 0 && text[len-1] == '\n') { - len--; - } - - /* Clip offset to at most len */ - if (offset > len) { - offset = len; - } - - /* Skip past newlines embedded in text */ - for (;;) { - const char *nl = strchr(text, '\n'); - if (nl == NULL) { - break; + /* Convert offset from 1-based to 0-based */ + offset--; + + /* Strip leading whitespace from text, adjusting offset as we go */ + while (*text == ' ' || *text == '\t' || *text == '\f') { + text++; + offset--; + } + + /* Calculate text length excluding trailing newline */ + Py_ssize_t len = strlen(text); + if (len > 0 && text[len-1] == '\n') { + len--; + } + + /* Clip offset to at most len */ + if (offset > len) { + offset = len; + } + + /* Skip past newlines embedded in text */ + for (;;) { + const char *nl = strchr(text, '\n'); + if (nl == NULL) { + break; } - Py_ssize_t inl = nl - text; - if (inl >= offset) { - break; + Py_ssize_t inl = nl - text; + if (inl >= offset) { + break; } - inl += 1; - text += inl; - len -= inl; - offset -= (int)inl; + inl += 1; + text += inl; + len -= inl; + offset -= (int)inl; } - - /* Print text */ + + /* Print text */ PyFile_WriteString(" ", f); PyFile_WriteString(text, f); - - /* Make sure there's a newline at the end */ - if (text[len] != '\n') { + + /* Make sure there's a newline at the end */ + if (text[len] != '\n') { PyFile_WriteString("\n", f); - } - - /* Don't print caret if it points to the left of the text */ - if (offset < 0) + } + + /* Don't print caret if it points to the left of the text */ + if (offset < 0) return; - - /* Write caret line */ + + /* Write caret line */ PyFile_WriteString(" ", f); - while (--offset >= 0) { + while (--offset >= 0) { PyFile_WriteString(" ", f); - } + } PyFile_WriteString("^\n", f); } - -int -_Py_HandleSystemExit(int *exitcode_p) + +int +_Py_HandleSystemExit(int *exitcode_p) { - int inspect = _Py_GetConfig()->inspect; - if (inspect) { + int inspect = _Py_GetConfig()->inspect; + if (inspect) { /* Don't exit if -i flag was given. This flag is set to 0 * when entering interactive mode for inspecting. */ - return 0; - } - - if (!PyErr_ExceptionMatches(PyExc_SystemExit)) { - return 0; - } - - PyObject *exception, *value, *tb; + return 0; + } + + if (!PyErr_ExceptionMatches(PyExc_SystemExit)) { + return 0; + } + + PyObject *exception, *value, *tb; PyErr_Fetch(&exception, &value, &tb); - + fflush(stdout); - - int exitcode = 0; - if (value == NULL || value == Py_None) { + + int exitcode = 0; + if (value == NULL || value == Py_None) { goto done; - } - + } + if (PyExceptionInstance_Check(value)) { /* The error code should be in the `code' attribute. */ _Py_IDENTIFIER(code); @@ -681,10 +681,10 @@ _Py_HandleSystemExit(int *exitcode_p) /* If we failed to dig out the 'code' attribute, just let the else clause below print the error. */ } - - if (PyLong_Check(value)) { + + if (PyLong_Check(value)) { exitcode = (int)PyLong_AsLong(value); - } + } else { PyObject *sys_stderr = _PySys_GetObjectId(&PyId_stderr); /* We clear the exception here to avoid triggering the assertion @@ -701,7 +701,7 @@ _Py_HandleSystemExit(int *exitcode_p) PySys_WriteStderr("\n"); exitcode = 1; } - + done: /* Restore and clear the exception info, in order to properly decref * the exception, value, and traceback. If we just exit instead, @@ -710,63 +710,63 @@ _Py_HandleSystemExit(int *exitcode_p) */ PyErr_Restore(exception, value, tb); PyErr_Clear(); - *exitcode_p = exitcode; - return 1; -} - - -static void -handle_system_exit(void) -{ - int exitcode; - if (_Py_HandleSystemExit(&exitcode)) { - Py_Exit(exitcode); - } -} - - -static void -_PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars) -{ + *exitcode_p = exitcode; + return 1; +} + + +static void +handle_system_exit(void) +{ + int exitcode; + if (_Py_HandleSystemExit(&exitcode)) { + Py_Exit(exitcode); + } +} + + +static void +_PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars) +{ PyObject *exception, *v, *tb, *hook; - handle_system_exit(); - - _PyErr_Fetch(tstate, &exception, &v, &tb); - if (exception == NULL) { - goto done; + handle_system_exit(); + + _PyErr_Fetch(tstate, &exception, &v, &tb); + if (exception == NULL) { + goto done; } - - _PyErr_NormalizeException(tstate, &exception, &v, &tb); + + _PyErr_NormalizeException(tstate, &exception, &v, &tb); if (tb == NULL) { tb = Py_None; Py_INCREF(tb); } PyException_SetTraceback(v, tb); - if (exception == NULL) { - goto done; - } - + if (exception == NULL) { + goto done; + } + /* Now we know v != NULL too */ if (set_sys_last_vars) { if (_PySys_SetObjectId(&PyId_last_type, exception) < 0) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } if (_PySys_SetObjectId(&PyId_last_value, v) < 0) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } if (_PySys_SetObjectId(&PyId_last_traceback, tb) < 0) { - _PyErr_Clear(tstate); - } - } - hook = _PySys_GetObjectId(&PyId_excepthook); - if (_PySys_Audit(tstate, "sys.excepthook", "OOOO", hook ? hook : Py_None, - exception, v, tb) < 0) { - if (PyErr_ExceptionMatches(PyExc_RuntimeError)) { + _PyErr_Clear(tstate); + } + } + hook = _PySys_GetObjectId(&PyId_excepthook); + if (_PySys_Audit(tstate, "sys.excepthook", "OOOO", hook ? hook : Py_None, + exception, v, tb) < 0) { + if (PyErr_ExceptionMatches(PyExc_RuntimeError)) { PyErr_Clear(); - goto done; + goto done; } - _PyErr_WriteUnraisableMsg("in audit hook", NULL); + _PyErr_WriteUnraisableMsg("in audit hook", NULL); } if (hook) { PyObject* stack[3]; @@ -777,11 +777,11 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars) stack[2] = tb; result = _PyObject_FastCall(hook, stack, 3); if (result == NULL) { - handle_system_exit(); - + handle_system_exit(); + PyObject *exception2, *v2, *tb2; - _PyErr_Fetch(tstate, &exception2, &v2, &tb2); - _PyErr_NormalizeException(tstate, &exception2, &v2, &tb2); + _PyErr_Fetch(tstate, &exception2, &v2, &tb2); + _PyErr_NormalizeException(tstate, &exception2, &v2, &tb2); /* It should not be possible for exception2 or v2 to be NULL. However PyErr_Display() can't tolerate NULLs, so just be safe. */ @@ -803,37 +803,37 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars) Py_XDECREF(tb2); } Py_XDECREF(result); - } - else { + } + else { PySys_WriteStderr("sys.excepthook is missing\n"); PyErr_Display(exception, v, tb); } - -done: + +done: Py_XDECREF(exception); Py_XDECREF(v); Py_XDECREF(tb); } -void -_PyErr_Print(PyThreadState *tstate) -{ - _PyErr_PrintEx(tstate, 1); -} - -void -PyErr_PrintEx(int set_sys_last_vars) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_PrintEx(tstate, set_sys_last_vars); -} - -void -PyErr_Print(void) -{ - PyErr_PrintEx(1); -} - +void +_PyErr_Print(PyThreadState *tstate) +{ + _PyErr_PrintEx(tstate, 1); +} + +void +PyErr_PrintEx(int set_sys_last_vars) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_PrintEx(tstate, set_sys_last_vars); +} + +void +PyErr_Print(void) +{ + PyErr_PrintEx(1); +} + static void print_exception(PyObject *f, PyObject *value) { @@ -860,7 +860,7 @@ print_exception(PyObject *f, PyObject *value) _PyObject_HasAttrId(value, &PyId_print_file_and_line)) { PyObject *message, *filename, *text; - Py_ssize_t lineno, offset; + Py_ssize_t lineno, offset; if (!parse_syntax_error(value, &message, &filename, &lineno, &offset, &text)) PyErr_Clear(); @@ -870,7 +870,7 @@ print_exception(PyObject *f, PyObject *value) Py_DECREF(value); value = message; - line = PyUnicode_FromFormat(" File \"%S\", line %zd\n", + line = PyUnicode_FromFormat(" File \"%S\", line %zd\n", filename, lineno); Py_DECREF(filename); if (line != NULL) { @@ -893,37 +893,37 @@ print_exception(PyObject *f, PyObject *value) /* Don't do anything else */ } else { - PyObject* modulename; - + PyObject* modulename; + _Py_IDENTIFIER(__module__); assert(PyExceptionClass_Check(type)); - modulename = _PyObject_GetAttrId(type, &PyId___module__); - if (modulename == NULL || !PyUnicode_Check(modulename)) + modulename = _PyObject_GetAttrId(type, &PyId___module__); + if (modulename == NULL || !PyUnicode_Check(modulename)) { - Py_XDECREF(modulename); - PyErr_Clear(); - err = PyFile_WriteString("<unknown>.", f); + Py_XDECREF(modulename); + PyErr_Clear(); + err = PyFile_WriteString("<unknown>.", f); } else { - if (!_PyUnicode_EqualToASCIIId(modulename, &PyId_builtins)) + if (!_PyUnicode_EqualToASCIIId(modulename, &PyId_builtins)) { - err = PyFile_WriteObject(modulename, f, Py_PRINT_RAW); + err = PyFile_WriteObject(modulename, f, Py_PRINT_RAW); err += PyFile_WriteString(".", f); } - Py_DECREF(modulename); + Py_DECREF(modulename); } if (err == 0) { - PyObject* qualname = _PyType_GetQualName((PyTypeObject *)type); - if (qualname == NULL || !PyUnicode_Check(qualname)) { - Py_XDECREF(qualname); - PyErr_Clear(); - err = PyFile_WriteString("<unknown>", f); - } - else { - err = PyFile_WriteObject(qualname, f, Py_PRINT_RAW); - Py_DECREF(qualname); - } + PyObject* qualname = _PyType_GetQualName((PyTypeObject *)type); + if (qualname == NULL || !PyUnicode_Check(qualname)) { + Py_XDECREF(qualname); + PyErr_Clear(); + err = PyFile_WriteString("<unknown>", f); + } + else { + err = PyFile_WriteObject(qualname, f, Py_PRINT_RAW); + Py_DECREF(qualname); + } } } if (err == 0 && (value != Py_None)) { @@ -1025,10 +1025,10 @@ print_exception_recursive(PyObject *f, PyObject *value, PyObject *seen) } void -_PyErr_Display(PyObject *file, PyObject *exception, PyObject *value, PyObject *tb) +_PyErr_Display(PyObject *file, PyObject *exception, PyObject *value, PyObject *tb) { - assert(file != NULL && file != Py_None); - + assert(file != NULL && file != Py_None); + PyObject *seen; if (PyExceptionInstance_Check(value) && tb != NULL && PyTraceBack_Check(tb)) { @@ -1040,43 +1040,43 @@ _PyErr_Display(PyObject *file, PyObject *exception, PyObject *value, PyObject *t else Py_DECREF(cur_tb); } - - /* We choose to ignore seen being possibly NULL, and report - at least the main exception (it could be a MemoryError). - */ - seen = PySet_New(NULL); - if (seen == NULL) { - PyErr_Clear(); - } - print_exception_recursive(file, value, seen); - Py_XDECREF(seen); - - /* Call file.flush() */ - PyObject *res = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); - if (!res) { - /* Silently ignore file.flush() error */ - PyErr_Clear(); - } - else { - Py_DECREF(res); - } -} - -void -PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) -{ - PyObject *file = _PySys_GetObjectId(&PyId_stderr); - if (file == NULL) { + + /* We choose to ignore seen being possibly NULL, and report + at least the main exception (it could be a MemoryError). + */ + seen = PySet_New(NULL); + if (seen == NULL) { + PyErr_Clear(); + } + print_exception_recursive(file, value, seen); + Py_XDECREF(seen); + + /* Call file.flush() */ + PyObject *res = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); + if (!res) { + /* Silently ignore file.flush() error */ + PyErr_Clear(); + } + else { + Py_DECREF(res); + } +} + +void +PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) +{ + PyObject *file = _PySys_GetObjectId(&PyId_stderr); + if (file == NULL) { _PyObject_Dump(value); fprintf(stderr, "lost sys.stderr\n"); - return; + return; } - if (file == Py_None) { - return; + if (file == Py_None) { + return; } - Py_INCREF(file); - _PyErr_Display(file, exception, value, tb); - Py_DECREF(file); + Py_INCREF(file); + _PyErr_Display(file, exception, value, tb); + Py_DECREF(file); } PyObject * @@ -1087,7 +1087,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, mod_ty mod; PyArena *arena; PyObject *filename; - int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; filename = _PyUnicode_FromId(&PyId_string); /* borrowed */ if (filename == NULL) @@ -1097,74 +1097,74 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (arena == NULL) return NULL; - if (use_peg) { - mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); - } - else { - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); - } - + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } + if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); PyArena_Free(arena); return ret; } - -static PyObject * -pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, - PyObject *locals, int closeit, PyCompilerFlags *flags) + +static PyObject * +pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, + PyObject *locals, int closeit, PyCompilerFlags *flags) { - PyArena *arena = PyArena_New(); - if (arena == NULL) { - return NULL; - } - + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; - if (use_peg) { - mod = PyPegen_ASTFromFileObject(fp, filename, start, NULL, NULL, NULL, - flags, NULL, arena); - } - else { - mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0, - flags, NULL, arena); - } - - if (closeit) { - fclose(fp); - } - - PyObject *ret; - if (mod != NULL) { - ret = run_mod(mod, filename, globals, locals, flags, arena); - } - else { - ret = NULL; - } - PyArena_Free(arena); - - return ret; -} - - -PyObject * -PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals, - PyObject *locals, int closeit, PyCompilerFlags *flags) -{ - PyObject *filename_obj = PyUnicode_DecodeFSDefault(filename); - if (filename_obj == NULL) { - return NULL; - } - - PyObject *res = pyrun_file(fp, filename_obj, start, globals, - locals, closeit, flags); - Py_DECREF(filename_obj); - return res; - -} - - + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; + if (use_peg) { + mod = PyPegen_ASTFromFileObject(fp, filename, start, NULL, NULL, NULL, + flags, NULL, arena); + } + else { + mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0, + flags, NULL, arena); + } + + if (closeit) { + fclose(fp); + } + + PyObject *ret; + if (mod != NULL) { + ret = run_mod(mod, filename, globals, locals, flags, arena); + } + else { + ret = NULL; + } + PyArena_Free(arena); + + return ret; +} + + +PyObject * +PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals, + PyObject *locals, int closeit, PyCompilerFlags *flags) +{ + PyObject *filename_obj = PyUnicode_DecodeFSDefault(filename); + if (filename_obj == NULL) { + return NULL; + } + + PyObject *res = pyrun_file(fp, filename_obj, start, globals, + locals, closeit, flags); + Py_DECREF(filename_obj); + return res; + +} + + static void flush_io(void) { @@ -1176,7 +1176,7 @@ flush_io(void) f = _PySys_GetObjectId(&PyId_stderr); if (f != NULL) { - r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); + r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); if (r) Py_DECREF(r); else @@ -1184,7 +1184,7 @@ flush_io(void) } f = _PySys_GetObjectId(&PyId_stdout); if (f != NULL) { - r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); + r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); if (r) Py_DECREF(r); else @@ -1195,60 +1195,60 @@ flush_io(void) } static PyObject * -run_eval_code_obj(PyThreadState *tstate, PyCodeObject *co, PyObject *globals, PyObject *locals) -{ - PyObject *v; - /* - * We explicitly re-initialize _Py_UnhandledKeyboardInterrupt every eval - * _just in case_ someone is calling into an embedded Python where they - * don't care about an uncaught KeyboardInterrupt exception (why didn't they - * leave config.install_signal_handlers set to 0?!?) but then later call - * Py_Main() itself (which _checks_ this flag and dies with a signal after - * its interpreter exits). We don't want a previous embedded interpreter's - * uncaught exception to trigger an unexplained signal exit from a future - * Py_Main() based one. - */ - _Py_UnhandledKeyboardInterrupt = 0; - - /* Set globals['__builtins__'] if it doesn't exist */ - if (globals != NULL && PyDict_GetItemString(globals, "__builtins__") == NULL) { - if (PyDict_SetItemString(globals, "__builtins__", - tstate->interp->builtins) < 0) { - return NULL; - } - } - - v = PyEval_EvalCode((PyObject*)co, globals, locals); - if (!v && _PyErr_Occurred(tstate) == PyExc_KeyboardInterrupt) { - _Py_UnhandledKeyboardInterrupt = 1; - } - return v; -} - -static PyObject * +run_eval_code_obj(PyThreadState *tstate, PyCodeObject *co, PyObject *globals, PyObject *locals) +{ + PyObject *v; + /* + * We explicitly re-initialize _Py_UnhandledKeyboardInterrupt every eval + * _just in case_ someone is calling into an embedded Python where they + * don't care about an uncaught KeyboardInterrupt exception (why didn't they + * leave config.install_signal_handlers set to 0?!?) but then later call + * Py_Main() itself (which _checks_ this flag and dies with a signal after + * its interpreter exits). We don't want a previous embedded interpreter's + * uncaught exception to trigger an unexplained signal exit from a future + * Py_Main() based one. + */ + _Py_UnhandledKeyboardInterrupt = 0; + + /* Set globals['__builtins__'] if it doesn't exist */ + if (globals != NULL && PyDict_GetItemString(globals, "__builtins__") == NULL) { + if (PyDict_SetItemString(globals, "__builtins__", + tstate->interp->builtins) < 0) { + return NULL; + } + } + + v = PyEval_EvalCode((PyObject*)co, globals, locals); + if (!v && _PyErr_Occurred(tstate) == PyExc_KeyboardInterrupt) { + _Py_UnhandledKeyboardInterrupt = 1; + } + return v; +} + +static PyObject * run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals, PyCompilerFlags *flags, PyArena *arena) { - PyThreadState *tstate = _PyThreadState_GET(); - PyCodeObject *co = PyAST_CompileObject(mod, filename, flags, -1, arena); + PyThreadState *tstate = _PyThreadState_GET(); + PyCodeObject *co = PyAST_CompileObject(mod, filename, flags, -1, arena); if (co == NULL) return NULL; - - if (_PySys_Audit(tstate, "exec", "O", co) < 0) { - Py_DECREF(co); - return NULL; - } - - PyObject *v = run_eval_code_obj(tstate, co, globals, locals); + + if (_PySys_Audit(tstate, "exec", "O", co) < 0) { + Py_DECREF(co); + return NULL; + } + + PyObject *v = run_eval_code_obj(tstate, co, globals, locals); Py_DECREF(co); return v; } static PyObject * -run_pyc_file(FILE *fp, PyObject *globals, PyObject *locals, - PyCompilerFlags *flags) +run_pyc_file(FILE *fp, PyObject *globals, PyObject *locals, + PyCompilerFlags *flags) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyCodeObject *co; PyObject *v; long magic; @@ -1277,7 +1277,7 @@ run_pyc_file(FILE *fp, PyObject *globals, PyObject *locals, } fclose(fp); co = (PyCodeObject *)v; - v = run_eval_code_obj(tstate, co, globals, locals); + v = run_eval_code_obj(tstate, co, globals, locals); if (v && flags) flags->cf_flags |= (co->co_flags & PyCF_MASK); Py_DECREF(co); @@ -1293,17 +1293,17 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena = PyArena_New(); if (arena == NULL) return NULL; - if (use_peg) { - mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); - } - else { - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); - } + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } if (mod == NULL) { PyArena_Free(arena); return NULL; @@ -1339,80 +1339,80 @@ PyCompileString(const char *str, const char *filename, int start) return Py_CompileStringFlags(str, filename, start, NULL); } -const char * -_Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyCompilerFlags *cf, PyObject **cmd_copy) -{ - const char *str; - Py_ssize_t size; - Py_buffer view; - - *cmd_copy = NULL; - if (PyUnicode_Check(cmd)) { - cf->cf_flags |= PyCF_IGNORE_COOKIE; - str = PyUnicode_AsUTF8AndSize(cmd, &size); - if (str == NULL) - return NULL; - } - else if (PyBytes_Check(cmd)) { - str = PyBytes_AS_STRING(cmd); - size = PyBytes_GET_SIZE(cmd); - } - else if (PyByteArray_Check(cmd)) { - str = PyByteArray_AS_STRING(cmd); - size = PyByteArray_GET_SIZE(cmd); - } - else if (PyObject_GetBuffer(cmd, &view, PyBUF_SIMPLE) == 0) { - /* Copy to NUL-terminated buffer. */ - *cmd_copy = PyBytes_FromStringAndSize( - (const char *)view.buf, view.len); - PyBuffer_Release(&view); - if (*cmd_copy == NULL) { - return NULL; - } - str = PyBytes_AS_STRING(*cmd_copy); - size = PyBytes_GET_SIZE(*cmd_copy); - } - else { - PyErr_Format(PyExc_TypeError, - "%s() arg 1 must be a %s object", - funcname, what); - return NULL; - } - - if (strlen(str) != (size_t)size) { - PyErr_SetString(PyExc_ValueError, - "source code string cannot contain null bytes"); - Py_CLEAR(*cmd_copy); - return NULL; - } - return str; -} - +const char * +_Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyCompilerFlags *cf, PyObject **cmd_copy) +{ + const char *str; + Py_ssize_t size; + Py_buffer view; + + *cmd_copy = NULL; + if (PyUnicode_Check(cmd)) { + cf->cf_flags |= PyCF_IGNORE_COOKIE; + str = PyUnicode_AsUTF8AndSize(cmd, &size); + if (str == NULL) + return NULL; + } + else if (PyBytes_Check(cmd)) { + str = PyBytes_AS_STRING(cmd); + size = PyBytes_GET_SIZE(cmd); + } + else if (PyByteArray_Check(cmd)) { + str = PyByteArray_AS_STRING(cmd); + size = PyByteArray_GET_SIZE(cmd); + } + else if (PyObject_GetBuffer(cmd, &view, PyBUF_SIMPLE) == 0) { + /* Copy to NUL-terminated buffer. */ + *cmd_copy = PyBytes_FromStringAndSize( + (const char *)view.buf, view.len); + PyBuffer_Release(&view); + if (*cmd_copy == NULL) { + return NULL; + } + str = PyBytes_AS_STRING(*cmd_copy); + size = PyBytes_GET_SIZE(*cmd_copy); + } + else { + PyErr_Format(PyExc_TypeError, + "%s() arg 1 must be a %s object", + funcname, what); + return NULL; + } + + if (strlen(str) != (size_t)size) { + PyErr_SetString(PyExc_ValueError, + "source code string cannot contain null bytes"); + Py_CLEAR(*cmd_copy); + return NULL; + } + return str; +} + struct symtable * Py_SymtableStringObject(const char *str, PyObject *filename, int start) { - PyCompilerFlags flags = _PyCompilerFlags_INIT; - return _Py_SymtableStringObjectFlags(str, filename, start, &flags); -} - -struct symtable * -_Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, PyCompilerFlags *flags) -{ + PyCompilerFlags flags = _PyCompilerFlags_INIT; + return _Py_SymtableStringObjectFlags(str, filename, start, &flags); +} + +struct symtable * +_Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, PyCompilerFlags *flags) +{ struct symtable *st; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena; arena = PyArena_New(); if (arena == NULL) return NULL; - if (use_peg) { - mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); - } - else { - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); - } + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } if (mod == NULL) { PyArena_Free(arena); return NULL; @@ -1442,11 +1442,11 @@ PyParser_ASTFromStringObject(const char *s, PyObject *filename, int start, PyCompilerFlags *flags, PyArena *arena) { mod_ty mod; - PyCompilerFlags localflags = _PyCompilerFlags_INIT; + PyCompilerFlags localflags = _PyCompilerFlags_INIT; perrdetail err; int iflags = PARSER_FLAGS(flags); - if (flags && (flags->cf_flags & PyCF_ONLY_AST) && flags->cf_feature_version < 7) - iflags |= PyPARSE_ASYNC_HACKS; + if (flags && (flags->cf_flags & PyCF_ONLY_AST) && flags->cf_feature_version < 7) + iflags |= PyPARSE_ASYNC_HACKS; node *n = PyParser_ParseStringObject(s, filename, &_PyParser_Grammar, start, &err, @@ -1488,7 +1488,7 @@ PyParser_ASTFromFileObject(FILE *fp, PyObject *filename, const char* enc, PyArena *arena) { mod_ty mod; - PyCompilerFlags localflags = _PyCompilerFlags_INIT; + PyCompilerFlags localflags = _PyCompilerFlags_INIT; perrdetail err; int iflags = PARSER_FLAGS(flags); diff --git a/contrib/tools/python3/src/Python/pytime.c b/contrib/tools/python3/src/Python/pytime.c index 878b7d1b03..a9af757243 100644 --- a/contrib/tools/python3/src/Python/pytime.c +++ b/contrib/tools/python3/src/Python/pytime.c @@ -1,17 +1,17 @@ #include "Python.h" #ifdef MS_WINDOWS -#include <winsock2.h> /* struct timeval */ +#include <winsock2.h> /* struct timeval */ #endif #if defined(__APPLE__) #include <mach/mach_time.h> /* mach_absolute_time(), mach_timebase_info() */ - -#if defined(__APPLE__) && defined(__has_builtin) -# if __has_builtin(__builtin_available) -# define HAVE_CLOCK_GETTIME_RUNTIME __builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) -# endif + +#if defined(__APPLE__) && defined(__has_builtin) +# if __has_builtin(__builtin_available) +# define HAVE_CLOCK_GETTIME_RUNTIME __builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) +# endif +#endif #endif -#endif #define _PyTime_check_mul_overflow(a, b) \ (assert(b > 0), \ @@ -689,22 +689,22 @@ pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) #else /* MS_WINDOWS */ int err; -#if defined(HAVE_CLOCK_GETTIME) +#if defined(HAVE_CLOCK_GETTIME) struct timespec ts; -#endif - -#if !defined(HAVE_CLOCK_GETTIME) || defined(__APPLE__) +#endif + +#if !defined(HAVE_CLOCK_GETTIME) || defined(__APPLE__) struct timeval tv; #endif assert(info == NULL || raise); #ifdef HAVE_CLOCK_GETTIME - -#ifdef HAVE_CLOCK_GETTIME_RUNTIME - if (HAVE_CLOCK_GETTIME_RUNTIME) { -#endif - + +#ifdef HAVE_CLOCK_GETTIME_RUNTIME + if (HAVE_CLOCK_GETTIME_RUNTIME) { +#endif + err = clock_gettime(CLOCK_REALTIME, &ts); if (err) { if (raise) { @@ -729,14 +729,14 @@ pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) } } -#ifdef HAVE_CLOCK_GETTIME_RUNTIME - } else { -#endif - -#endif - -#if !defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_RUNTIME) - +#ifdef HAVE_CLOCK_GETTIME_RUNTIME + } else { +#endif + +#endif + +#if !defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_RUNTIME) + /* test gettimeofday() */ err = gettimeofday(&tv, (struct timezone *)NULL); if (err) { @@ -755,11 +755,11 @@ pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) info->monotonic = 0; info->adjustable = 1; } - -#if defined(HAVE_CLOCK_GETTIME_RUNTIME) && defined(HAVE_CLOCK_GETTIME) - } /* end of availibity block */ -#endif - + +#if defined(HAVE_CLOCK_GETTIME_RUNTIME) && defined(HAVE_CLOCK_GETTIME) + } /* end of availibity block */ +#endif + #endif /* !HAVE_CLOCK_GETTIME */ #endif /* !MS_WINDOWS */ return 0; @@ -771,7 +771,7 @@ _PyTime_GetSystemClock(void) _PyTime_t t; if (pygettimeofday(&t, NULL, 0) < 0) { /* should not happen, _PyTime_Init() checked the clock at startup */ - Py_FatalError("pygettimeofday() failed"); + Py_FatalError("pygettimeofday() failed"); } return t; } @@ -801,7 +801,7 @@ pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise) return -1; } /* Hello, time traveler! */ - Py_FatalError("pymonotonic: integer overflow"); + Py_FatalError("pymonotonic: integer overflow"); } *tp = t * MS_TO_NS; @@ -943,7 +943,7 @@ _PyTime_GetMonotonicClock(void) if (pymonotonic(&t, NULL, 0) < 0) { /* should not happen, _PyTime_Init() checked that monotonic clock at startup */ - Py_FatalError("pymonotonic() failed"); + Py_FatalError("pymonotonic() failed"); } return t; } @@ -1044,7 +1044,7 @@ _PyTime_GetPerfCounter(void) { _PyTime_t t; if (_PyTime_GetPerfCounterWithInfo(&t, NULL)) { - Py_FatalError("_PyTime_GetPerfCounterWithInfo() failed"); + Py_FatalError("_PyTime_GetPerfCounterWithInfo() failed"); } return t; } @@ -1083,19 +1083,19 @@ _PyTime_localtime(time_t t, struct tm *tm) } return 0; #else /* !MS_WINDOWS */ - -#if defined(_AIX) && (SIZEOF_TIME_T < 8) - /* bpo-34373: AIX does not return NULL if t is too small or too large */ - if (t < -2145916800 /* 1902-01-01 */ - || t > 2145916800 /* 2038-01-01 */) { - errno = EINVAL; - PyErr_SetString(PyExc_OverflowError, - "localtime argument out of range"); - return -1; - } -#endif - - errno = 0; + +#if defined(_AIX) && (SIZEOF_TIME_T < 8) + /* bpo-34373: AIX does not return NULL if t is too small or too large */ + if (t < -2145916800 /* 1902-01-01 */ + || t > 2145916800 /* 2038-01-01 */) { + errno = EINVAL; + PyErr_SetString(PyExc_OverflowError, + "localtime argument out of range"); + return -1; + } +#endif + + errno = 0; if (localtime_r(&t, tm) == NULL) { if (errno == 0) { errno = EINVAL; diff --git a/contrib/tools/python3/src/Python/structmember.c b/contrib/tools/python3/src/Python/structmember.c index b458e819d3..ba88e15f93 100644 --- a/contrib/tools/python3/src/Python/structmember.c +++ b/contrib/tools/python3/src/Python/structmember.c @@ -2,7 +2,7 @@ /* Map C struct members to Python object attributes */ #include "Python.h" -#include "structmember.h" // PyMemberDef +#include "structmember.h" // PyMemberDef PyObject * PyMember_GetOne(const char *addr, PyMemberDef *l) diff --git a/contrib/tools/python3/src/Python/symtable.c b/contrib/tools/python3/src/Python/symtable.c index 11bf28d873..d192f31dee 100644 --- a/contrib/tools/python3/src/Python/symtable.c +++ b/contrib/tools/python3/src/Python/symtable.c @@ -1,8 +1,8 @@ #include "Python.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pystate.h" // _PyThreadState_GET() #include "symtable.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ -#include "structmember.h" // PyMemberDef +#undef Yield /* undefine macro conflicting with <winbase.h> */ +#include "structmember.h" // PyMemberDef /* error strings used for warnings */ #define GLOBAL_PARAM \ @@ -31,18 +31,18 @@ #define IMPORT_STAR_WARNING "import * only allowed at module level" -#define NAMED_EXPR_COMP_IN_CLASS \ -"assignment expression within a comprehension cannot be used in a class body" - -#define NAMED_EXPR_COMP_CONFLICT \ -"assignment expression cannot rebind comprehension iteration variable '%U'" - -#define NAMED_EXPR_COMP_INNER_LOOP_CONFLICT \ -"comprehension inner loop cannot rebind assignment expression target '%U'" - -#define NAMED_EXPR_COMP_ITER_EXPR \ -"assignment expression cannot be used in a comprehension iterable expression" - +#define NAMED_EXPR_COMP_IN_CLASS \ +"assignment expression within a comprehension cannot be used in a class body" + +#define NAMED_EXPR_COMP_CONFLICT \ +"assignment expression cannot rebind comprehension iteration variable '%U'" + +#define NAMED_EXPR_COMP_INNER_LOOP_CONFLICT \ +"comprehension inner loop cannot rebind assignment expression target '%U'" + +#define NAMED_EXPR_COMP_ITER_EXPR \ +"assignment expression cannot be used in a comprehension iterable expression" + static PySTEntryObject * ste_new(struct symtable *st, identifier name, _Py_block_ty block, void *key, int lineno, int col_offset) @@ -87,11 +87,11 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, ste->ste_child_free = 0; ste->ste_generator = 0; ste->ste_coroutine = 0; - ste->ste_comprehension = 0; + ste->ste_comprehension = 0; ste->ste_returns_value = 0; ste->ste_needs_class_closure = 0; - ste->ste_comp_iter_target = 0; - ste->ste_comp_iter_expr = 0; + ste->ste_comp_iter_target = 0; + ste->ste_comp_iter_expr = 0; ste->ste_symbols = PyDict_New(); ste->ste_varnames = PyList_New(0); @@ -151,10 +151,10 @@ PyTypeObject PySTEntry_Type = { sizeof(PySTEntryObject), 0, (destructor)ste_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ + 0, /* tp_vectorcall_offset */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_as_async */ + 0, /* tp_as_async */ (reprfunc)ste_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -190,7 +190,7 @@ static int symtable_analyze(struct symtable *st); static int symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block, void *ast, int lineno, int col_offset); -static int symtable_exit_block(struct symtable *st); +static int symtable_exit_block(struct symtable *st); static int symtable_visit_stmt(struct symtable *st, stmt_ty s); static int symtable_visit_expr(struct symtable *st, expr_ty s); static int symtable_visit_genexp(struct symtable *st, expr_ty s); @@ -205,7 +205,7 @@ static int symtable_visit_keyword(struct symtable *st, keyword_ty); static int symtable_visit_params(struct symtable *st, asdl_seq *args); static int symtable_visit_argannotations(struct symtable *st, asdl_seq *args); static int symtable_implicit_arg(struct symtable *st, int pos); -static int symtable_visit_annotations(struct symtable *st, arguments_ty, expr_ty); +static int symtable_visit_annotations(struct symtable *st, arguments_ty, expr_ty); static int symtable_visit_withitem(struct symtable *st, withitem_ty item); @@ -265,7 +265,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) int i; PyThreadState *tstate; int recursion_limit = Py_GetRecursionLimit(); - int starting_recursion_depth; + int starting_recursion_depth; if (st == NULL) return NULL; @@ -278,15 +278,15 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) st->st_future = future; /* Setup recursion depth check counters */ - tstate = _PyThreadState_GET(); + tstate = _PyThreadState_GET(); if (!tstate) { PySymtable_Free(st); return NULL; } /* Be careful here to prevent overflow. */ - starting_recursion_depth = (tstate->recursion_depth < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? + starting_recursion_depth = (tstate->recursion_depth < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? tstate->recursion_depth * COMPILER_STACK_FRAME_SCALE : tstate->recursion_depth; - st->recursion_depth = starting_recursion_depth; + st->recursion_depth = starting_recursion_depth; st->recursion_limit = (recursion_limit < INT_MAX / COMPILER_STACK_FRAME_SCALE) ? recursion_limit * COMPILER_STACK_FRAME_SCALE : recursion_limit; @@ -317,30 +317,30 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) (stmt_ty)asdl_seq_GET(seq, i))) goto error; break; - case FunctionType_kind: - PyErr_SetString(PyExc_RuntimeError, - "this compiler does not handle FunctionTypes"); - goto error; + case FunctionType_kind: + PyErr_SetString(PyExc_RuntimeError, + "this compiler does not handle FunctionTypes"); + goto error; } - if (!symtable_exit_block(st)) { + if (!symtable_exit_block(st)) { + PySymtable_Free(st); + return NULL; + } + /* Check that the recursion depth counting balanced correctly */ + if (st->recursion_depth != starting_recursion_depth) { + PyErr_Format(PyExc_SystemError, + "symtable analysis recursion depth mismatch (before=%d, after=%d)", + starting_recursion_depth, st->recursion_depth); PySymtable_Free(st); return NULL; } - /* Check that the recursion depth counting balanced correctly */ - if (st->recursion_depth != starting_recursion_depth) { - PyErr_Format(PyExc_SystemError, - "symtable analysis recursion depth mismatch (before=%d, after=%d)", - starting_recursion_depth, st->recursion_depth); - PySymtable_Free(st); - return NULL; - } /* Make the second symbol analysis pass */ if (symtable_analyze(st)) return st; PySymtable_Free(st); return NULL; error: - (void) symtable_exit_block(st); + (void) symtable_exit_block(st); PySymtable_Free(st); return NULL; } @@ -375,12 +375,12 @@ PySymtable_Lookup(struct symtable *st, void *key) k = PyLong_FromVoidPtr(key); if (k == NULL) return NULL; - v = PyDict_GetItemWithError(st->st_blocks, k); + v = PyDict_GetItemWithError(st->st_blocks, k); if (v) { assert(PySTEntry_Check(v)); Py_INCREF(v); } - else if (!PyErr_Occurred()) { + else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_KeyError, "unknown symbol table entry"); } @@ -389,23 +389,23 @@ PySymtable_Lookup(struct symtable *st, void *key) return (PySTEntryObject *)v; } -static long -_PyST_GetSymbol(PySTEntryObject *ste, PyObject *name) +static long +_PyST_GetSymbol(PySTEntryObject *ste, PyObject *name) { PyObject *v = PyDict_GetItem(ste->ste_symbols, name); if (!v) return 0; assert(PyLong_Check(v)); - return PyLong_AS_LONG(v); + return PyLong_AS_LONG(v); +} + +int +PyST_GetScope(PySTEntryObject *ste, PyObject *name) +{ + long symbol = _PyST_GetSymbol(ste, name); + return (symbol >> SCOPE_OFFSET) & SCOPE_MASK; } -int -PyST_GetScope(PySTEntryObject *ste, PyObject *name) -{ - long symbol = _PyST_GetSymbol(ste, name); - return (symbol >> SCOPE_OFFSET) & SCOPE_MASK; -} - static int error_at_directive(PySTEntryObject *ste, PyObject *name) { @@ -419,7 +419,7 @@ error_at_directive(PySTEntryObject *ste, PyObject *name) if (PyUnicode_Compare(PyTuple_GET_ITEM(data, 0), name) == 0) { PyErr_SyntaxLocationObject(ste->ste_table->st_filename, PyLong_AsLong(PyTuple_GET_ITEM(data, 1)), - PyLong_AsLong(PyTuple_GET_ITEM(data, 2)) + 1); + PyLong_AsLong(PyTuple_GET_ITEM(data, 2)) + 1); return 0; } @@ -660,7 +660,7 @@ update_symbols(PyObject *symbols, PyObject *scopes, } while ((name = PyIter_Next(itr))) { - v = PyDict_GetItemWithError(symbols, name); + v = PyDict_GetItemWithError(symbols, name); /* Handle symbol that already exists in this scope */ if (v) { @@ -685,9 +685,9 @@ update_symbols(PyObject *symbols, PyObject *scopes, Py_DECREF(name); continue; } - else if (PyErr_Occurred()) { - goto error; - } + else if (PyErr_Occurred()) { + goto error; + } /* Handle global symbol */ if (bound && !PySet_Contains(bound, name)) { Py_DECREF(name); @@ -949,7 +949,7 @@ symtable_analyze(struct symtable *st) */ static int -symtable_exit_block(struct symtable *st) +symtable_exit_block(struct symtable *st) { Py_ssize_t size; @@ -978,13 +978,13 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block, return 0; } prev = st->st_cur; - /* bpo-37757: For now, disallow *all* assignment expressions in the - * outermost iterator expression of a comprehension, even those inside - * a nested comprehension or a lambda expression. - */ - if (prev) { - ste->ste_comp_iter_expr = prev->ste_comp_iter_expr; - } + /* bpo-37757: For now, disallow *all* assignment expressions in the + * outermost iterator expression of a comprehension, even those inside + * a nested comprehension or a lambda expression. + */ + if (prev) { + ste->ste_comp_iter_expr = prev->ste_comp_iter_expr; + } /* The entry is owned by the stack. Borrow it for st_cur. */ Py_DECREF(ste); st->st_cur = ste; @@ -1004,13 +1004,13 @@ symtable_lookup(struct symtable *st, PyObject *name) PyObject *mangled = _Py_Mangle(st->st_private, name); if (!mangled) return 0; - long ret = _PyST_GetSymbol(st->st_cur, mangled); + long ret = _PyST_GetSymbol(st->st_cur, mangled); Py_DECREF(mangled); - return ret; + return ret; } static int -symtable_add_def_helper(struct symtable *st, PyObject *name, int flag, struct _symtable_entry *ste) +symtable_add_def_helper(struct symtable *st, PyObject *name, int flag, struct _symtable_entry *ste) { PyObject *o; PyObject *dict; @@ -1020,41 +1020,41 @@ symtable_add_def_helper(struct symtable *st, PyObject *name, int flag, struct _s if (!mangled) return 0; - dict = ste->ste_symbols; - if ((o = PyDict_GetItemWithError(dict, mangled))) { + dict = ste->ste_symbols; + if ((o = PyDict_GetItemWithError(dict, mangled))) { val = PyLong_AS_LONG(o); if ((flag & DEF_PARAM) && (val & DEF_PARAM)) { /* Is it better to use 'mangled' or 'name' here? */ PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name); PyErr_SyntaxLocationObject(st->st_filename, - ste->ste_lineno, - ste->ste_col_offset + 1); + ste->ste_lineno, + ste->ste_col_offset + 1); goto error; } val |= flag; - } - else if (PyErr_Occurred()) { - goto error; - } - else { + } + else if (PyErr_Occurred()) { + goto error; + } + else { val = flag; - } - if (ste->ste_comp_iter_target) { - /* This name is an iteration variable in a comprehension, - * so check for a binding conflict with any named expressions. - * Otherwise, mark it as an iteration variable so subsequent - * named expressions can check for conflicts. - */ - if (val & (DEF_GLOBAL | DEF_NONLOCAL)) { - PyErr_Format(PyExc_SyntaxError, - NAMED_EXPR_COMP_INNER_LOOP_CONFLICT, name); - PyErr_SyntaxLocationObject(st->st_filename, - ste->ste_lineno, - ste->ste_col_offset + 1); - goto error; - } - val |= DEF_COMP_ITER; - } + } + if (ste->ste_comp_iter_target) { + /* This name is an iteration variable in a comprehension, + * so check for a binding conflict with any named expressions. + * Otherwise, mark it as an iteration variable so subsequent + * named expressions can check for conflicts. + */ + if (val & (DEF_GLOBAL | DEF_NONLOCAL)) { + PyErr_Format(PyExc_SyntaxError, + NAMED_EXPR_COMP_INNER_LOOP_CONFLICT, name); + PyErr_SyntaxLocationObject(st->st_filename, + ste->ste_lineno, + ste->ste_col_offset + 1); + goto error; + } + val |= DEF_COMP_ITER; + } o = PyLong_FromLong(val); if (o == NULL) goto error; @@ -1065,7 +1065,7 @@ symtable_add_def_helper(struct symtable *st, PyObject *name, int flag, struct _s Py_DECREF(o); if (flag & DEF_PARAM) { - if (PyList_Append(ste->ste_varnames, mangled) < 0) + if (PyList_Append(ste->ste_varnames, mangled) < 0) goto error; } else if (flag & DEF_GLOBAL) { /* XXX need to update DEF_GLOBAL for other flags too; @@ -1091,11 +1091,11 @@ error: return 0; } -static int -symtable_add_def(struct symtable *st, PyObject *name, int flag) { - return symtable_add_def_helper(st, name, flag, st->st_cur); -} - +static int +symtable_add_def(struct symtable *st, PyObject *name, int flag) { + return symtable_add_def_helper(st, name, flag, st->st_cur); +} + /* VISIT, VISIT_SEQ and VIST_SEQ_TAIL take an ASDL type as their second argument. They use the ASDL name to synthesize the name of the C type and the visit function. @@ -1146,7 +1146,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag) { } static int -symtable_record_directive(struct symtable *st, identifier name, int lineno, int col_offset) +symtable_record_directive(struct symtable *st, identifier name, int lineno, int col_offset) { PyObject *data, *mangled; int res; @@ -1158,7 +1158,7 @@ symtable_record_directive(struct symtable *st, identifier name, int lineno, int mangled = _Py_Mangle(st->st_private, name); if (!mangled) return 0; - data = Py_BuildValue("(Nii)", mangled, lineno, col_offset); + data = Py_BuildValue("(Nii)", mangled, lineno, col_offset); if (!data) return 0; res = PyList_Append(st->st_cur->ste_directives, data); @@ -1183,7 +1183,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults); if (s->v.FunctionDef.args->kw_defaults) VISIT_SEQ_WITH_NULL(st, expr, s->v.FunctionDef.args->kw_defaults); - if (!symtable_visit_annotations(st, s->v.FunctionDef.args, + if (!symtable_visit_annotations(st, s->v.FunctionDef.args, s->v.FunctionDef.returns)) VISIT_QUIT(st, 0); if (s->v.FunctionDef.decorator_list) @@ -1194,7 +1194,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) VISIT_QUIT(st, 0); VISIT(st, arguments, s->v.FunctionDef.args); VISIT_SEQ(st, stmt, s->v.FunctionDef.body); - if (!symtable_exit_block(st)) + if (!symtable_exit_block(st)) VISIT_QUIT(st, 0); break; case ClassDef_kind: { @@ -1212,7 +1212,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) st->st_private = s->v.ClassDef.name; VISIT_SEQ(st, stmt, s->v.ClassDef.body); st->st_private = tmp; - if (!symtable_exit_block(st)) + if (!symtable_exit_block(st)) VISIT_QUIT(st, 0); break; } @@ -1237,14 +1237,14 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) VISIT_QUIT(st, 0); } if ((cur & (DEF_GLOBAL | DEF_NONLOCAL)) - && (st->st_cur->ste_symbols != st->st_global) + && (st->st_cur->ste_symbols != st->st_global) && s->v.AnnAssign.simple) { PyErr_Format(PyExc_SyntaxError, cur & DEF_GLOBAL ? GLOBAL_ANNOT : NONLOCAL_ANNOT, e_name->v.Name.id); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset + 1); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (s->v.AnnAssign.simple && @@ -1339,12 +1339,12 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) msg, name); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset + 1); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (!symtable_add_def(st, name, DEF_GLOBAL)) VISIT_QUIT(st, 0); - if (!symtable_record_directive(st, name, s->lineno, s->col_offset)) + if (!symtable_record_directive(st, name, s->lineno, s->col_offset)) VISIT_QUIT(st, 0); } break; @@ -1371,12 +1371,12 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) PyErr_Format(PyExc_SyntaxError, msg, name); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset + 1); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (!symtable_add_def(st, name, DEF_NONLOCAL)) VISIT_QUIT(st, 0); - if (!symtable_record_directive(st, name, s->lineno, s->col_offset)) + if (!symtable_record_directive(st, name, s->lineno, s->col_offset)) VISIT_QUIT(st, 0); } break; @@ -1401,7 +1401,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) if (s->v.AsyncFunctionDef.args->kw_defaults) VISIT_SEQ_WITH_NULL(st, expr, s->v.AsyncFunctionDef.args->kw_defaults); - if (!symtable_visit_annotations(st, s->v.AsyncFunctionDef.args, + if (!symtable_visit_annotations(st, s->v.AsyncFunctionDef.args, s->v.AsyncFunctionDef.returns)) VISIT_QUIT(st, 0); if (s->v.AsyncFunctionDef.decorator_list) @@ -1413,7 +1413,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) st->st_cur->ste_coroutine = 1; VISIT(st, arguments, s->v.AsyncFunctionDef.args); VISIT_SEQ(st, stmt, s->v.AsyncFunctionDef.body); - if (!symtable_exit_block(st)) + if (!symtable_exit_block(st)) VISIT_QUIT(st, 0); break; case AsyncWith_kind: @@ -1432,99 +1432,99 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) } static int -symtable_extend_namedexpr_scope(struct symtable *st, expr_ty e) -{ - assert(st->st_stack); - assert(e->kind == Name_kind); - - PyObject *target_name = e->v.Name.id; - Py_ssize_t i, size; - struct _symtable_entry *ste; - size = PyList_GET_SIZE(st->st_stack); - assert(size); - - /* Iterate over the stack in reverse and add to the nearest adequate scope */ - for (i = size - 1; i >= 0; i--) { - ste = (struct _symtable_entry *) PyList_GET_ITEM(st->st_stack, i); - - /* If we find a comprehension scope, check for a target - * binding conflict with iteration variables, otherwise skip it - */ - if (ste->ste_comprehension) { - long target_in_scope = _PyST_GetSymbol(ste, target_name); - if (target_in_scope & DEF_COMP_ITER) { - PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_CONFLICT, target_name); - PyErr_SyntaxLocationObject(st->st_filename, - e->lineno, - e->col_offset); - VISIT_QUIT(st, 0); - } - continue; - } - - /* If we find a FunctionBlock entry, add as GLOBAL/LOCAL or NONLOCAL/LOCAL */ - if (ste->ste_type == FunctionBlock) { - long target_in_scope = _PyST_GetSymbol(ste, target_name); - if (target_in_scope & DEF_GLOBAL) { - if (!symtable_add_def(st, target_name, DEF_GLOBAL)) - VISIT_QUIT(st, 0); - } else { - if (!symtable_add_def(st, target_name, DEF_NONLOCAL)) - VISIT_QUIT(st, 0); - } - if (!symtable_record_directive(st, target_name, e->lineno, e->col_offset)) - VISIT_QUIT(st, 0); - - return symtable_add_def_helper(st, target_name, DEF_LOCAL, ste); - } - /* If we find a ModuleBlock entry, add as GLOBAL */ - if (ste->ste_type == ModuleBlock) { - if (!symtable_add_def(st, target_name, DEF_GLOBAL)) - VISIT_QUIT(st, 0); - if (!symtable_record_directive(st, target_name, e->lineno, e->col_offset)) - VISIT_QUIT(st, 0); - - return symtable_add_def_helper(st, target_name, DEF_GLOBAL, ste); - } - /* Disallow usage in ClassBlock */ - if (ste->ste_type == ClassBlock) { - PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_IN_CLASS); - PyErr_SyntaxLocationObject(st->st_filename, - e->lineno, - e->col_offset); - VISIT_QUIT(st, 0); - } - } - - /* We should always find either a FunctionBlock, ModuleBlock or ClassBlock - and should never fall to this case - */ - assert(0); - return 0; -} - -static int -symtable_handle_namedexpr(struct symtable *st, expr_ty e) -{ - if (st->st_cur->ste_comp_iter_expr > 0) { - /* Assignment isn't allowed in a comprehension iterable expression */ - PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_ITER_EXPR); - PyErr_SyntaxLocationObject(st->st_filename, - e->lineno, - e->col_offset); - return 0; - } - if (st->st_cur->ste_comprehension) { - /* Inside a comprehension body, so find the right target scope */ - if (!symtable_extend_namedexpr_scope(st, e->v.NamedExpr.target)) - return 0; - } - VISIT(st, expr, e->v.NamedExpr.value); - VISIT(st, expr, e->v.NamedExpr.target); - return 1; -} - -static int +symtable_extend_namedexpr_scope(struct symtable *st, expr_ty e) +{ + assert(st->st_stack); + assert(e->kind == Name_kind); + + PyObject *target_name = e->v.Name.id; + Py_ssize_t i, size; + struct _symtable_entry *ste; + size = PyList_GET_SIZE(st->st_stack); + assert(size); + + /* Iterate over the stack in reverse and add to the nearest adequate scope */ + for (i = size - 1; i >= 0; i--) { + ste = (struct _symtable_entry *) PyList_GET_ITEM(st->st_stack, i); + + /* If we find a comprehension scope, check for a target + * binding conflict with iteration variables, otherwise skip it + */ + if (ste->ste_comprehension) { + long target_in_scope = _PyST_GetSymbol(ste, target_name); + if (target_in_scope & DEF_COMP_ITER) { + PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_CONFLICT, target_name); + PyErr_SyntaxLocationObject(st->st_filename, + e->lineno, + e->col_offset); + VISIT_QUIT(st, 0); + } + continue; + } + + /* If we find a FunctionBlock entry, add as GLOBAL/LOCAL or NONLOCAL/LOCAL */ + if (ste->ste_type == FunctionBlock) { + long target_in_scope = _PyST_GetSymbol(ste, target_name); + if (target_in_scope & DEF_GLOBAL) { + if (!symtable_add_def(st, target_name, DEF_GLOBAL)) + VISIT_QUIT(st, 0); + } else { + if (!symtable_add_def(st, target_name, DEF_NONLOCAL)) + VISIT_QUIT(st, 0); + } + if (!symtable_record_directive(st, target_name, e->lineno, e->col_offset)) + VISIT_QUIT(st, 0); + + return symtable_add_def_helper(st, target_name, DEF_LOCAL, ste); + } + /* If we find a ModuleBlock entry, add as GLOBAL */ + if (ste->ste_type == ModuleBlock) { + if (!symtable_add_def(st, target_name, DEF_GLOBAL)) + VISIT_QUIT(st, 0); + if (!symtable_record_directive(st, target_name, e->lineno, e->col_offset)) + VISIT_QUIT(st, 0); + + return symtable_add_def_helper(st, target_name, DEF_GLOBAL, ste); + } + /* Disallow usage in ClassBlock */ + if (ste->ste_type == ClassBlock) { + PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_IN_CLASS); + PyErr_SyntaxLocationObject(st->st_filename, + e->lineno, + e->col_offset); + VISIT_QUIT(st, 0); + } + } + + /* We should always find either a FunctionBlock, ModuleBlock or ClassBlock + and should never fall to this case + */ + assert(0); + return 0; +} + +static int +symtable_handle_namedexpr(struct symtable *st, expr_ty e) +{ + if (st->st_cur->ste_comp_iter_expr > 0) { + /* Assignment isn't allowed in a comprehension iterable expression */ + PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_ITER_EXPR); + PyErr_SyntaxLocationObject(st->st_filename, + e->lineno, + e->col_offset); + return 0; + } + if (st->st_cur->ste_comprehension) { + /* Inside a comprehension body, so find the right target scope */ + if (!symtable_extend_namedexpr_scope(st, e->v.NamedExpr.target)) + return 0; + } + VISIT(st, expr, e->v.NamedExpr.value); + VISIT(st, expr, e->v.NamedExpr.target); + return 1; +} + +static int symtable_visit_expr(struct symtable *st, expr_ty e) { if (++st->recursion_depth > st->recursion_limit) { @@ -1533,10 +1533,10 @@ symtable_visit_expr(struct symtable *st, expr_ty e) VISIT_QUIT(st, 0); } switch (e->kind) { - case NamedExpr_kind: - if(!symtable_handle_namedexpr(st, e)) - VISIT_QUIT(st, 0); - break; + case NamedExpr_kind: + if(!symtable_handle_namedexpr(st, e)) + VISIT_QUIT(st, 0); + break; case BoolOp_kind: VISIT_SEQ(st, expr, e->v.BoolOp.values); break; @@ -1560,7 +1560,7 @@ symtable_visit_expr(struct symtable *st, expr_ty e) VISIT_QUIT(st, 0); VISIT(st, arguments, e->v.Lambda.args); VISIT(st, expr, e->v.Lambda.body); - if (!symtable_exit_block(st)) + if (!symtable_exit_block(st)) VISIT_QUIT(st, 0); break; } @@ -1631,19 +1631,19 @@ symtable_visit_expr(struct symtable *st, expr_ty e) break; case Subscript_kind: VISIT(st, expr, e->v.Subscript.value); - VISIT(st, expr, e->v.Subscript.slice); + VISIT(st, expr, e->v.Subscript.slice); break; case Starred_kind: VISIT(st, expr, e->v.Starred.value); break; - case Slice_kind: - if (e->v.Slice.lower) - VISIT(st, expr, e->v.Slice.lower) - if (e->v.Slice.upper) - VISIT(st, expr, e->v.Slice.upper) - if (e->v.Slice.step) - VISIT(st, expr, e->v.Slice.step) - break; + case Slice_kind: + if (e->v.Slice.lower) + VISIT(st, expr, e->v.Slice.lower) + if (e->v.Slice.upper) + VISIT(st, expr, e->v.Slice.upper) + if (e->v.Slice.step) + VISIT(st, expr, e->v.Slice.step) + break; case Name_kind: if (!symtable_add_def(st, e->v.Name.id, e->v.Name.ctx == Load ? USE : DEF_LOCAL)) @@ -1717,10 +1717,10 @@ symtable_visit_argannotations(struct symtable *st, asdl_seq *args) } static int -symtable_visit_annotations(struct symtable *st, arguments_ty a, expr_ty returns) +symtable_visit_annotations(struct symtable *st, arguments_ty a, expr_ty returns) { - if (a->posonlyargs && !symtable_visit_argannotations(st, a->posonlyargs)) - return 0; + if (a->posonlyargs && !symtable_visit_argannotations(st, a->posonlyargs)) + return 0; if (a->args && !symtable_visit_argannotations(st, a->args)) return 0; if (a->vararg && a->vararg->annotation) @@ -1740,8 +1740,8 @@ symtable_visit_arguments(struct symtable *st, arguments_ty a) /* skip default arguments inside function block XXX should ast be different? */ - if (a->posonlyargs && !symtable_visit_params(st, a->posonlyargs)) - return 0; + if (a->posonlyargs && !symtable_visit_params(st, a->posonlyargs)) + return 0; if (a->args && !symtable_visit_params(st, a->args)) return 0; if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs)) @@ -1813,7 +1813,7 @@ symtable_visit_alias(struct symtable *st, alias_ty a) int lineno = st->st_cur->ste_lineno; int col_offset = st->st_cur->ste_col_offset; PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING); - PyErr_SyntaxLocationObject(st->st_filename, lineno, col_offset + 1); + PyErr_SyntaxLocationObject(st->st_filename, lineno, col_offset + 1); Py_DECREF(store_name); return 0; } @@ -1826,12 +1826,12 @@ symtable_visit_alias(struct symtable *st, alias_ty a) static int symtable_visit_comprehension(struct symtable *st, comprehension_ty lc) { - st->st_cur->ste_comp_iter_target = 1; + st->st_cur->ste_comp_iter_target = 1; VISIT(st, expr, lc->target); - st->st_cur->ste_comp_iter_target = 0; - st->st_cur->ste_comp_iter_expr++; + st->st_cur->ste_comp_iter_target = 0; + st->st_cur->ste_comp_iter_expr++; VISIT(st, expr, lc->iter); - st->st_cur->ste_comp_iter_expr--; + st->st_cur->ste_comp_iter_expr--; VISIT_SEQ(st, expr, lc->ifs); if (lc->is_async) { st->st_cur->ste_coroutine = 1; @@ -1857,9 +1857,9 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e, comprehension_ty outermost = ((comprehension_ty) asdl_seq_GET(generators, 0)); /* Outermost iterator is evaluated in current scope */ - st->st_cur->ste_comp_iter_expr++; + st->st_cur->ste_comp_iter_expr++; VISIT(st, expr, outermost->iter); - st->st_cur->ste_comp_iter_expr--; + st->st_cur->ste_comp_iter_expr--; /* Create comprehension scope for the rest */ if (!scope_name || !symtable_enter_block(st, scope_name, FunctionBlock, (void *)e, @@ -1869,37 +1869,37 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e, if (outermost->is_async) { st->st_cur->ste_coroutine = 1; } - st->st_cur->ste_comprehension = 1; - + st->st_cur->ste_comprehension = 1; + /* Outermost iter is received as an argument */ if (!symtable_implicit_arg(st, 0)) { - symtable_exit_block(st); + symtable_exit_block(st); return 0; } - /* Visit iteration variable target, and mark them as such */ - st->st_cur->ste_comp_iter_target = 1; + /* Visit iteration variable target, and mark them as such */ + st->st_cur->ste_comp_iter_target = 1; VISIT(st, expr, outermost->target); - st->st_cur->ste_comp_iter_target = 0; - /* Visit the rest of the comprehension body */ + st->st_cur->ste_comp_iter_target = 0; + /* Visit the rest of the comprehension body */ VISIT_SEQ(st, expr, outermost->ifs); VISIT_SEQ_TAIL(st, comprehension, generators, 1); if (value) VISIT(st, expr, value); VISIT(st, expr, elt); if (st->st_cur->ste_generator) { - PyErr_SetString(PyExc_SyntaxError, + PyErr_SetString(PyExc_SyntaxError, (e->kind == ListComp_kind) ? "'yield' inside list comprehension" : (e->kind == SetComp_kind) ? "'yield' inside set comprehension" : (e->kind == DictComp_kind) ? "'yield' inside dict comprehension" : "'yield' inside generator expression"); - PyErr_SyntaxLocationObject(st->st_filename, - st->st_cur->ste_lineno, - st->st_cur->ste_col_offset + 1); - symtable_exit_block(st); - return 0; + PyErr_SyntaxLocationObject(st->st_filename, + st->st_cur->ste_lineno, + st->st_cur->ste_col_offset + 1); + symtable_exit_block(st); + return 0; } - st->st_cur->ste_generator = is_generator; - return symtable_exit_block(st); + st->st_cur->ste_generator = is_generator; + return symtable_exit_block(st); } static int diff --git a/contrib/tools/python3/src/Python/sysmodule.c b/contrib/tools/python3/src/Python/sysmodule.c index a044dbbbb6..33eb848fac 100644 --- a/contrib/tools/python3/src/Python/sysmodule.c +++ b/contrib/tools/python3/src/Python/sysmodule.c @@ -16,19 +16,19 @@ Data members: #include "Python.h" #include "code.h" -#include "frameobject.h" // PyFrame_GetBack() -#include "pycore_ceval.h" -#include "pycore_initconfig.h" -#include "pycore_object.h" -#include "pycore_pathconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" -#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" - -#include "pydtrace.h" -#include "osdefs.h" // DELIM +#include "frameobject.h" // PyFrame_GetBack() +#include "pycore_ceval.h" +#include "pycore_initconfig.h" +#include "pycore_object.h" +#include "pycore_pathconfig.h" +#include "pycore_pyerrors.h" +#include "pycore_pylifecycle.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tupleobject.h" + +#include "pydtrace.h" +#include "osdefs.h" // DELIM #include <locale.h> #ifdef MS_WINDOWS @@ -61,453 +61,453 @@ _Py_IDENTIFIER(stderr); _Py_IDENTIFIER(warnoptions); _Py_IDENTIFIER(write); -static PyObject * -sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key) +static PyObject * +sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key) { - PyObject *sd = tstate->interp->sysdict; - if (sd == NULL) { + PyObject *sd = tstate->interp->sysdict; + if (sd == NULL) { return NULL; - } + } return _PyDict_GetItemId(sd, key); } PyObject * -_PySys_GetObjectId(_Py_Identifier *key) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return sys_get_object_id(tstate, key); -} - -PyObject * +_PySys_GetObjectId(_Py_Identifier *key) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return sys_get_object_id(tstate, key); +} + +PyObject * PySys_GetObject(const char *name) { - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *sd = tstate->interp->sysdict; - if (sd == NULL) { + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *sd = tstate->interp->sysdict; + if (sd == NULL) { return NULL; - } + } return PyDict_GetItemString(sd, name); } -static int -sys_set_object_id(PyThreadState *tstate, _Py_Identifier *key, PyObject *v) +static int +sys_set_object_id(PyThreadState *tstate, _Py_Identifier *key, PyObject *v) { - PyObject *sd = tstate->interp->sysdict; + PyObject *sd = tstate->interp->sysdict; if (v == NULL) { - if (_PyDict_GetItemId(sd, key) == NULL) { + if (_PyDict_GetItemId(sd, key) == NULL) { return 0; - } - else { + } + else { return _PyDict_DelItemId(sd, key); - } + } } - else { + else { return _PyDict_SetItemId(sd, key, v); - } + } } int -_PySys_SetObjectId(_Py_Identifier *key, PyObject *v) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return sys_set_object_id(tstate, key, v); -} - -static int -sys_set_object(PyThreadState *tstate, const char *name, PyObject *v) -{ - PyObject *sd = tstate->interp->sysdict; +_PySys_SetObjectId(_Py_Identifier *key, PyObject *v) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return sys_set_object_id(tstate, key, v); +} + +static int +sys_set_object(PyThreadState *tstate, const char *name, PyObject *v) +{ + PyObject *sd = tstate->interp->sysdict; if (v == NULL) { - if (PyDict_GetItemString(sd, name) == NULL) { + if (PyDict_GetItemString(sd, name) == NULL) { return 0; - } - else { + } + else { return PyDict_DelItemString(sd, name); - } + } } - else { + else { return PyDict_SetItemString(sd, name, v); - } -} - -int -PySys_SetObject(const char *name, PyObject *v) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return sys_set_object(tstate, name, v); -} - - -static int -should_audit(PyInterpreterState *is) -{ - /* tstate->interp cannot be NULL, but test it just in case - for extra safety */ - assert(is != NULL); - if (!is) { - return 0; - } - return (is->runtime->audit_hook_head - || is->audit_hooks - || PyDTrace_AUDIT_ENABLED()); -} - - -static int -sys_audit_tstate(PyThreadState *ts, const char *event, - const char *argFormat, va_list vargs) -{ - /* N format is inappropriate, because you do not know - whether the reference is consumed by the call. - Assert rather than exception for perf reasons */ - assert(!argFormat || !strchr(argFormat, 'N')); - - if (!ts) { - /* Audit hooks cannot be called with a NULL thread state */ - return 0; - } - - /* The current implementation cannot be called if tstate is not - the current Python thread state. */ - assert(ts == _PyThreadState_GET()); - - /* Early exit when no hooks are registered */ - PyInterpreterState *is = ts->interp; - if (!should_audit(is)) { - return 0; - } - - PyObject *eventName = NULL; - PyObject *eventArgs = NULL; - PyObject *hooks = NULL; - PyObject *hook = NULL; - int res = -1; - - int dtrace = PyDTrace_AUDIT_ENABLED(); - - PyObject *exc_type, *exc_value, *exc_tb; - _PyErr_Fetch(ts, &exc_type, &exc_value, &exc_tb); - - /* Initialize event args now */ - if (argFormat && argFormat[0]) { - eventArgs = _Py_VaBuildValue_SizeT(argFormat, vargs); - if (eventArgs && !PyTuple_Check(eventArgs)) { - PyObject *argTuple = PyTuple_Pack(1, eventArgs); - Py_DECREF(eventArgs); - eventArgs = argTuple; - } - } - else { - eventArgs = PyTuple_New(0); - } - if (!eventArgs) { - goto exit; - } - - /* Call global hooks */ - _Py_AuditHookEntry *e = is->runtime->audit_hook_head; - for (; e; e = e->next) { - if (e->hookCFunction(event, eventArgs, e->userData) < 0) { - goto exit; - } - } - - /* Dtrace USDT point */ - if (dtrace) { - PyDTrace_AUDIT(event, (void *)eventArgs); - } - - /* Call interpreter hooks */ - if (is->audit_hooks) { - eventName = PyUnicode_FromString(event); - if (!eventName) { - goto exit; - } - - hooks = PyObject_GetIter(is->audit_hooks); - if (!hooks) { - goto exit; - } - - /* Disallow tracing in hooks unless explicitly enabled */ - ts->tracing++; - ts->use_tracing = 0; - while ((hook = PyIter_Next(hooks)) != NULL) { - _Py_IDENTIFIER(__cantrace__); - PyObject *o; - int canTrace = _PyObject_LookupAttrId(hook, &PyId___cantrace__, &o); - if (o) { - canTrace = PyObject_IsTrue(o); - Py_DECREF(o); - } - if (canTrace < 0) { - break; - } - if (canTrace) { - ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); - ts->tracing--; - } - PyObject* args[2] = {eventName, eventArgs}; - o = _PyObject_FastCallTstate(ts, hook, args, 2); - if (canTrace) { - ts->tracing++; - ts->use_tracing = 0; - } - if (!o) { - break; - } - Py_DECREF(o); - Py_CLEAR(hook); - } - ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); - ts->tracing--; - if (_PyErr_Occurred(ts)) { - goto exit; - } - } - - res = 0; - -exit: - Py_XDECREF(hook); - Py_XDECREF(hooks); - Py_XDECREF(eventName); - Py_XDECREF(eventArgs); - - if (!res) { - _PyErr_Restore(ts, exc_type, exc_value, exc_tb); - } - else { - assert(_PyErr_Occurred(ts)); - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - } - - return res; -} - -int -_PySys_Audit(PyThreadState *tstate, const char *event, - const char *argFormat, ...) -{ - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, argFormat); -#else - va_start(vargs); -#endif - int res = sys_audit_tstate(tstate, event, argFormat, vargs); - va_end(vargs); - return res; -} - -int -PySys_Audit(const char *event, const char *argFormat, ...) -{ - PyThreadState *tstate = _PyThreadState_GET(); - va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, argFormat); -#else - va_start(vargs); -#endif - int res = sys_audit_tstate(tstate, event, argFormat, vargs); - va_end(vargs); - return res; -} - -/* We expose this function primarily for our own cleanup during - * finalization. In general, it should not need to be called, - * and as such the function is not exported. - * - * Must be finalizing to clear hooks */ -void -_PySys_ClearAuditHooks(PyThreadState *ts) -{ - assert(ts != NULL); - if (!ts) { - return; - } - - _PyRuntimeState *runtime = ts->interp->runtime; - PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); - assert(finalizing == ts); - if (finalizing != ts) { - return; - } - - const PyConfig *config = _PyInterpreterState_GetConfig(ts->interp); - if (config->verbose) { - PySys_WriteStderr("# clear sys.audit hooks\n"); - } - - /* Hooks can abort later hooks for this event, but cannot - abort the clear operation itself. */ - _PySys_Audit(ts, "cpython._PySys_ClearAuditHooks", NULL); - _PyErr_Clear(ts); - - _Py_AuditHookEntry *e = runtime->audit_hook_head, *n; - runtime->audit_hook_head = NULL; - while (e) { - n = e->next; - PyMem_RawFree(e); - e = n; - } -} - -int -PySys_AddAuditHook(Py_AuditHookFunction hook, void *userData) -{ - /* tstate can be NULL, so access directly _PyRuntime: - PySys_AddAuditHook() can be called before Python is initialized. */ - _PyRuntimeState *runtime = &_PyRuntime; - PyThreadState *tstate; - if (runtime->initialized) { - tstate = _PyRuntimeState_GetThreadState(runtime); - } - else { - tstate = NULL; - } - - /* Invoke existing audit hooks to allow them an opportunity to abort. */ - /* Cannot invoke hooks until we are initialized */ - if (tstate != NULL) { - if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_RuntimeError)) { - /* We do not report errors derived from RuntimeError */ - _PyErr_Clear(tstate); - return 0; - } - return -1; - } - } - - _Py_AuditHookEntry *e = runtime->audit_hook_head; - if (!e) { - e = (_Py_AuditHookEntry*)PyMem_RawMalloc(sizeof(_Py_AuditHookEntry)); - runtime->audit_hook_head = e; - } else { - while (e->next) { - e = e->next; - } - e = e->next = (_Py_AuditHookEntry*)PyMem_RawMalloc( - sizeof(_Py_AuditHookEntry)); - } - - if (!e) { - if (tstate != NULL) { - _PyErr_NoMemory(tstate); - } - return -1; - } - - e->next = NULL; - e->hookCFunction = (Py_AuditHookFunction)hook; - e->userData = userData; - - return 0; -} - -/*[clinic input] -sys.addaudithook - - hook: object - -Adds a new audit hook callback. -[clinic start generated code]*/ - + } +} + +int +PySys_SetObject(const char *name, PyObject *v) +{ + PyThreadState *tstate = _PyThreadState_GET(); + return sys_set_object(tstate, name, v); +} + + +static int +should_audit(PyInterpreterState *is) +{ + /* tstate->interp cannot be NULL, but test it just in case + for extra safety */ + assert(is != NULL); + if (!is) { + return 0; + } + return (is->runtime->audit_hook_head + || is->audit_hooks + || PyDTrace_AUDIT_ENABLED()); +} + + +static int +sys_audit_tstate(PyThreadState *ts, const char *event, + const char *argFormat, va_list vargs) +{ + /* N format is inappropriate, because you do not know + whether the reference is consumed by the call. + Assert rather than exception for perf reasons */ + assert(!argFormat || !strchr(argFormat, 'N')); + + if (!ts) { + /* Audit hooks cannot be called with a NULL thread state */ + return 0; + } + + /* The current implementation cannot be called if tstate is not + the current Python thread state. */ + assert(ts == _PyThreadState_GET()); + + /* Early exit when no hooks are registered */ + PyInterpreterState *is = ts->interp; + if (!should_audit(is)) { + return 0; + } + + PyObject *eventName = NULL; + PyObject *eventArgs = NULL; + PyObject *hooks = NULL; + PyObject *hook = NULL; + int res = -1; + + int dtrace = PyDTrace_AUDIT_ENABLED(); + + PyObject *exc_type, *exc_value, *exc_tb; + _PyErr_Fetch(ts, &exc_type, &exc_value, &exc_tb); + + /* Initialize event args now */ + if (argFormat && argFormat[0]) { + eventArgs = _Py_VaBuildValue_SizeT(argFormat, vargs); + if (eventArgs && !PyTuple_Check(eventArgs)) { + PyObject *argTuple = PyTuple_Pack(1, eventArgs); + Py_DECREF(eventArgs); + eventArgs = argTuple; + } + } + else { + eventArgs = PyTuple_New(0); + } + if (!eventArgs) { + goto exit; + } + + /* Call global hooks */ + _Py_AuditHookEntry *e = is->runtime->audit_hook_head; + for (; e; e = e->next) { + if (e->hookCFunction(event, eventArgs, e->userData) < 0) { + goto exit; + } + } + + /* Dtrace USDT point */ + if (dtrace) { + PyDTrace_AUDIT(event, (void *)eventArgs); + } + + /* Call interpreter hooks */ + if (is->audit_hooks) { + eventName = PyUnicode_FromString(event); + if (!eventName) { + goto exit; + } + + hooks = PyObject_GetIter(is->audit_hooks); + if (!hooks) { + goto exit; + } + + /* Disallow tracing in hooks unless explicitly enabled */ + ts->tracing++; + ts->use_tracing = 0; + while ((hook = PyIter_Next(hooks)) != NULL) { + _Py_IDENTIFIER(__cantrace__); + PyObject *o; + int canTrace = _PyObject_LookupAttrId(hook, &PyId___cantrace__, &o); + if (o) { + canTrace = PyObject_IsTrue(o); + Py_DECREF(o); + } + if (canTrace < 0) { + break; + } + if (canTrace) { + ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->tracing--; + } + PyObject* args[2] = {eventName, eventArgs}; + o = _PyObject_FastCallTstate(ts, hook, args, 2); + if (canTrace) { + ts->tracing++; + ts->use_tracing = 0; + } + if (!o) { + break; + } + Py_DECREF(o); + Py_CLEAR(hook); + } + ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->tracing--; + if (_PyErr_Occurred(ts)) { + goto exit; + } + } + + res = 0; + +exit: + Py_XDECREF(hook); + Py_XDECREF(hooks); + Py_XDECREF(eventName); + Py_XDECREF(eventArgs); + + if (!res) { + _PyErr_Restore(ts, exc_type, exc_value, exc_tb); + } + else { + assert(_PyErr_Occurred(ts)); + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + } + + return res; +} + +int +_PySys_Audit(PyThreadState *tstate, const char *event, + const char *argFormat, ...) +{ + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, argFormat); +#else + va_start(vargs); +#endif + int res = sys_audit_tstate(tstate, event, argFormat, vargs); + va_end(vargs); + return res; +} + +int +PySys_Audit(const char *event, const char *argFormat, ...) +{ + PyThreadState *tstate = _PyThreadState_GET(); + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, argFormat); +#else + va_start(vargs); +#endif + int res = sys_audit_tstate(tstate, event, argFormat, vargs); + va_end(vargs); + return res; +} + +/* We expose this function primarily for our own cleanup during + * finalization. In general, it should not need to be called, + * and as such the function is not exported. + * + * Must be finalizing to clear hooks */ +void +_PySys_ClearAuditHooks(PyThreadState *ts) +{ + assert(ts != NULL); + if (!ts) { + return; + } + + _PyRuntimeState *runtime = ts->interp->runtime; + PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); + assert(finalizing == ts); + if (finalizing != ts) { + return; + } + + const PyConfig *config = _PyInterpreterState_GetConfig(ts->interp); + if (config->verbose) { + PySys_WriteStderr("# clear sys.audit hooks\n"); + } + + /* Hooks can abort later hooks for this event, but cannot + abort the clear operation itself. */ + _PySys_Audit(ts, "cpython._PySys_ClearAuditHooks", NULL); + _PyErr_Clear(ts); + + _Py_AuditHookEntry *e = runtime->audit_hook_head, *n; + runtime->audit_hook_head = NULL; + while (e) { + n = e->next; + PyMem_RawFree(e); + e = n; + } +} + +int +PySys_AddAuditHook(Py_AuditHookFunction hook, void *userData) +{ + /* tstate can be NULL, so access directly _PyRuntime: + PySys_AddAuditHook() can be called before Python is initialized. */ + _PyRuntimeState *runtime = &_PyRuntime; + PyThreadState *tstate; + if (runtime->initialized) { + tstate = _PyRuntimeState_GetThreadState(runtime); + } + else { + tstate = NULL; + } + + /* Invoke existing audit hooks to allow them an opportunity to abort. */ + /* Cannot invoke hooks until we are initialized */ + if (tstate != NULL) { + if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { + if (_PyErr_ExceptionMatches(tstate, PyExc_RuntimeError)) { + /* We do not report errors derived from RuntimeError */ + _PyErr_Clear(tstate); + return 0; + } + return -1; + } + } + + _Py_AuditHookEntry *e = runtime->audit_hook_head; + if (!e) { + e = (_Py_AuditHookEntry*)PyMem_RawMalloc(sizeof(_Py_AuditHookEntry)); + runtime->audit_hook_head = e; + } else { + while (e->next) { + e = e->next; + } + e = e->next = (_Py_AuditHookEntry*)PyMem_RawMalloc( + sizeof(_Py_AuditHookEntry)); + } + + if (!e) { + if (tstate != NULL) { + _PyErr_NoMemory(tstate); + } + return -1; + } + + e->next = NULL; + e->hookCFunction = (Py_AuditHookFunction)hook; + e->userData = userData; + + return 0; +} + +/*[clinic input] +sys.addaudithook + + hook: object + +Adds a new audit hook callback. +[clinic start generated code]*/ + +static PyObject * +sys_addaudithook_impl(PyObject *module, PyObject *hook) +/*[clinic end generated code: output=4f9c17aaeb02f44e input=0f3e191217a45e34]*/ +{ + PyThreadState *tstate = _PyThreadState_GET(); + + /* Invoke existing audit hooks to allow them an opportunity to abort. */ + if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { + if (_PyErr_ExceptionMatches(tstate, PyExc_Exception)) { + /* We do not report errors derived from Exception */ + _PyErr_Clear(tstate); + Py_RETURN_NONE; + } + return NULL; + } + + PyInterpreterState *is = tstate->interp; + if (is->audit_hooks == NULL) { + is->audit_hooks = PyList_New(0); + if (is->audit_hooks == NULL) { + return NULL; + } + } + + if (PyList_Append(is->audit_hooks, hook) < 0) { + return NULL; + } + + Py_RETURN_NONE; +} + +PyDoc_STRVAR(audit_doc, +"audit(event, *args)\n\ +\n\ +Passes the event to any audit hooks that are attached."); + +static PyObject * +sys_audit(PyObject *self, PyObject *const *args, Py_ssize_t argc) +{ + PyThreadState *tstate = _PyThreadState_GET(); + _Py_EnsureTstateNotNULL(tstate); + + if (argc == 0) { + _PyErr_SetString(tstate, PyExc_TypeError, + "audit() missing 1 required positional argument: " + "'event'"); + return NULL; + } + + if (!should_audit(tstate->interp)) { + Py_RETURN_NONE; + } + + PyObject *auditEvent = args[0]; + if (!auditEvent) { + _PyErr_SetString(tstate, PyExc_TypeError, + "expected str for argument 'event'"); + return NULL; + } + if (!PyUnicode_Check(auditEvent)) { + _PyErr_Format(tstate, PyExc_TypeError, + "expected str for argument 'event', not %.200s", + Py_TYPE(auditEvent)->tp_name); + return NULL; + } + const char *event = PyUnicode_AsUTF8(auditEvent); + if (!event) { + return NULL; + } + + PyObject *auditArgs = _PyTuple_FromArray(args + 1, argc - 1); + if (!auditArgs) { + return NULL; + } + + int res = _PySys_Audit(tstate, event, "O", auditArgs); + Py_DECREF(auditArgs); + + if (res < 0) { + return NULL; + } + + Py_RETURN_NONE; +} + + static PyObject * -sys_addaudithook_impl(PyObject *module, PyObject *hook) -/*[clinic end generated code: output=4f9c17aaeb02f44e input=0f3e191217a45e34]*/ -{ - PyThreadState *tstate = _PyThreadState_GET(); - - /* Invoke existing audit hooks to allow them an opportunity to abort. */ - if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_Exception)) { - /* We do not report errors derived from Exception */ - _PyErr_Clear(tstate); - Py_RETURN_NONE; - } - return NULL; - } - - PyInterpreterState *is = tstate->interp; - if (is->audit_hooks == NULL) { - is->audit_hooks = PyList_New(0); - if (is->audit_hooks == NULL) { - return NULL; - } - } - - if (PyList_Append(is->audit_hooks, hook) < 0) { - return NULL; - } - - Py_RETURN_NONE; -} - -PyDoc_STRVAR(audit_doc, -"audit(event, *args)\n\ -\n\ -Passes the event to any audit hooks that are attached."); - -static PyObject * -sys_audit(PyObject *self, PyObject *const *args, Py_ssize_t argc) -{ - PyThreadState *tstate = _PyThreadState_GET(); - _Py_EnsureTstateNotNULL(tstate); - - if (argc == 0) { - _PyErr_SetString(tstate, PyExc_TypeError, - "audit() missing 1 required positional argument: " - "'event'"); - return NULL; - } - - if (!should_audit(tstate->interp)) { - Py_RETURN_NONE; - } - - PyObject *auditEvent = args[0]; - if (!auditEvent) { - _PyErr_SetString(tstate, PyExc_TypeError, - "expected str for argument 'event'"); - return NULL; - } - if (!PyUnicode_Check(auditEvent)) { - _PyErr_Format(tstate, PyExc_TypeError, - "expected str for argument 'event', not %.200s", - Py_TYPE(auditEvent)->tp_name); - return NULL; - } - const char *event = PyUnicode_AsUTF8(auditEvent); - if (!event) { - return NULL; - } - - PyObject *auditArgs = _PyTuple_FromArray(args + 1, argc - 1); - if (!auditArgs) { - return NULL; - } - - int res = _PySys_Audit(tstate, event, "O", auditArgs); - Py_DECREF(auditArgs); - - if (res < 0) { - return NULL; - } - - Py_RETURN_NONE; -} - - -static PyObject * sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *keywords) { - PyThreadState *tstate = _PyThreadState_GET(); - assert(!_PyErr_Occurred(tstate)); + PyThreadState *tstate = _PyThreadState_GET(); + assert(!_PyErr_Occurred(tstate)); char *envar = Py_GETENV("PYTHONBREAKPOINT"); if (envar == NULL || strlen(envar) == 0) { @@ -523,7 +523,7 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb * we need to save a copy of envar. */ envar = _PyMem_RawStrdup(envar); if (envar == NULL) { - _PyErr_NoMemory(tstate); + _PyErr_NoMemory(tstate); return NULL; } const char *last_dot = strrchr(envar, '.'); @@ -548,11 +548,11 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb return NULL; } - PyObject *module = PyImport_Import(modulepath); + PyObject *module = PyImport_Import(modulepath); Py_DECREF(modulepath); if (module == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_ImportError)) { + if (_PyErr_ExceptionMatches(tstate, PyExc_ImportError)) { goto warn; } PyMem_RawFree(envar); @@ -563,20 +563,20 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb Py_DECREF(module); if (hook == NULL) { - if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { + if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { goto warn; } PyMem_RawFree(envar); return NULL; } PyMem_RawFree(envar); - PyObject *retval = PyObject_Vectorcall(hook, args, nargs, keywords); + PyObject *retval = PyObject_Vectorcall(hook, args, nargs, keywords); Py_DECREF(hook); return retval; warn: /* If any of the imports went wrong, then warn and ignore. */ - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); int status = PyErr_WarnFormat( PyExc_RuntimeWarning, 0, "Ignoring unimportable $PYTHONBREAKPOINT: \"%s\"", envar); @@ -626,12 +626,12 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o) if (encoded == NULL) goto error; - if (_PyObject_LookupAttrId(outf, &PyId_buffer, &buffer) < 0) { - Py_DECREF(encoded); - goto error; - } + if (_PyObject_LookupAttrId(outf, &PyId_buffer, &buffer) < 0) { + Py_DECREF(encoded); + goto error; + } if (buffer) { - result = _PyObject_CallMethodIdOneArg(buffer, &PyId_write, encoded); + result = _PyObject_CallMethodIdOneArg(buffer, &PyId_write, encoded); Py_DECREF(buffer); Py_DECREF(encoded); if (result == NULL) @@ -659,30 +659,30 @@ finally: return ret; } -/*[clinic input] -sys.displayhook - - object as o: object - / - -Print an object to sys.stdout and also save it in builtins._ -[clinic start generated code]*/ - +/*[clinic input] +sys.displayhook + + object as o: object + / + +Print an object to sys.stdout and also save it in builtins._ +[clinic start generated code]*/ + static PyObject * -sys_displayhook(PyObject *module, PyObject *o) -/*[clinic end generated code: output=347477d006df92ed input=08ba730166d7ef72]*/ +sys_displayhook(PyObject *module, PyObject *o) +/*[clinic end generated code: output=347477d006df92ed input=08ba730166d7ef72]*/ { PyObject *outf; PyObject *builtins; static PyObject *newline = NULL; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); builtins = _PyImport_GetModuleId(&PyId_builtins); if (builtins == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_SetString(tstate, PyExc_RuntimeError, - "lost builtins module"); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_SetString(tstate, PyExc_RuntimeError, + "lost builtins module"); + } return NULL; } Py_DECREF(builtins); @@ -695,21 +695,21 @@ sys_displayhook(PyObject *module, PyObject *o) } if (_PyObject_SetAttrId(builtins, &PyId__, Py_None) != 0) return NULL; - outf = sys_get_object_id(tstate, &PyId_stdout); + outf = sys_get_object_id(tstate, &PyId_stdout); if (outf == NULL || outf == Py_None) { - _PyErr_SetString(tstate, PyExc_RuntimeError, "lost sys.stdout"); + _PyErr_SetString(tstate, PyExc_RuntimeError, "lost sys.stdout"); return NULL; } if (PyFile_WriteObject(o, outf, 0) != 0) { - if (_PyErr_ExceptionMatches(tstate, PyExc_UnicodeEncodeError)) { - int err; + if (_PyErr_ExceptionMatches(tstate, PyExc_UnicodeEncodeError)) { + int err; /* repr(o) is not encodable to sys.stdout.encoding with * sys.stdout.errors error handler (which is probably 'strict') */ - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); err = sys_displayhook_unencodable(outf, o); - if (err) { + if (err) { return NULL; - } + } } else { return NULL; @@ -728,41 +728,41 @@ sys_displayhook(PyObject *module, PyObject *o) } -/*[clinic input] -sys.excepthook - - exctype: object - value: object - traceback: object - / - -Handle an exception by displaying it with a traceback on sys.stderr. -[clinic start generated code]*/ - +/*[clinic input] +sys.excepthook + + exctype: object + value: object + traceback: object + / + +Handle an exception by displaying it with a traceback on sys.stderr. +[clinic start generated code]*/ + static PyObject * -sys_excepthook_impl(PyObject *module, PyObject *exctype, PyObject *value, - PyObject *traceback) -/*[clinic end generated code: output=18d99fdda21b6b5e input=ecf606fa826f19d9]*/ +sys_excepthook_impl(PyObject *module, PyObject *exctype, PyObject *value, + PyObject *traceback) +/*[clinic end generated code: output=18d99fdda21b6b5e input=ecf606fa826f19d9]*/ { - PyErr_Display(exctype, value, traceback); + PyErr_Display(exctype, value, traceback); Py_RETURN_NONE; } -/*[clinic input] -sys.exc_info - -Return current exception information: (type, value, traceback). - -Return information about the most recent exception caught by an except -clause in the current stack frame or in an older stack frame. -[clinic start generated code]*/ - +/*[clinic input] +sys.exc_info + +Return current exception information: (type, value, traceback). + +Return information about the most recent exception caught by an except +clause in the current stack frame or in an older stack frame. +[clinic start generated code]*/ + static PyObject * -sys_exc_info_impl(PyObject *module) -/*[clinic end generated code: output=3afd0940cf3a4d30 input=b5c5bf077788a3e5]*/ +sys_exc_info_impl(PyObject *module) +/*[clinic end generated code: output=3afd0940cf3a4d30 input=b5c5bf077788a3e5]*/ { - _PyErr_StackItem *err_info = _PyErr_GetTopmostException(_PyThreadState_GET()); + _PyErr_StackItem *err_info = _PyErr_GetTopmostException(_PyThreadState_GET()); return Py_BuildValue( "(OOO)", err_info->exc_type != NULL ? err_info->exc_type : Py_None, @@ -772,126 +772,126 @@ sys_exc_info_impl(PyObject *module) } -/*[clinic input] -sys.unraisablehook - - unraisable: object - / - -Handle an unraisable exception. - -The unraisable argument has the following attributes: - -* exc_type: Exception type. -* exc_value: Exception value, can be None. -* exc_traceback: Exception traceback, can be None. -* err_msg: Error message, can be None. -* object: Object causing the exception, can be None. -[clinic start generated code]*/ - +/*[clinic input] +sys.unraisablehook + + unraisable: object + / + +Handle an unraisable exception. + +The unraisable argument has the following attributes: + +* exc_type: Exception type. +* exc_value: Exception value, can be None. +* exc_traceback: Exception traceback, can be None. +* err_msg: Error message, can be None. +* object: Object causing the exception, can be None. +[clinic start generated code]*/ + +static PyObject * +sys_unraisablehook(PyObject *module, PyObject *unraisable) +/*[clinic end generated code: output=bb92838b32abaa14 input=ec3af148294af8d3]*/ +{ + return _PyErr_WriteUnraisableDefaultHook(unraisable); +} + + +/*[clinic input] +sys.exit + + status: object = None + / + +Exit the interpreter by raising SystemExit(status). + +If the status is omitted or None, it defaults to zero (i.e., success). +If the status is an integer, it will be used as the system exit status. +If it is another kind of object, it will be printed and the system +exit status will be one (i.e., failure). +[clinic start generated code]*/ + static PyObject * -sys_unraisablehook(PyObject *module, PyObject *unraisable) -/*[clinic end generated code: output=bb92838b32abaa14 input=ec3af148294af8d3]*/ -{ - return _PyErr_WriteUnraisableDefaultHook(unraisable); -} - - -/*[clinic input] -sys.exit - - status: object = None - / - -Exit the interpreter by raising SystemExit(status). - -If the status is omitted or None, it defaults to zero (i.e., success). -If the status is an integer, it will be used as the system exit status. -If it is another kind of object, it will be printed and the system -exit status will be one (i.e., failure). -[clinic start generated code]*/ - -static PyObject * -sys_exit_impl(PyObject *module, PyObject *status) -/*[clinic end generated code: output=13870986c1ab2ec0 input=b86ca9497baa94f2]*/ -{ +sys_exit_impl(PyObject *module, PyObject *status) +/*[clinic end generated code: output=13870986c1ab2ec0 input=b86ca9497baa94f2]*/ +{ /* Raise SystemExit so callers may catch it or clean up. */ - PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_SetObject(tstate, PyExc_SystemExit, status); + PyThreadState *tstate = _PyThreadState_GET(); + _PyErr_SetObject(tstate, PyExc_SystemExit, status); return NULL; } -/*[clinic input] -sys.getdefaultencoding - -Return the current default encoding used by the Unicode implementation. -[clinic start generated code]*/ - +/*[clinic input] +sys.getdefaultencoding + +Return the current default encoding used by the Unicode implementation. +[clinic start generated code]*/ + static PyObject * -sys_getdefaultencoding_impl(PyObject *module) -/*[clinic end generated code: output=256d19dfcc0711e6 input=d416856ddbef6909]*/ +sys_getdefaultencoding_impl(PyObject *module) +/*[clinic end generated code: output=256d19dfcc0711e6 input=d416856ddbef6909]*/ { return PyUnicode_FromString(PyUnicode_GetDefaultEncoding()); } -/*[clinic input] -sys.getfilesystemencoding +/*[clinic input] +sys.getfilesystemencoding + +Return the encoding used to convert Unicode filenames to OS filenames. +[clinic start generated code]*/ -Return the encoding used to convert Unicode filenames to OS filenames. -[clinic start generated code]*/ - static PyObject * -sys_getfilesystemencoding_impl(PyObject *module) -/*[clinic end generated code: output=1dc4bdbe9be44aa7 input=8475f8649b8c7d8c]*/ +sys_getfilesystemencoding_impl(PyObject *module) +/*[clinic end generated code: output=1dc4bdbe9be44aa7 input=8475f8649b8c7d8c]*/ { - PyInterpreterState *interp = _PyInterpreterState_GET(); - const PyConfig *config = _PyInterpreterState_GetConfig(interp); - return PyUnicode_FromWideChar(config->filesystem_encoding, -1); + PyInterpreterState *interp = _PyInterpreterState_GET(); + const PyConfig *config = _PyInterpreterState_GetConfig(interp); + return PyUnicode_FromWideChar(config->filesystem_encoding, -1); } -/*[clinic input] -sys.getfilesystemencodeerrors +/*[clinic input] +sys.getfilesystemencodeerrors + +Return the error mode used Unicode to OS filename conversion. +[clinic start generated code]*/ -Return the error mode used Unicode to OS filename conversion. -[clinic start generated code]*/ - static PyObject * -sys_getfilesystemencodeerrors_impl(PyObject *module) -/*[clinic end generated code: output=ba77b36bbf7c96f5 input=22a1e8365566f1e5]*/ -{ - PyInterpreterState *interp = _PyInterpreterState_GET(); - const PyConfig *config = _PyInterpreterState_GetConfig(interp); - return PyUnicode_FromWideChar(config->filesystem_errors, -1); -} - -/*[clinic input] -sys.intern - - string as s: unicode - / - -``Intern'' the given string. - -This enters the string in the (global) table of interned strings whose -purpose is to speed up dictionary lookups. Return the string itself or -the previously interned string object with the same value. -[clinic start generated code]*/ - +sys_getfilesystemencodeerrors_impl(PyObject *module) +/*[clinic end generated code: output=ba77b36bbf7c96f5 input=22a1e8365566f1e5]*/ +{ + PyInterpreterState *interp = _PyInterpreterState_GET(); + const PyConfig *config = _PyInterpreterState_GetConfig(interp); + return PyUnicode_FromWideChar(config->filesystem_errors, -1); +} + +/*[clinic input] +sys.intern + + string as s: unicode + / + +``Intern'' the given string. + +This enters the string in the (global) table of interned strings whose +purpose is to speed up dictionary lookups. Return the string itself or +the previously interned string object with the same value. +[clinic start generated code]*/ + static PyObject * -sys_intern_impl(PyObject *module, PyObject *s) -/*[clinic end generated code: output=be680c24f5c9e5d6 input=849483c006924e2f]*/ +sys_intern_impl(PyObject *module, PyObject *s) +/*[clinic end generated code: output=be680c24f5c9e5d6 input=849483c006924e2f]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (PyUnicode_CheckExact(s)) { Py_INCREF(s); PyUnicode_InternInPlace(&s); return s; } else { - _PyErr_Format(tstate, PyExc_TypeError, - "can't intern %.400s", Py_TYPE(s)->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "can't intern %.400s", Py_TYPE(s)->tp_name); return NULL; } } @@ -926,20 +926,20 @@ trace_init(void) static PyObject * -call_trampoline(PyThreadState *tstate, PyObject* callback, +call_trampoline(PyThreadState *tstate, PyObject* callback, PyFrameObject *frame, int what, PyObject *arg) { if (PyFrame_FastToLocalsWithError(frame) < 0) { return NULL; } - PyObject *stack[3]; + PyObject *stack[3]; stack[0] = (PyObject *)frame; stack[1] = whatstrings[what]; stack[2] = (arg != NULL) ? arg : Py_None; /* call the Python-level function */ - PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3); + PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3); PyFrame_LocalsToFast(frame, 1); if (result == NULL) { @@ -953,17 +953,17 @@ static int profile_trampoline(PyObject *self, PyFrameObject *frame, int what, PyObject *arg) { - if (arg == NULL) { - arg = Py_None; - } + if (arg == NULL) { + arg = Py_None; + } - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *result = call_trampoline(tstate, self, frame, what, arg); + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *result = call_trampoline(tstate, self, frame, what, arg); if (result == NULL) { - _PyEval_SetProfile(tstate, NULL, NULL); + _PyEval_SetProfile(tstate, NULL, NULL); return -1; } - + Py_DECREF(result); return 0; } @@ -973,24 +973,24 @@ trace_trampoline(PyObject *self, PyFrameObject *frame, int what, PyObject *arg) { PyObject *callback; - if (what == PyTrace_CALL) { + if (what == PyTrace_CALL) { callback = self; - } - else { + } + else { callback = frame->f_trace; - } - if (callback == NULL) { + } + if (callback == NULL) { return 0; - } - - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *result = call_trampoline(tstate, callback, frame, what, arg); + } + + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *result = call_trampoline(tstate, callback, frame, what, arg); if (result == NULL) { - _PyEval_SetTrace(tstate, NULL, NULL); + _PyEval_SetTrace(tstate, NULL, NULL); Py_CLEAR(frame->f_trace); return -1; } - + if (result != Py_None) { Py_XSETREF(frame->f_trace, result); } @@ -1003,21 +1003,21 @@ trace_trampoline(PyObject *self, PyFrameObject *frame, static PyObject * sys_settrace(PyObject *self, PyObject *args) { - if (trace_init() == -1) { + if (trace_init() == -1) { return NULL; - } - - PyThreadState *tstate = _PyThreadState_GET(); - if (args == Py_None) { - if (_PyEval_SetTrace(tstate, NULL, NULL) < 0) { - return NULL; - } - } - else { - if (_PyEval_SetTrace(tstate, trace_trampoline, args) < 0) { - return NULL; - } - } + } + + PyThreadState *tstate = _PyThreadState_GET(); + if (args == Py_None) { + if (_PyEval_SetTrace(tstate, NULL, NULL) < 0) { + return NULL; + } + } + else { + if (_PyEval_SetTrace(tstate, trace_trampoline, args) < 0) { + return NULL; + } + } Py_RETURN_NONE; } @@ -1028,19 +1028,19 @@ Set the global debug tracing function. It will be called on each\n\ function call. See the debugger chapter in the library manual." ); -/*[clinic input] -sys.gettrace - -Return the global debug tracing function set with sys.settrace. - -See the debugger chapter in the library manual. -[clinic start generated code]*/ - +/*[clinic input] +sys.gettrace + +Return the global debug tracing function set with sys.settrace. + +See the debugger chapter in the library manual. +[clinic start generated code]*/ + static PyObject * -sys_gettrace_impl(PyObject *module) -/*[clinic end generated code: output=e97e3a4d8c971b6e input=373b51bb2147f4d8]*/ +sys_gettrace_impl(PyObject *module) +/*[clinic end generated code: output=e97e3a4d8c971b6e input=373b51bb2147f4d8]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_traceobj; if (temp == NULL) @@ -1052,21 +1052,21 @@ sys_gettrace_impl(PyObject *module) static PyObject * sys_setprofile(PyObject *self, PyObject *args) { - if (trace_init() == -1) { + if (trace_init() == -1) { return NULL; - } - - PyThreadState *tstate = _PyThreadState_GET(); - if (args == Py_None) { - if (_PyEval_SetProfile(tstate, NULL, NULL) < 0) { - return NULL; - } - } - else { - if (_PyEval_SetProfile(tstate, profile_trampoline, args) < 0) { - return NULL; - } - } + } + + PyThreadState *tstate = _PyThreadState_GET(); + if (args == Py_None) { + if (_PyEval_SetProfile(tstate, NULL, NULL) < 0) { + return NULL; + } + } + else { + if (_PyEval_SetProfile(tstate, profile_trampoline, args) < 0) { + return NULL; + } + } Py_RETURN_NONE; } @@ -1077,19 +1077,19 @@ Set the profiling function. It will be called on each function call\n\ and return. See the profiler chapter in the library manual." ); -/*[clinic input] -sys.getprofile - -Return the profiling function set with sys.setprofile. - -See the profiler chapter in the library manual. -[clinic start generated code]*/ - +/*[clinic input] +sys.getprofile + +Return the profiling function set with sys.setprofile. + +See the profiler chapter in the library manual. +[clinic start generated code]*/ + static PyObject * -sys_getprofile_impl(PyObject *module) -/*[clinic end generated code: output=579b96b373448188 input=1b3209d89a32965d]*/ +sys_getprofile_impl(PyObject *module) +/*[clinic end generated code: output=579b96b373448188 input=1b3209d89a32965d]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_profileobj; if (temp == NULL) @@ -1099,72 +1099,72 @@ sys_getprofile_impl(PyObject *module) } -/*[clinic input] -sys.setswitchinterval +/*[clinic input] +sys.setswitchinterval + + interval: double + / + +Set the ideal thread switching delay inside the Python interpreter. + +The actual frequency of switching threads can be lower if the +interpreter executes long sequences of uninterruptible code +(this is implementation-specific and workload-dependent). + +The parameter must represent the desired switching delay in seconds +A typical value is 0.005 (5 milliseconds). +[clinic start generated code]*/ - interval: double - / - -Set the ideal thread switching delay inside the Python interpreter. - -The actual frequency of switching threads can be lower if the -interpreter executes long sequences of uninterruptible code -(this is implementation-specific and workload-dependent). - -The parameter must represent the desired switching delay in seconds -A typical value is 0.005 (5 milliseconds). -[clinic start generated code]*/ - static PyObject * -sys_setswitchinterval_impl(PyObject *module, double interval) -/*[clinic end generated code: output=65a19629e5153983 input=561b477134df91d9]*/ +sys_setswitchinterval_impl(PyObject *module, double interval) +/*[clinic end generated code: output=65a19629e5153983 input=561b477134df91d9]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - if (interval <= 0.0) { - _PyErr_SetString(tstate, PyExc_ValueError, - "switch interval must be strictly positive"); + PyThreadState *tstate = _PyThreadState_GET(); + if (interval <= 0.0) { + _PyErr_SetString(tstate, PyExc_ValueError, + "switch interval must be strictly positive"); return NULL; } - _PyEval_SetSwitchInterval((unsigned long) (1e6 * interval)); + _PyEval_SetSwitchInterval((unsigned long) (1e6 * interval)); Py_RETURN_NONE; } -/*[clinic input] -sys.getswitchinterval -> double - -Return the current thread switch interval; see sys.setswitchinterval(). -[clinic start generated code]*/ - -static double -sys_getswitchinterval_impl(PyObject *module) -/*[clinic end generated code: output=a38c277c85b5096d input=bdf9d39c0ebbbb6f]*/ +/*[clinic input] +sys.getswitchinterval -> double + +Return the current thread switch interval; see sys.setswitchinterval(). +[clinic start generated code]*/ + +static double +sys_getswitchinterval_impl(PyObject *module) +/*[clinic end generated code: output=a38c277c85b5096d input=bdf9d39c0ebbbb6f]*/ { - return 1e-6 * _PyEval_GetSwitchInterval(); + return 1e-6 * _PyEval_GetSwitchInterval(); } -/*[clinic input] -sys.setrecursionlimit +/*[clinic input] +sys.setrecursionlimit + + limit as new_limit: int + / + +Set the maximum depth of the Python interpreter stack to n. + +This limit prevents infinite recursion from causing an overflow of the C +stack and crashing Python. The highest possible limit is platform- +dependent. +[clinic start generated code]*/ - limit as new_limit: int - / - -Set the maximum depth of the Python interpreter stack to n. - -This limit prevents infinite recursion from causing an overflow of the C -stack and crashing Python. The highest possible limit is platform- -dependent. -[clinic start generated code]*/ - static PyObject * -sys_setrecursionlimit_impl(PyObject *module, int new_limit) -/*[clinic end generated code: output=35e1c64754800ace input=b0f7a23393924af3]*/ +sys_setrecursionlimit_impl(PyObject *module, int new_limit) +/*[clinic end generated code: output=35e1c64754800ace input=b0f7a23393924af3]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (new_limit < 1) { - _PyErr_SetString(tstate, PyExc_ValueError, - "recursion limit must be greater or equal than 1"); + _PyErr_SetString(tstate, PyExc_ValueError, + "recursion limit must be greater or equal than 1"); return NULL; } @@ -1177,11 +1177,11 @@ sys_setrecursionlimit_impl(PyObject *module, int new_limit) Reject too low new limit if the current recursion depth is higher than the new low-water mark. Otherwise it may not be possible anymore to reset the overflowed flag to 0. */ - if (tstate->recursion_depth >= new_limit) { - _PyErr_Format(tstate, PyExc_RecursionError, - "cannot set the recursion limit to %i at " - "the recursion depth %i: the limit is too low", - new_limit, tstate->recursion_depth); + if (tstate->recursion_depth >= new_limit) { + _PyErr_Format(tstate, PyExc_RecursionError, + "cannot set the recursion limit to %i at " + "the recursion depth %i: the limit is too low", + new_limit, tstate->recursion_depth); return NULL; } @@ -1196,22 +1196,22 @@ sys.set_coroutine_origin_tracking_depth Enable or disable origin tracking for coroutine objects in this thread. -Coroutine objects will track 'depth' frames of traceback information -about where they came from, available in their cr_origin attribute. - -Set a depth of 0 to disable. +Coroutine objects will track 'depth' frames of traceback information +about where they came from, available in their cr_origin attribute. + +Set a depth of 0 to disable. [clinic start generated code]*/ static PyObject * sys_set_coroutine_origin_tracking_depth_impl(PyObject *module, int depth) -/*[clinic end generated code: output=0a2123c1cc6759c5 input=a1d0a05f89d2c426]*/ +/*[clinic end generated code: output=0a2123c1cc6759c5 input=a1d0a05f89d2c426]*/ { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (depth < 0) { - _PyErr_SetString(tstate, PyExc_ValueError, "depth must be >= 0"); + _PyErr_SetString(tstate, PyExc_ValueError, "depth must be >= 0"); return NULL; } - _PyEval_SetCoroutineOriginTrackingDepth(tstate, depth); + _PyEval_SetCoroutineOriginTrackingDepth(tstate, depth); Py_RETURN_NONE; } @@ -1233,7 +1233,7 @@ static PyTypeObject AsyncGenHooksType; PyDoc_STRVAR(asyncgen_hooks_doc, "asyncgen_hooks\n\ \n\ -A named tuple providing information about asynchronous\n\ +A named tuple providing information about asynchronous\n\ generators hooks. The attributes are read only."); static PyStructSequence_Field asyncgen_hooks_fields[] = { @@ -1255,7 +1255,7 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) static char *keywords[] = {"firstiter", "finalizer", NULL}; PyObject *firstiter = NULL; PyObject *finalizer = NULL; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (!PyArg_ParseTupleAndKeywords( args, kw, "|OO", keywords, @@ -1265,54 +1265,54 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) if (finalizer && finalizer != Py_None) { if (!PyCallable_Check(finalizer)) { - _PyErr_Format(tstate, PyExc_TypeError, - "callable finalizer expected, got %.50s", - Py_TYPE(finalizer)->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "callable finalizer expected, got %.50s", + Py_TYPE(finalizer)->tp_name); + return NULL; + } + if (_PyEval_SetAsyncGenFinalizer(finalizer) < 0) { return NULL; } - if (_PyEval_SetAsyncGenFinalizer(finalizer) < 0) { - return NULL; - } } - else if (finalizer == Py_None && _PyEval_SetAsyncGenFinalizer(NULL) < 0) { - return NULL; + else if (finalizer == Py_None && _PyEval_SetAsyncGenFinalizer(NULL) < 0) { + return NULL; } if (firstiter && firstiter != Py_None) { if (!PyCallable_Check(firstiter)) { - _PyErr_Format(tstate, PyExc_TypeError, - "callable firstiter expected, got %.50s", - Py_TYPE(firstiter)->tp_name); + _PyErr_Format(tstate, PyExc_TypeError, + "callable firstiter expected, got %.50s", + Py_TYPE(firstiter)->tp_name); + return NULL; + } + if (_PyEval_SetAsyncGenFirstiter(firstiter) < 0) { return NULL; } - if (_PyEval_SetAsyncGenFirstiter(firstiter) < 0) { - return NULL; - } } - else if (firstiter == Py_None && _PyEval_SetAsyncGenFirstiter(NULL) < 0) { - return NULL; + else if (firstiter == Py_None && _PyEval_SetAsyncGenFirstiter(NULL) < 0) { + return NULL; } Py_RETURN_NONE; } 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." ); -/*[clinic input] -sys.get_asyncgen_hooks - -Return the installed asynchronous generators hooks. - -This returns a namedtuple of the form (firstiter, finalizer). -[clinic start generated code]*/ - +/*[clinic input] +sys.get_asyncgen_hooks + +Return the installed asynchronous generators hooks. + +This returns a namedtuple of the form (firstiter, finalizer). +[clinic start generated code]*/ + static PyObject * -sys_get_asyncgen_hooks_impl(PyObject *module) -/*[clinic end generated code: output=53a253707146f6cf input=3676b9ea62b14625]*/ +sys_get_asyncgen_hooks_impl(PyObject *module) +/*[clinic end generated code: output=53a253707146f6cf input=3676b9ea62b14625]*/ { PyObject *res; PyObject *firstiter = _PyEval_GetAsyncGenFirstiter(); @@ -1346,7 +1346,7 @@ static PyTypeObject Hash_InfoType; PyDoc_STRVAR(hash_info_doc, "hash_info\n\ \n\ -A named tuple providing parameters used for computing\n\ +A named tuple providing parameters used for computing\n\ hashes. The attributes are read only."); static PyStructSequence_Field hash_info_fields[] = { @@ -1372,7 +1372,7 @@ static PyStructSequence_Desc hash_info_desc = { }; static PyObject * -get_hash_info(PyThreadState *tstate) +get_hash_info(PyThreadState *tstate) { PyObject *hash_info; int field = 0; @@ -1399,25 +1399,25 @@ get_hash_info(PyThreadState *tstate) PyLong_FromLong(hashfunc->seed_bits)); PyStructSequence_SET_ITEM(hash_info, field++, PyLong_FromLong(Py_HASH_CUTOFF)); - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { Py_CLEAR(hash_info); return NULL; } return hash_info; } -/*[clinic input] -sys.getrecursionlimit +/*[clinic input] +sys.getrecursionlimit -Return the current value of the recursion limit. +Return the current value of the recursion limit. -The recursion limit is the maximum depth of the Python interpreter -stack. This limit prevents infinite recursion from causing an overflow -of the C stack and crashing Python. -[clinic start generated code]*/ +The recursion limit is the maximum depth of the Python interpreter +stack. This limit prevents infinite recursion from causing an overflow +of the C stack and crashing Python. +[clinic start generated code]*/ static PyObject * -sys_getrecursionlimit_impl(PyObject *module) -/*[clinic end generated code: output=d571fb6b4549ef2e input=1c6129fd2efaeea8]*/ +sys_getrecursionlimit_impl(PyObject *module) +/*[clinic end generated code: output=d571fb6b4549ef2e input=1c6129fd2efaeea8]*/ { return PyLong_FromLong(Py_GetRecursionLimit()); } @@ -1441,12 +1441,12 @@ static PyStructSequence_Field windows_version_fields[] = { }; static PyStructSequence_Desc windows_version_desc = { - "sys.getwindowsversion", /* name */ - sys_getwindowsversion__doc__, /* doc */ - windows_version_fields, /* fields */ - 5 /* For backward compatibility, - only the first 5 items are accessible - via indexing, the rest are name only */ + "sys.getwindowsversion", /* name */ + sys_getwindowsversion__doc__, /* doc */ + windows_version_fields, /* fields */ + 5 /* For backward compatibility, + only the first 5 items are accessible + via indexing, the rest are name only */ }; /* Disable deprecation warnings about GetVersionEx as the result is @@ -1455,38 +1455,38 @@ static PyStructSequence_Desc windows_version_desc = { #pragma warning(push) #pragma warning(disable:4996) -/*[clinic input] -sys.getwindowsversion - -Return info about the running version of Windows as a named tuple. - -The members are named: major, minor, build, platform, service_pack, -service_pack_major, service_pack_minor, suite_mask, product_type and -platform_version. For backward compatibility, only the first 5 items -are available by indexing. All elements are numbers, except -service_pack and platform_type which are strings, and platform_version -which is a 3-tuple. Platform is always 2. Product_type may be 1 for a -workstation, 2 for a domain controller, 3 for a server. -Platform_version is a 3-tuple containing a version number that is -intended for identifying the OS rather than feature detection. -[clinic start generated code]*/ - +/*[clinic input] +sys.getwindowsversion + +Return info about the running version of Windows as a named tuple. + +The members are named: major, minor, build, platform, service_pack, +service_pack_major, service_pack_minor, suite_mask, product_type and +platform_version. For backward compatibility, only the first 5 items +are available by indexing. All elements are numbers, except +service_pack and platform_type which are strings, and platform_version +which is a 3-tuple. Platform is always 2. Product_type may be 1 for a +workstation, 2 for a domain controller, 3 for a server. +Platform_version is a 3-tuple containing a version number that is +intended for identifying the OS rather than feature detection. +[clinic start generated code]*/ + static PyObject * -sys_getwindowsversion_impl(PyObject *module) -/*[clinic end generated code: output=1ec063280b932857 input=73a228a328fee63a]*/ +sys_getwindowsversion_impl(PyObject *module) +/*[clinic end generated code: output=1ec063280b932857 input=73a228a328fee63a]*/ { PyObject *version; int pos = 0; - OSVERSIONINFOEXW ver; + OSVERSIONINFOEXW ver; DWORD realMajor, realMinor, realBuild; HANDLE hKernel32; wchar_t kernel32_path[MAX_PATH]; LPVOID verblock; DWORD verblock_size; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); ver.dwOSVersionInfoSize = sizeof(ver); - if (!GetVersionExW((OSVERSIONINFOW*) &ver)) + if (!GetVersionExW((OSVERSIONINFOW*) &ver)) return PyErr_SetFromWindowsErr(0); version = PyStructSequence_New(&WindowsVersionType); @@ -1497,7 +1497,7 @@ sys_getwindowsversion_impl(PyObject *module) PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwMinorVersion)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwBuildNumber)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.dwPlatformId)); - PyStructSequence_SET_ITEM(version, pos++, PyUnicode_FromWideChar(ver.szCSDVersion, -1)); + PyStructSequence_SET_ITEM(version, pos++, PyUnicode_FromWideChar(ver.szCSDVersion, -1)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wServicePackMajor)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wServicePackMinor)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wSuiteMask)); @@ -1511,9 +1511,9 @@ sys_getwindowsversion_impl(PyObject *module) // We need to read the version info from a system file resource // to accurately identify the OS version. If we fail for any reason, // just return whatever GetVersion said. - Py_BEGIN_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS hKernel32 = GetModuleHandleW(L"kernel32.dll"); - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS if (hKernel32 && GetModuleFileNameW(hKernel32, kernel32_path, MAX_PATH) && (verblock_size = GetFileVersionInfoSizeExW(0, kernel32_path, NULL)) && (verblock = PyMem_RawMalloc(verblock_size))) { @@ -1534,7 +1534,7 @@ sys_getwindowsversion_impl(PyObject *module) realBuild )); - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { Py_DECREF(version); return NULL; } @@ -1544,73 +1544,73 @@ sys_getwindowsversion_impl(PyObject *module) #pragma warning(pop) -/*[clinic input] -sys._enablelegacywindowsfsencoding - -Changes the default filesystem encoding to mbcs:replace. - -This is done for consistency with earlier versions of Python. See PEP -529 for more information. - -This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING -environment variable before launching Python. -[clinic start generated code]*/ - +/*[clinic input] +sys._enablelegacywindowsfsencoding + +Changes the default filesystem encoding to mbcs:replace. + +This is done for consistency with earlier versions of Python. See PEP +529 for more information. + +This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING +environment variable before launching Python. +[clinic start generated code]*/ + static PyObject * -sys__enablelegacywindowsfsencoding_impl(PyObject *module) -/*[clinic end generated code: output=f5c3855b45e24fe9 input=2bfa931a20704492]*/ +sys__enablelegacywindowsfsencoding_impl(PyObject *module) +/*[clinic end generated code: output=f5c3855b45e24fe9 input=2bfa931a20704492]*/ { - if (_PyUnicode_EnableLegacyWindowsFSEncoding() < 0) { - return NULL; - } + if (_PyUnicode_EnableLegacyWindowsFSEncoding() < 0) { + return NULL; + } Py_RETURN_NONE; } #endif /* MS_WINDOWS */ #ifdef HAVE_DLOPEN - -/*[clinic input] -sys.setdlopenflags - - flags as new_val: int - / - -Set the flags used by the interpreter for dlopen calls. - -This is used, for example, when the interpreter loads extension -modules. Among other things, this will enable a lazy resolving of -symbols when importing a module, if called as sys.setdlopenflags(0). -To share symbols across extension modules, call as -sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag -modules can be found in the os module (RTLD_xxx constants, e.g. -os.RTLD_LAZY). -[clinic start generated code]*/ - + +/*[clinic input] +sys.setdlopenflags + + flags as new_val: int + / + +Set the flags used by the interpreter for dlopen calls. + +This is used, for example, when the interpreter loads extension +modules. Among other things, this will enable a lazy resolving of +symbols when importing a module, if called as sys.setdlopenflags(0). +To share symbols across extension modules, call as +sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag +modules can be found in the os module (RTLD_xxx constants, e.g. +os.RTLD_LAZY). +[clinic start generated code]*/ + static PyObject * -sys_setdlopenflags_impl(PyObject *module, int new_val) -/*[clinic end generated code: output=ec918b7fe0a37281 input=4c838211e857a77f]*/ +sys_setdlopenflags_impl(PyObject *module, int new_val) +/*[clinic end generated code: output=ec918b7fe0a37281 input=4c838211e857a77f]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - tstate->interp->dlopenflags = new_val; + PyThreadState *tstate = _PyThreadState_GET(); + tstate->interp->dlopenflags = new_val; Py_RETURN_NONE; } -/*[clinic input] -sys.getdlopenflags - -Return the current value of the flags that are used for dlopen calls. - -The flag constants are defined in the os module. -[clinic start generated code]*/ - +/*[clinic input] +sys.getdlopenflags + +Return the current value of the flags that are used for dlopen calls. + +The flag constants are defined in the os module. +[clinic start generated code]*/ + static PyObject * -sys_getdlopenflags_impl(PyObject *module) -/*[clinic end generated code: output=e92cd1bc5005da6e input=dc4ea0899c53b4b6]*/ +sys_getdlopenflags_impl(PyObject *module) +/*[clinic end generated code: output=e92cd1bc5005da6e input=dc4ea0899c53b4b6]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - return PyLong_FromLong(tstate->interp->dlopenflags); + PyThreadState *tstate = _PyThreadState_GET(); + return PyLong_FromLong(tstate->interp->dlopenflags); } #endif /* HAVE_DLOPEN */ @@ -1619,16 +1619,16 @@ sys_getdlopenflags_impl(PyObject *module) /* Link with -lmalloc (or -lmpc) on an SGI */ #include <malloc.h> -/*[clinic input] -sys.mdebug - - flag: int - / -[clinic start generated code]*/ - +/*[clinic input] +sys.mdebug + + flag: int + / +[clinic start generated code]*/ + static PyObject * -sys_mdebug_impl(PyObject *module, int flag) -/*[clinic end generated code: output=5431d545847c3637 input=151d150ae1636f8a]*/ +sys_mdebug_impl(PyObject *module, int flag) +/*[clinic end generated code: output=5431d545847c3637 input=151d150ae1636f8a]*/ { int flag; mallopt(M_DEBUG, flag); @@ -1642,20 +1642,20 @@ _PySys_GetSizeOf(PyObject *o) PyObject *res = NULL; PyObject *method; Py_ssize_t size; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); /* Make sure the type is initialized. float gets initialized late */ - if (PyType_Ready(Py_TYPE(o)) < 0) { + if (PyType_Ready(Py_TYPE(o)) < 0) { return (size_t)-1; - } + } method = _PyObject_LookupSpecial(o, &PyId___sizeof__); if (method == NULL) { - if (!_PyErr_Occurred(tstate)) { - _PyErr_Format(tstate, PyExc_TypeError, - "Type %.100s doesn't define __sizeof__", - Py_TYPE(o)->tp_name); - } + if (!_PyErr_Occurred(tstate)) { + _PyErr_Format(tstate, PyExc_TypeError, + "Type %.100s doesn't define __sizeof__", + Py_TYPE(o)->tp_name); + } } else { res = _PyObject_CallNoArg(method); @@ -1667,17 +1667,17 @@ _PySys_GetSizeOf(PyObject *o) size = PyLong_AsSsize_t(res); Py_DECREF(res); - if (size == -1 && _PyErr_Occurred(tstate)) + if (size == -1 && _PyErr_Occurred(tstate)) return (size_t)-1; if (size < 0) { - _PyErr_SetString(tstate, PyExc_ValueError, - "__sizeof__() should return >= 0"); + _PyErr_SetString(tstate, PyExc_ValueError, + "__sizeof__() should return >= 0"); return (size_t)-1; } /* add gc_head size */ - if (_PyObject_IS_GC(o)) + if (_PyObject_IS_GC(o)) return ((size_t)size) + sizeof(PyGC_Head); return (size_t)size; } @@ -1688,19 +1688,19 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) static char *kwlist[] = {"object", "default", 0}; size_t size; PyObject *o, *dflt = NULL; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof", - kwlist, &o, &dflt)) { + kwlist, &o, &dflt)) { return NULL; - } + } size = _PySys_GetSizeOf(o); - if (size == (size_t)-1 && _PyErr_Occurred(tstate)) { + if (size == (size_t)-1 && _PyErr_Occurred(tstate)) { /* Has a default value been given */ - if (dflt != NULL && _PyErr_ExceptionMatches(tstate, PyExc_TypeError)) { - _PyErr_Clear(tstate); + if (dflt != NULL && _PyErr_ExceptionMatches(tstate, PyExc_TypeError)) { + _PyErr_Clear(tstate); Py_INCREF(dflt); return dflt; } @@ -1712,132 +1712,132 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) } PyDoc_STRVAR(getsizeof_doc, -"getsizeof(object [, default]) -> int\n\ +"getsizeof(object [, default]) -> int\n\ \n\ Return the size of object in bytes."); -/*[clinic input] -sys.getrefcount -> Py_ssize_t - - object: object - / - -Return the reference count of object. - -The count returned is generally one higher than you might expect, -because it includes the (temporary) reference as an argument to -getrefcount(). -[clinic start generated code]*/ - -static Py_ssize_t -sys_getrefcount_impl(PyObject *module, PyObject *object) -/*[clinic end generated code: output=5fd477f2264b85b2 input=bf474efd50a21535]*/ -{ - return Py_REFCNT(object); +/*[clinic input] +sys.getrefcount -> Py_ssize_t + + object: object + / + +Return the reference count of object. + +The count returned is generally one higher than you might expect, +because it includes the (temporary) reference as an argument to +getrefcount(). +[clinic start generated code]*/ + +static Py_ssize_t +sys_getrefcount_impl(PyObject *module, PyObject *object) +/*[clinic end generated code: output=5fd477f2264b85b2 input=bf474efd50a21535]*/ +{ + return Py_REFCNT(object); } #ifdef Py_REF_DEBUG -/*[clinic input] -sys.gettotalrefcount -> Py_ssize_t -[clinic start generated code]*/ - -static Py_ssize_t -sys_gettotalrefcount_impl(PyObject *module) -/*[clinic end generated code: output=4103886cf17c25bc input=53b744faa5d2e4f6]*/ +/*[clinic input] +sys.gettotalrefcount -> Py_ssize_t +[clinic start generated code]*/ + +static Py_ssize_t +sys_gettotalrefcount_impl(PyObject *module) +/*[clinic end generated code: output=4103886cf17c25bc input=53b744faa5d2e4f6]*/ { - return _Py_GetRefTotal(); + return _Py_GetRefTotal(); } #endif /* Py_REF_DEBUG */ -/*[clinic input] -sys.getallocatedblocks -> Py_ssize_t - -Return the number of memory blocks currently allocated. -[clinic start generated code]*/ - -static Py_ssize_t -sys_getallocatedblocks_impl(PyObject *module) -/*[clinic end generated code: output=f0c4e873f0b6dcf7 input=dab13ee346a0673e]*/ -{ - return _Py_GetAllocatedBlocks(); -} - - -/*[clinic input] -sys._getframe - - depth: int = 0 - / - -Return a frame object from the call stack. - -If optional integer depth is given, return the frame object that many -calls below the top of the stack. If that is deeper than the call -stack, ValueError is raised. The default for depth is zero, returning -the frame at the top of the call stack. - -This function should be used for internal and specialized purposes -only. -[clinic start generated code]*/ - +/*[clinic input] +sys.getallocatedblocks -> Py_ssize_t + +Return the number of memory blocks currently allocated. +[clinic start generated code]*/ + +static Py_ssize_t +sys_getallocatedblocks_impl(PyObject *module) +/*[clinic end generated code: output=f0c4e873f0b6dcf7 input=dab13ee346a0673e]*/ +{ + return _Py_GetAllocatedBlocks(); +} + + +/*[clinic input] +sys._getframe + + depth: int = 0 + / + +Return a frame object from the call stack. + +If optional integer depth is given, return the frame object that many +calls below the top of the stack. If that is deeper than the call +stack, ValueError is raised. The default for depth is zero, returning +the frame at the top of the call stack. + +This function should be used for internal and specialized purposes +only. +[clinic start generated code]*/ + static PyObject * -sys__getframe_impl(PyObject *module, int depth) -/*[clinic end generated code: output=d438776c04d59804 input=c1be8a6464b11ee5]*/ +sys__getframe_impl(PyObject *module, int depth) +/*[clinic end generated code: output=d438776c04d59804 input=c1be8a6464b11ee5]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *f = PyThreadState_GetFrame(tstate); + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *f = PyThreadState_GetFrame(tstate); - if (_PySys_Audit(tstate, "sys._getframe", "O", f) < 0) { - Py_DECREF(f); + if (_PySys_Audit(tstate, "sys._getframe", "O", f) < 0) { + Py_DECREF(f); return NULL; - } + } while (depth > 0 && f != NULL) { - PyFrameObject *back = PyFrame_GetBack(f); - Py_DECREF(f); - f = back; + PyFrameObject *back = PyFrame_GetBack(f); + Py_DECREF(f); + f = back; --depth; } if (f == NULL) { - _PyErr_SetString(tstate, PyExc_ValueError, - "call stack is not deep enough"); + _PyErr_SetString(tstate, PyExc_ValueError, + "call stack is not deep enough"); return NULL; } return (PyObject*)f; } -/*[clinic input] -sys._current_frames +/*[clinic input] +sys._current_frames + +Return a dict mapping each thread's thread id to its current stack frame. + +This function should be used for specialized purposes only. +[clinic start generated code]*/ -Return a dict mapping each thread's thread id to its current stack frame. - -This function should be used for specialized purposes only. -[clinic start generated code]*/ - static PyObject * -sys__current_frames_impl(PyObject *module) -/*[clinic end generated code: output=d2a41ac0a0a3809a input=2a9049c5f5033691]*/ +sys__current_frames_impl(PyObject *module) +/*[clinic end generated code: output=d2a41ac0a0a3809a input=2a9049c5f5033691]*/ { return _PyThread_CurrentFrames(); } -/*[clinic input] -sys.call_tracing - - func: object - args as funcargs: object(subclass_of='&PyTuple_Type') - / - -Call func(*args), while tracing is enabled. - -The tracing state is saved, and restored afterwards. This is intended -to be called from a debugger from a checkpoint, to recursively debug -some other code. -[clinic start generated code]*/ - +/*[clinic input] +sys.call_tracing + + func: object + args as funcargs: object(subclass_of='&PyTuple_Type') + / + +Call func(*args), while tracing is enabled. + +The tracing state is saved, and restored afterwards. This is intended +to be called from a debugger from a checkpoint, to recursively debug +some other code. +[clinic start generated code]*/ + static PyObject * -sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs) -/*[clinic end generated code: output=7e4999853cd4e5a6 input=5102e8b11049f92f]*/ +sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs) +/*[clinic end generated code: output=7e4999853cd4e5a6 input=5102e8b11049f92f]*/ { return _PyEval_CallTracing(func, funcargs); } @@ -1847,18 +1847,18 @@ sys_call_tracing_impl(PyObject *module, PyObject *func, PyObject *funcargs) extern "C" { #endif -/*[clinic input] -sys._debugmallocstats - -Print summary info to stderr about the state of pymalloc's structures. - -In Py_DEBUG mode, also perform some expensive internal consistency -checks. -[clinic start generated code]*/ - +/*[clinic input] +sys._debugmallocstats + +Print summary info to stderr about the state of pymalloc's structures. + +In Py_DEBUG mode, also perform some expensive internal consistency +checks. +[clinic start generated code]*/ + static PyObject * -sys__debugmallocstats_impl(PyObject *module) -/*[clinic end generated code: output=ec3565f8c7cee46a input=33c0c9c416f98424]*/ +sys__debugmallocstats_impl(PyObject *module) +/*[clinic end generated code: output=ec3565f8c7cee46a input=33c0c9c416f98424]*/ { #ifdef WITH_PYMALLOC if (_PyObject_DebugMallocStats(stderr)) { @@ -1884,102 +1884,102 @@ extern PyObject *_Py_GetDXProfile(PyObject *, PyObject *); } #endif - -/*[clinic input] -sys._clear_type_cache - -Clear the internal type lookup cache. -[clinic start generated code]*/ - + +/*[clinic input] +sys._clear_type_cache + +Clear the internal type lookup cache. +[clinic start generated code]*/ + static PyObject * -sys__clear_type_cache_impl(PyObject *module) -/*[clinic end generated code: output=20e48ca54a6f6971 input=127f3e04a8d9b555]*/ +sys__clear_type_cache_impl(PyObject *module) +/*[clinic end generated code: output=20e48ca54a6f6971 input=127f3e04a8d9b555]*/ { PyType_ClearCache(); Py_RETURN_NONE; } -/*[clinic input] -sys.is_finalizing +/*[clinic input] +sys.is_finalizing + +Return True if Python is exiting. +[clinic start generated code]*/ -Return True if Python is exiting. -[clinic start generated code]*/ - static PyObject * -sys_is_finalizing_impl(PyObject *module) -/*[clinic end generated code: output=735b5ff7962ab281 input=f0df747a039948a5]*/ +sys_is_finalizing_impl(PyObject *module) +/*[clinic end generated code: output=735b5ff7962ab281 input=f0df747a039948a5]*/ { return PyBool_FromLong(_Py_IsFinalizing()); } -#ifdef ANDROID_API_LEVEL -/*[clinic input] -sys.getandroidapilevel +#ifdef ANDROID_API_LEVEL +/*[clinic input] +sys.getandroidapilevel -Return the build time API version of Android as an integer. -[clinic start generated code]*/ +Return the build time API version of Android as an integer. +[clinic start generated code]*/ static PyObject * -sys_getandroidapilevel_impl(PyObject *module) -/*[clinic end generated code: output=214abf183a1c70c1 input=3e6d6c9fcdd24ac6]*/ +sys_getandroidapilevel_impl(PyObject *module) +/*[clinic end generated code: output=214abf183a1c70c1 input=3e6d6c9fcdd24ac6]*/ { return PyLong_FromLong(ANDROID_API_LEVEL); } #endif /* ANDROID_API_LEVEL */ - + static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ - SYS_ADDAUDITHOOK_METHODDEF - {"audit", (PyCFunction)(void(*)(void))sys_audit, METH_FASTCALL, audit_doc }, - {"breakpointhook", (PyCFunction)(void(*)(void))sys_breakpointhook, + SYS_ADDAUDITHOOK_METHODDEF + {"audit", (PyCFunction)(void(*)(void))sys_audit, METH_FASTCALL, audit_doc }, + {"breakpointhook", (PyCFunction)(void(*)(void))sys_breakpointhook, METH_FASTCALL | METH_KEYWORDS, breakpointhook_doc}, - SYS__CLEAR_TYPE_CACHE_METHODDEF - SYS__CURRENT_FRAMES_METHODDEF - SYS_DISPLAYHOOK_METHODDEF - SYS_EXC_INFO_METHODDEF - SYS_EXCEPTHOOK_METHODDEF - SYS_EXIT_METHODDEF - SYS_GETDEFAULTENCODING_METHODDEF - SYS_GETDLOPENFLAGS_METHODDEF - SYS_GETALLOCATEDBLOCKS_METHODDEF + SYS__CLEAR_TYPE_CACHE_METHODDEF + SYS__CURRENT_FRAMES_METHODDEF + SYS_DISPLAYHOOK_METHODDEF + SYS_EXC_INFO_METHODDEF + SYS_EXCEPTHOOK_METHODDEF + SYS_EXIT_METHODDEF + SYS_GETDEFAULTENCODING_METHODDEF + SYS_GETDLOPENFLAGS_METHODDEF + SYS_GETALLOCATEDBLOCKS_METHODDEF #ifdef DYNAMIC_EXECUTION_PROFILE {"getdxp", _Py_GetDXProfile, METH_VARARGS}, #endif - SYS_GETFILESYSTEMENCODING_METHODDEF - SYS_GETFILESYSTEMENCODEERRORS_METHODDEF + SYS_GETFILESYSTEMENCODING_METHODDEF + SYS_GETFILESYSTEMENCODEERRORS_METHODDEF #ifdef Py_TRACE_REFS {"getobjects", _Py_GetObjects, METH_VARARGS}, #endif - SYS_GETTOTALREFCOUNT_METHODDEF - SYS_GETREFCOUNT_METHODDEF - SYS_GETRECURSIONLIMIT_METHODDEF - {"getsizeof", (PyCFunction)(void(*)(void))sys_getsizeof, + SYS_GETTOTALREFCOUNT_METHODDEF + SYS_GETREFCOUNT_METHODDEF + SYS_GETRECURSIONLIMIT_METHODDEF + {"getsizeof", (PyCFunction)(void(*)(void))sys_getsizeof, METH_VARARGS | METH_KEYWORDS, getsizeof_doc}, - SYS__GETFRAME_METHODDEF - SYS_GETWINDOWSVERSION_METHODDEF - SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF - SYS_INTERN_METHODDEF - SYS_IS_FINALIZING_METHODDEF - SYS_MDEBUG_METHODDEF - SYS_SETSWITCHINTERVAL_METHODDEF - SYS_GETSWITCHINTERVAL_METHODDEF - SYS_SETDLOPENFLAGS_METHODDEF + SYS__GETFRAME_METHODDEF + SYS_GETWINDOWSVERSION_METHODDEF + SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF + SYS_INTERN_METHODDEF + SYS_IS_FINALIZING_METHODDEF + SYS_MDEBUG_METHODDEF + SYS_SETSWITCHINTERVAL_METHODDEF + SYS_GETSWITCHINTERVAL_METHODDEF + SYS_SETDLOPENFLAGS_METHODDEF {"setprofile", sys_setprofile, METH_O, setprofile_doc}, - SYS_GETPROFILE_METHODDEF - SYS_SETRECURSIONLIMIT_METHODDEF + SYS_GETPROFILE_METHODDEF + SYS_SETRECURSIONLIMIT_METHODDEF {"settrace", sys_settrace, METH_O, settrace_doc}, - SYS_GETTRACE_METHODDEF - SYS_CALL_TRACING_METHODDEF - SYS__DEBUGMALLOCSTATS_METHODDEF + SYS_GETTRACE_METHODDEF + SYS_CALL_TRACING_METHODDEF + SYS__DEBUGMALLOCSTATS_METHODDEF SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF - {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks, + {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks, METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc}, - SYS_GET_ASYNCGEN_HOOKS_METHODDEF - SYS_GETANDROIDAPILEVEL_METHODDEF - SYS_UNRAISABLEHOOK_METHODDEF + SYS_GET_ASYNCGEN_HOOKS_METHODDEF + SYS_GETANDROIDAPILEVEL_METHODDEF + SYS_UNRAISABLEHOOK_METHODDEF {NULL, NULL} /* sentinel */ }; @@ -2058,7 +2058,7 @@ _alloc_preinit_entry(const wchar_t *value) PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); return node; -} +} static int _append_preinit_entry(_Py_PreInitEntry *optionlist, const wchar_t *value) @@ -2080,7 +2080,7 @@ _append_preinit_entry(_Py_PreInitEntry *optionlist, const wchar_t *value) last_entry->next = new_entry; } return 0; -} +} static void _clear_preinit_entries(_Py_PreInitEntry *optionlist) @@ -2097,49 +2097,49 @@ _clear_preinit_entries(_Py_PreInitEntry *optionlist) current = next; } PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); -} - - -PyStatus -_PySys_ReadPreinitWarnOptions(PyWideStringList *options) -{ - PyStatus status; - _Py_PreInitEntry entry; - - for (entry = _preinit_warnoptions; entry != NULL; entry = entry->next) { - status = PyWideStringList_Append(options, entry->value); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - +} + + +PyStatus +_PySys_ReadPreinitWarnOptions(PyWideStringList *options) +{ + PyStatus status; + _Py_PreInitEntry entry; + + for (entry = _preinit_warnoptions; entry != NULL; entry = entry->next) { + status = PyWideStringList_Append(options, entry->value); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + _clear_preinit_entries(&_preinit_warnoptions); - return _PyStatus_OK(); + return _PyStatus_OK(); } - -PyStatus -_PySys_ReadPreinitXOptions(PyConfig *config) + +PyStatus +_PySys_ReadPreinitXOptions(PyConfig *config) { - PyStatus status; - _Py_PreInitEntry entry; - - for (entry = _preinit_xoptions; entry != NULL; entry = entry->next) { - status = PyWideStringList_Append(&config->xoptions, entry->value); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + PyStatus status; + _Py_PreInitEntry entry; + + for (entry = _preinit_xoptions; entry != NULL; entry = entry->next) { + status = PyWideStringList_Append(&config->xoptions, entry->value); + if (_PyStatus_EXCEPTION(status)) { + return status; + } } - _clear_preinit_entries(&_preinit_xoptions); - return _PyStatus_OK(); -} + _clear_preinit_entries(&_preinit_xoptions); + return _PyStatus_OK(); +} + - static PyObject * -get_warnoptions(PyThreadState *tstate) +get_warnoptions(PyThreadState *tstate) { - PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); + PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); if (warnoptions == NULL || !PyList_Check(warnoptions)) { /* PEP432 TODO: we can reach this if warnoptions is NULL in the main * interpreter config. When that happens, we need to properly set @@ -2152,10 +2152,10 @@ get_warnoptions(PyThreadState *tstate) * reachable again. */ warnoptions = PyList_New(0); - if (warnoptions == NULL) { + if (warnoptions == NULL) { return NULL; - } - if (sys_set_object_id(tstate, &PyId_warnoptions, warnoptions)) { + } + if (sys_set_object_id(tstate, &PyId_warnoptions, warnoptions)) { Py_DECREF(warnoptions); return NULL; } @@ -2167,22 +2167,22 @@ get_warnoptions(PyThreadState *tstate) void PySys_ResetWarnOptions(void) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _clear_preinit_entries(&_preinit_warnoptions); return; } - PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); + PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); if (warnoptions == NULL || !PyList_Check(warnoptions)) return; PyList_SetSlice(warnoptions, 0, PyList_GET_SIZE(warnoptions), NULL); } -static int -_PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option) +static int +_PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option) { - PyObject *warnoptions = get_warnoptions(tstate); + PyObject *warnoptions = get_warnoptions(tstate); if (warnoptions == NULL) { return -1; } @@ -2195,19 +2195,19 @@ _PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option) void PySys_AddWarnOptionUnicode(PyObject *option) { - PyThreadState *tstate = _PyThreadState_GET(); - if (_PySys_AddWarnOptionWithError(tstate, option) < 0) { - /* No return value, therefore clear error state if possible */ - if (tstate) { - _PyErr_Clear(tstate); - } - } + PyThreadState *tstate = _PyThreadState_GET(); + if (_PySys_AddWarnOptionWithError(tstate, option) < 0) { + /* No return value, therefore clear error state if possible */ + if (tstate) { + _PyErr_Clear(tstate); + } + } } void PySys_AddWarnOption(const wchar_t *s) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _append_preinit_entry(&_preinit_warnoptions, s); return; @@ -2223,16 +2223,16 @@ PySys_AddWarnOption(const wchar_t *s) int PySys_HasWarnOptions(void) { - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); return (warnoptions != NULL && PyList_Check(warnoptions) && PyList_GET_SIZE(warnoptions) > 0); } static PyObject * -get_xoptions(PyThreadState *tstate) +get_xoptions(PyThreadState *tstate) { - PyObject *xoptions = sys_get_object_id(tstate, &PyId__xoptions); + PyObject *xoptions = sys_get_object_id(tstate, &PyId__xoptions); if (xoptions == NULL || !PyDict_Check(xoptions)) { /* PEP432 TODO: we can reach this if xoptions is NULL in the main * interpreter config. When that happens, we need to properly set @@ -2245,10 +2245,10 @@ get_xoptions(PyThreadState *tstate) * reachable again. */ xoptions = PyDict_New(); - if (xoptions == NULL) { + if (xoptions == NULL) { return NULL; - } - if (sys_set_object_id(tstate, &PyId__xoptions, xoptions)) { + } + if (sys_set_object_id(tstate, &PyId__xoptions, xoptions)) { Py_DECREF(xoptions); return NULL; } @@ -2257,13 +2257,13 @@ get_xoptions(PyThreadState *tstate) return xoptions; } -static int +static int _PySys_AddXOptionWithError(const wchar_t *s) { PyObject *name = NULL, *value = NULL; - PyThreadState *tstate = _PyThreadState_GET(); - PyObject *opts = get_xoptions(tstate); + PyThreadState *tstate = _PyThreadState_GET(); + PyObject *opts = get_xoptions(tstate); if (opts == NULL) { goto error; } @@ -2297,22 +2297,22 @@ error: void PySys_AddXOption(const wchar_t *s) { - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _append_preinit_entry(&_preinit_xoptions, s); return; } if (_PySys_AddXOptionWithError(s) < 0) { /* No return value, therefore clear error state if possible */ - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } } PyObject * PySys_GetXOptions(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return get_xoptions(tstate); + PyThreadState *tstate = _PyThreadState_GET(); + return get_xoptions(tstate); } /* XXX This doc string is too long to be a single string literal in VC++ 5.0. @@ -2357,17 +2357,17 @@ builtin_module_names -- tuple of module names built into this interpreter\n\ copyright -- copyright notice pertaining to this interpreter\n\ exec_prefix -- prefix used to find the machine-specific Python library\n\ executable -- absolute path of the executable binary of the Python interpreter\n\ -float_info -- a named tuple with information about the float implementation.\n\ +float_info -- a named tuple with information about the float implementation.\n\ float_repr_style -- string indicating the style of repr() output for floats\n\ -hash_info -- a named tuple with information about the hash algorithm.\n\ +hash_info -- a named tuple with information about the hash algorithm.\n\ hexversion -- version information encoded as a single integer\n\ implementation -- Python implementation information.\n\ -int_info -- a named tuple with information about the int implementation.\n\ +int_info -- a named tuple with information about the int implementation.\n\ maxsize -- the largest supported length of containers.\n\ maxunicode -- the value of the largest Unicode code point\n\ platform -- platform identifier\n\ prefix -- prefix used to find the Python library\n\ -thread_info -- a named tuple with information about the thread implementation.\n\ +thread_info -- a named tuple with information about the thread implementation.\n\ version -- the version of this interpreter as a string\n\ version_info -- version information as a named tuple\n\ " @@ -2383,7 +2383,7 @@ winver -- [Windows only] version number of the Python DLL\n\ #ifdef MS_WINDOWS /* concatenating string here */ PyDoc_STR( -"_enablelegacywindowsfsencoding -- [Windows only]\n\ +"_enablelegacywindowsfsencoding -- [Windows only]\n\ " ) #endif @@ -2451,41 +2451,41 @@ static PyStructSequence_Desc flags_desc = { }; static PyObject* -make_flags(PyThreadState *tstate) +make_flags(PyThreadState *tstate) { - PyInterpreterState *interp = tstate->interp; - const PyPreConfig *preconfig = &interp->runtime->preconfig; - const PyConfig *config = _PyInterpreterState_GetConfig(interp); + PyInterpreterState *interp = tstate->interp; + const PyPreConfig *preconfig = &interp->runtime->preconfig; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); - PyObject *seq = PyStructSequence_New(&FlagsType); - if (seq == NULL) { + PyObject *seq = PyStructSequence_New(&FlagsType); + if (seq == NULL) { return NULL; - } + } - int pos = 0; + int pos = 0; #define SetFlag(flag) \ PyStructSequence_SET_ITEM(seq, pos++, PyLong_FromLong(flag)) - SetFlag(config->parser_debug); - SetFlag(config->inspect); - SetFlag(config->interactive); - SetFlag(config->optimization_level); - SetFlag(!config->write_bytecode); - SetFlag(!config->user_site_directory); - SetFlag(!config->site_import); - SetFlag(!config->use_environment); - SetFlag(config->verbose); + SetFlag(config->parser_debug); + SetFlag(config->inspect); + SetFlag(config->interactive); + SetFlag(config->optimization_level); + SetFlag(!config->write_bytecode); + SetFlag(!config->user_site_directory); + SetFlag(!config->site_import); + SetFlag(!config->use_environment); + SetFlag(config->verbose); /* SetFlag(saw_unbuffered_flag); */ /* SetFlag(skipfirstline); */ - SetFlag(config->bytes_warning); - SetFlag(config->quiet); - SetFlag(config->use_hash_seed == 0 || config->hash_seed != 0); - SetFlag(config->isolated); - PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(config->dev_mode)); - SetFlag(preconfig->utf8_mode); + SetFlag(config->bytes_warning); + SetFlag(config->quiet); + SetFlag(config->use_hash_seed == 0 || config->hash_seed != 0); + SetFlag(config->isolated); + PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(config->dev_mode)); + SetFlag(preconfig->utf8_mode); #undef SetFlag - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { Py_DECREF(seq); return NULL; } @@ -2516,7 +2516,7 @@ static PyStructSequence_Desc version_info_desc = { }; static PyObject * -make_version_info(PyThreadState *tstate) +make_version_info(PyThreadState *tstate) { PyObject *version_info; char *s; @@ -2554,7 +2554,7 @@ make_version_info(PyThreadState *tstate) #undef SetIntItem #undef SetStrItem - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { Py_CLEAR(version_info); return NULL; } @@ -2671,10 +2671,10 @@ static struct PyModuleDef sysmodule = { } \ } while (0) -static PyStatus -_PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) +static PyStatus +_PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) { - PyObject *version_info; + PyObject *version_info; int res; /* stdin/stdout/stderr are set in pylifecycle.c */ @@ -2686,9 +2686,9 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) SET_SYS_FROM_STRING_BORROW( "__breakpointhook__", PyDict_GetItemString(sysdict, "breakpointhook")); - SET_SYS_FROM_STRING_BORROW("__unraisablehook__", - PyDict_GetItemString(sysdict, "unraisablehook")); - + SET_SYS_FROM_STRING_BORROW("__unraisablehook__", + PyDict_GetItemString(sysdict, "unraisablehook")); + SET_SYS_FROM_STRING("version", PyUnicode_FromString(Py_GetVersion())); SET_SYS_FROM_STRING("hexversion", @@ -2716,7 +2716,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) } } SET_SYS_FROM_STRING("hash_info", - get_hash_info(tstate)); + get_hash_info(tstate)); SET_SYS_FROM_STRING("maxunicode", PyLong_FromLong(0x10FFFF)); SET_SYS_FROM_STRING("builtin_module_names", @@ -2747,15 +2747,15 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) goto type_init_failed; } } - version_info = make_version_info(tstate); + version_info = make_version_info(tstate); SET_SYS_FROM_STRING("version_info", version_info); /* prevent user from creating new instances */ VersionInfoType.tp_init = NULL; VersionInfoType.tp_new = NULL; res = PyDict_DelItemString(VersionInfoType.tp_dict, "__new__"); - if (res < 0 && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - _PyErr_Clear(tstate); - } + if (res < 0 && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + _PyErr_Clear(tstate); + } /* implementation */ SET_SYS_FROM_STRING("implementation", make_impl_info(version_info)); @@ -2766,8 +2766,8 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) goto type_init_failed; } } - /* Set flags to their default values (updated by _PySys_InitMain()) */ - SET_SYS_FROM_STRING("flags", make_flags(tstate)); + /* Set flags to their default values (updated by _PySys_InitMain()) */ + SET_SYS_FROM_STRING("flags", make_flags(tstate)); #if defined(MS_WINDOWS) /* getwindowsversion */ @@ -2779,10 +2779,10 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) /* prevent user from creating new instances */ WindowsVersionType.tp_init = NULL; WindowsVersionType.tp_new = NULL; - assert(!_PyErr_Occurred(tstate)); + assert(!_PyErr_Occurred(tstate)); res = PyDict_DelItemString(WindowsVersionType.tp_dict, "__new__"); - if (res < 0 && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { - _PyErr_Clear(tstate); + if (res < 0 && _PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + _PyErr_Clear(tstate); } #endif @@ -2805,16 +2805,16 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) } } - if (_PyErr_Occurred(tstate)) { + if (_PyErr_Occurred(tstate)) { goto err_occurred; } - return _PyStatus_OK(); + return _PyStatus_OK(); type_init_failed: - return _PyStatus_ERR("failed to initialize a type"); + return _PyStatus_ERR("failed to initialize a type"); err_occurred: - return _PyStatus_ERR("can't initialize sys module"); + return _PyStatus_ERR("can't initialize sys module"); } /* Updating the sys namespace, returning integer error codes */ @@ -2830,144 +2830,144 @@ err_occurred: } \ } while (0) - -static int -sys_add_xoption(PyObject *opts, const wchar_t *s) -{ - PyObject *name, *value; - - const wchar_t *name_end = wcschr(s, L'='); - if (!name_end) { - name = PyUnicode_FromWideChar(s, -1); - value = Py_True; - Py_INCREF(value); - } - else { - name = PyUnicode_FromWideChar(s, name_end - s); - value = PyUnicode_FromWideChar(name_end + 1, -1); - } - if (name == NULL || value == NULL) { - goto error; - } - if (PyDict_SetItem(opts, name, value) < 0) { - goto error; - } - Py_DECREF(name); - Py_DECREF(value); - return 0; - -error: - Py_XDECREF(name); - Py_XDECREF(value); - return -1; -} - - -static PyObject* -sys_create_xoptions_dict(const PyConfig *config) -{ - Py_ssize_t nxoption = config->xoptions.length; - wchar_t * const * xoptions = config->xoptions.items; - PyObject *dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - - for (Py_ssize_t i=0; i < nxoption; i++) { - const wchar_t *option = xoptions[i]; - if (sys_add_xoption(dict, option) < 0) { - Py_DECREF(dict); - return NULL; - } - } - - return dict; -} - - + +static int +sys_add_xoption(PyObject *opts, const wchar_t *s) +{ + PyObject *name, *value; + + const wchar_t *name_end = wcschr(s, L'='); + if (!name_end) { + name = PyUnicode_FromWideChar(s, -1); + value = Py_True; + Py_INCREF(value); + } + else { + name = PyUnicode_FromWideChar(s, name_end - s); + value = PyUnicode_FromWideChar(name_end + 1, -1); + } + if (name == NULL || value == NULL) { + goto error; + } + if (PyDict_SetItem(opts, name, value) < 0) { + goto error; + } + Py_DECREF(name); + Py_DECREF(value); + return 0; + +error: + Py_XDECREF(name); + Py_XDECREF(value); + return -1; +} + + +static PyObject* +sys_create_xoptions_dict(const PyConfig *config) +{ + Py_ssize_t nxoption = config->xoptions.length; + wchar_t * const * xoptions = config->xoptions.items; + PyObject *dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + + for (Py_ssize_t i=0; i < nxoption; i++) { + const wchar_t *option = xoptions[i]; + if (sys_add_xoption(dict, option) < 0) { + Py_DECREF(dict); + return NULL; + } + } + + return dict; +} + + int -_PySys_InitMain(PyThreadState *tstate) +_PySys_InitMain(PyThreadState *tstate) { - PyObject *sysdict = tstate->interp->sysdict; - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + PyObject *sysdict = tstate->interp->sysdict; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); int res; -#define COPY_LIST(KEY, VALUE) \ - do { \ - PyObject *list = _PyWideStringList_AsList(&(VALUE)); \ - if (list == NULL) { \ - return -1; \ - } \ - SET_SYS_FROM_STRING_BORROW(KEY, list); \ - Py_DECREF(list); \ - } while (0) - -#define SET_SYS_FROM_WSTR(KEY, VALUE) \ - do { \ - PyObject *str = PyUnicode_FromWideChar(VALUE, -1); \ - if (str == NULL) { \ - return -1; \ - } \ - SET_SYS_FROM_STRING_BORROW(KEY, str); \ - Py_DECREF(str); \ - } while (0) - - COPY_LIST("path", config->module_search_paths); - - SET_SYS_FROM_WSTR("executable", config->executable); - SET_SYS_FROM_WSTR("_base_executable", config->base_executable); - SET_SYS_FROM_WSTR("prefix", config->prefix); - SET_SYS_FROM_WSTR("base_prefix", config->base_prefix); - SET_SYS_FROM_WSTR("exec_prefix", config->exec_prefix); - SET_SYS_FROM_WSTR("base_exec_prefix", config->base_exec_prefix); - SET_SYS_FROM_WSTR("platlibdir", config->platlibdir); - - if (config->pycache_prefix != NULL) { - SET_SYS_FROM_WSTR("pycache_prefix", config->pycache_prefix); - } else { - PyDict_SetItemString(sysdict, "pycache_prefix", Py_None); - } - - COPY_LIST("argv", config->argv); - COPY_LIST("warnoptions", config->warnoptions); - - PyObject *xoptions = sys_create_xoptions_dict(config); - if (xoptions == NULL) { - return -1; - } - SET_SYS_FROM_STRING_BORROW("_xoptions", xoptions); - Py_DECREF(xoptions); - -#undef COPY_LIST -#undef SET_SYS_FROM_WSTR - - +#define COPY_LIST(KEY, VALUE) \ + do { \ + PyObject *list = _PyWideStringList_AsList(&(VALUE)); \ + if (list == NULL) { \ + return -1; \ + } \ + SET_SYS_FROM_STRING_BORROW(KEY, list); \ + Py_DECREF(list); \ + } while (0) + +#define SET_SYS_FROM_WSTR(KEY, VALUE) \ + do { \ + PyObject *str = PyUnicode_FromWideChar(VALUE, -1); \ + if (str == NULL) { \ + return -1; \ + } \ + SET_SYS_FROM_STRING_BORROW(KEY, str); \ + Py_DECREF(str); \ + } while (0) + + COPY_LIST("path", config->module_search_paths); + + SET_SYS_FROM_WSTR("executable", config->executable); + SET_SYS_FROM_WSTR("_base_executable", config->base_executable); + SET_SYS_FROM_WSTR("prefix", config->prefix); + SET_SYS_FROM_WSTR("base_prefix", config->base_prefix); + SET_SYS_FROM_WSTR("exec_prefix", config->exec_prefix); + SET_SYS_FROM_WSTR("base_exec_prefix", config->base_exec_prefix); + SET_SYS_FROM_WSTR("platlibdir", config->platlibdir); + + if (config->pycache_prefix != NULL) { + SET_SYS_FROM_WSTR("pycache_prefix", config->pycache_prefix); + } else { + PyDict_SetItemString(sysdict, "pycache_prefix", Py_None); + } + + COPY_LIST("argv", config->argv); + COPY_LIST("warnoptions", config->warnoptions); + + PyObject *xoptions = sys_create_xoptions_dict(config); + if (xoptions == NULL) { + return -1; + } + SET_SYS_FROM_STRING_BORROW("_xoptions", xoptions); + Py_DECREF(xoptions); + +#undef COPY_LIST +#undef SET_SYS_FROM_WSTR + + /* Set flags to their final values */ - SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags(tstate)); + SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags(tstate)); /* prevent user from creating new instances */ FlagsType.tp_init = NULL; FlagsType.tp_new = NULL; res = PyDict_DelItemString(FlagsType.tp_dict, "__new__"); if (res < 0) { - if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { + if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { return res; } - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); } SET_SYS_FROM_STRING_INT_RESULT("dont_write_bytecode", - PyBool_FromLong(!config->write_bytecode)); + PyBool_FromLong(!config->write_bytecode)); - if (get_warnoptions(tstate) == NULL) { + if (get_warnoptions(tstate) == NULL) { return -1; - } + } - if (get_xoptions(tstate) == NULL) + if (get_xoptions(tstate) == NULL) return -1; - if (_PyErr_Occurred(tstate)) { - goto err_occurred; - } + if (_PyErr_Occurred(tstate)) { + goto err_occurred; + } return 0; @@ -2975,92 +2975,92 @@ err_occurred: return -1; } -#undef SET_SYS_FROM_STRING +#undef SET_SYS_FROM_STRING #undef SET_SYS_FROM_STRING_BORROW #undef SET_SYS_FROM_STRING_INT_RESULT - -/* Set up a preliminary stderr printer until we have enough - infrastructure for the io module in place. - - Use UTF-8/surrogateescape and ignore EAGAIN errors. */ -static PyStatus -_PySys_SetPreliminaryStderr(PyObject *sysdict) -{ - PyObject *pstderr = PyFile_NewStdPrinter(fileno(stderr)); - if (pstderr == NULL) { - goto error; - } - if (_PyDict_SetItemId(sysdict, &PyId_stderr, pstderr) < 0) { - goto error; - } - if (PyDict_SetItemString(sysdict, "__stderr__", pstderr) < 0) { - goto error; - } - Py_DECREF(pstderr); - return _PyStatus_OK(); - -error: - Py_XDECREF(pstderr); - return _PyStatus_ERR("can't set preliminary stderr"); -} - - -/* Create sys module without all attributes: _PySys_InitMain() should be called - later to add remaining attributes. */ -PyStatus -_PySys_Create(PyThreadState *tstate, PyObject **sysmod_p) -{ - assert(!_PyErr_Occurred(tstate)); - - PyInterpreterState *interp = tstate->interp; - - PyObject *modules = PyDict_New(); - if (modules == NULL) { - goto error; - } - interp->modules = modules; - - PyObject *sysmod = _PyModule_CreateInitialized(&sysmodule, PYTHON_API_VERSION); - if (sysmod == NULL) { - return _PyStatus_ERR("failed to create a module object"); - } - - PyObject *sysdict = PyModule_GetDict(sysmod); - if (sysdict == NULL) { - goto error; - } - Py_INCREF(sysdict); - interp->sysdict = sysdict; - - if (PyDict_SetItemString(sysdict, "modules", interp->modules) < 0) { - goto error; - } - - PyStatus status = _PySys_SetPreliminaryStderr(sysdict); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - status = _PySys_InitCore(tstate, sysdict); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (_PyImport_FixupBuiltin(sysmod, "sys", interp->modules) < 0) { - goto error; - } - - assert(!_PyErr_Occurred(tstate)); - - *sysmod_p = sysmod; - return _PyStatus_OK(); - -error: - return _PyStatus_ERR("can't initialize sys module"); -} - - + +/* Set up a preliminary stderr printer until we have enough + infrastructure for the io module in place. + + Use UTF-8/surrogateescape and ignore EAGAIN errors. */ +static PyStatus +_PySys_SetPreliminaryStderr(PyObject *sysdict) +{ + PyObject *pstderr = PyFile_NewStdPrinter(fileno(stderr)); + if (pstderr == NULL) { + goto error; + } + if (_PyDict_SetItemId(sysdict, &PyId_stderr, pstderr) < 0) { + goto error; + } + if (PyDict_SetItemString(sysdict, "__stderr__", pstderr) < 0) { + goto error; + } + Py_DECREF(pstderr); + return _PyStatus_OK(); + +error: + Py_XDECREF(pstderr); + return _PyStatus_ERR("can't set preliminary stderr"); +} + + +/* Create sys module without all attributes: _PySys_InitMain() should be called + later to add remaining attributes. */ +PyStatus +_PySys_Create(PyThreadState *tstate, PyObject **sysmod_p) +{ + assert(!_PyErr_Occurred(tstate)); + + PyInterpreterState *interp = tstate->interp; + + PyObject *modules = PyDict_New(); + if (modules == NULL) { + goto error; + } + interp->modules = modules; + + PyObject *sysmod = _PyModule_CreateInitialized(&sysmodule, PYTHON_API_VERSION); + if (sysmod == NULL) { + return _PyStatus_ERR("failed to create a module object"); + } + + PyObject *sysdict = PyModule_GetDict(sysmod); + if (sysdict == NULL) { + goto error; + } + Py_INCREF(sysdict); + interp->sysdict = sysdict; + + if (PyDict_SetItemString(sysdict, "modules", interp->modules) < 0) { + goto error; + } + + PyStatus status = _PySys_SetPreliminaryStderr(sysdict); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = _PySys_InitCore(tstate, sysdict); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (_PyImport_FixupBuiltin(sysmod, "sys", interp->modules) < 0) { + goto error; + } + + assert(!_PyErr_Occurred(tstate)); + + *sysmod_p = sysmod; + return _PyStatus_OK(); + +error: + return _PyStatus_ERR("can't initialize sys module"); +} + + static PyObject * makepathobject(const wchar_t *path, wchar_t delim) { @@ -3100,49 +3100,49 @@ PySys_SetPath(const wchar_t *path) PyObject *v; if ((v = makepathobject(path, DELIM)) == NULL) Py_FatalError("can't create sys.path"); - PyThreadState *tstate = _PyThreadState_GET(); - if (sys_set_object_id(tstate, &PyId_path, v) != 0) { + PyThreadState *tstate = _PyThreadState_GET(); + if (sys_set_object_id(tstate, &PyId_path, v) != 0) { Py_FatalError("can't assign sys.path"); - } + } Py_DECREF(v); } static PyObject * -make_sys_argv(int argc, wchar_t * const * argv) -{ - PyObject *list = PyList_New(argc); - if (list == NULL) { - return NULL; - } - - for (Py_ssize_t i = 0; i < argc; i++) { - PyObject *v = PyUnicode_FromWideChar(argv[i], -1); - if (v == NULL) { - Py_DECREF(list); - return NULL; +make_sys_argv(int argc, wchar_t * const * argv) +{ + PyObject *list = PyList_New(argc); + if (list == NULL) { + return NULL; + } + + for (Py_ssize_t i = 0; i < argc; i++) { + PyObject *v = PyUnicode_FromWideChar(argv[i], -1); + if (v == NULL) { + Py_DECREF(list); + return NULL; } - PyList_SET_ITEM(list, i, v); + PyList_SET_ITEM(list, i, v); } - return list; + return list; } void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) { - wchar_t* empty_argv[1] = {L""}; - PyThreadState *tstate = _PyThreadState_GET(); - - if (argc < 1 || argv == NULL) { - /* Ensure at least one (empty) argument is seen */ - argv = empty_argv; - argc = 1; - } - - PyObject *av = make_sys_argv(argc, argv); + wchar_t* empty_argv[1] = {L""}; + PyThreadState *tstate = _PyThreadState_GET(); + + if (argc < 1 || argv == NULL) { + /* Ensure at least one (empty) argument is seen */ + argv = empty_argv; + argc = 1; + } + + PyObject *av = make_sys_argv(argc, argv); if (av == NULL) { Py_FatalError("no mem for sys.argv"); } - if (sys_set_object(tstate, "argv", av) != 0) { + if (sys_set_object(tstate, "argv", av) != 0) { Py_DECREF(av); Py_FatalError("can't assign sys.argv"); } @@ -3151,21 +3151,21 @@ PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) if (updatepath) { /* If argv[0] is not '-c' nor '-m', prepend argv[0] to sys.path. If argv[0] is a symlink, use the real path. */ - const PyWideStringList argv_list = {.length = argc, .items = argv}; - PyObject *path0 = NULL; - if (_PyPathConfig_ComputeSysPath0(&argv_list, &path0)) { - if (path0 == NULL) { - Py_FatalError("can't compute path0 from argv"); - } - - PyObject *sys_path = sys_get_object_id(tstate, &PyId_path); - if (sys_path != NULL) { - if (PyList_Insert(sys_path, 0, path0) < 0) { - Py_DECREF(path0); - Py_FatalError("can't prepend path0 to sys.path"); - } + const PyWideStringList argv_list = {.length = argc, .items = argv}; + PyObject *path0 = NULL; + if (_PyPathConfig_ComputeSysPath0(&argv_list, &path0)) { + if (path0 == NULL) { + Py_FatalError("can't compute path0 from argv"); + } + + PyObject *sys_path = sys_get_object_id(tstate, &PyId_path); + if (sys_path != NULL) { + if (PyList_Insert(sys_path, 0, path0) < 0) { + Py_DECREF(path0); + Py_FatalError("can't prepend path0 to sys.path"); + } } - Py_DECREF(path0); + Py_DECREF(path0); } } } @@ -3184,13 +3184,13 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file) { if (file == NULL) return -1; - assert(unicode != NULL); - PyObject *result = _PyObject_CallMethodIdOneArg(file, &PyId_write, unicode); + assert(unicode != NULL); + PyObject *result = _PyObject_CallMethodIdOneArg(file, &PyId_write, unicode); if (result == NULL) { - return -1; + return -1; } - Py_DECREF(result); - return 0; + Py_DECREF(result); + return 0; } static int @@ -3246,13 +3246,13 @@ sys_write(_Py_Identifier *key, FILE *fp, const char *format, va_list va) PyObject *error_type, *error_value, *error_traceback; char buffer[1001]; int written; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); - file = sys_get_object_id(tstate, key); + _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); + file = sys_get_object_id(tstate, key); written = PyOS_vsnprintf(buffer, sizeof(buffer), format, va); if (sys_pyfile_write(buffer, file) != 0) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); fputs(buffer, fp); } if (written < 0 || (size_t)written >= sizeof(buffer)) { @@ -3260,7 +3260,7 @@ sys_write(_Py_Identifier *key, FILE *fp, const char *format, va_list va) if (sys_pyfile_write(truncated, file) != 0) fputs(truncated, fp); } - _PyErr_Restore(tstate, error_type, error_value, error_traceback); + _PyErr_Restore(tstate, error_type, error_value, error_traceback); } void @@ -3289,21 +3289,21 @@ sys_format(_Py_Identifier *key, FILE *fp, const char *format, va_list va) PyObject *file, *message; PyObject *error_type, *error_value, *error_traceback; const char *utf8; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); - _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); - file = sys_get_object_id(tstate, key); + _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); + file = sys_get_object_id(tstate, key); message = PyUnicode_FromFormatV(format, va); if (message != NULL) { if (sys_pyfile_write_unicode(message, file) != 0) { - _PyErr_Clear(tstate); + _PyErr_Clear(tstate); utf8 = PyUnicode_AsUTF8(message); if (utf8 != NULL) fputs(utf8, fp); } Py_DECREF(message); } - _PyErr_Restore(tstate, error_type, error_value, error_traceback); + _PyErr_Restore(tstate, error_type, error_value, error_traceback); } void diff --git a/contrib/tools/python3/src/Python/thread.c b/contrib/tools/python3/src/Python/thread.c index 594e0087c9..a10f5728dc 100644 --- a/contrib/tools/python3/src/Python/thread.c +++ b/contrib/tools/python3/src/Python/thread.c @@ -6,7 +6,7 @@ Stuff shared by all thread_*.h files is collected here. */ #include "Python.h" -#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #ifndef _POSIX_THREADS /* This means pthreads are not implemented in libc headers, hence the macro @@ -90,7 +90,7 @@ PyThread_init_thread(void) size_t PyThread_get_stacksize(void) { - return _PyInterpreterState_GET()->pythread_stacksize; + return _PyInterpreterState_GET()->pythread_stacksize; } /* Only platforms defining a THREAD_SET_STACKSIZE() macro @@ -145,7 +145,7 @@ PyThread_tss_is_created(Py_tss_t *key) PyDoc_STRVAR(threadinfo__doc__, "sys.thread_info\n\ \n\ -A named tuple holding information about the thread implementation."); +A named tuple holding information about the thread implementation."); static PyStructSequence_Field threadinfo_fields[] = { {"name", "name of the thread implementation"}, diff --git a/contrib/tools/python3/src/Python/thread_nt.h b/contrib/tools/python3/src/Python/thread_nt.h index 876cfe06e1..0ce5e94f89 100644 --- a/contrib/tools/python3/src/Python/thread_nt.h +++ b/contrib/tools/python3/src/Python/thread_nt.h @@ -1,4 +1,4 @@ -#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize +#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */ @@ -76,22 +76,22 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) } } else if (milliseconds != 0) { /* wait at least until the target */ - _PyTime_t now = _PyTime_GetPerfCounter(); - if (now <= 0) { - Py_FatalError("_PyTime_GetPerfCounter() == 0"); - } - _PyTime_t nanoseconds = _PyTime_FromNanoseconds((_PyTime_t)milliseconds * 1000000); - _PyTime_t target = now + nanoseconds; + _PyTime_t now = _PyTime_GetPerfCounter(); + if (now <= 0) { + Py_FatalError("_PyTime_GetPerfCounter() == 0"); + } + _PyTime_t nanoseconds = _PyTime_FromNanoseconds((_PyTime_t)milliseconds * 1000000); + _PyTime_t target = now + nanoseconds; while (mutex->locked) { - _PyTime_t microseconds = _PyTime_AsMicroseconds(nanoseconds, _PyTime_ROUND_TIMEOUT); - if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, microseconds) < 0) { + _PyTime_t microseconds = _PyTime_AsMicroseconds(nanoseconds, _PyTime_ROUND_TIMEOUT); + if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, microseconds) < 0) { result = WAIT_FAILED; break; } - now = _PyTime_GetPerfCounter(); + now = _PyTime_GetPerfCounter(); if (target <= now) break; - nanoseconds = target - now; + nanoseconds = target - now; } } if (!mutex->locked) { @@ -150,10 +150,10 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex) unsigned long PyThread_get_thread_ident(void); -#ifdef PY_HAVE_THREAD_NATIVE_ID -unsigned long PyThread_get_thread_native_id(void); -#endif - +#ifdef PY_HAVE_THREAD_NATIVE_ID +unsigned long PyThread_get_thread_native_id(void); +#endif + /* * Initialization of the C package, should not be needed. */ @@ -201,7 +201,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) return PYTHREAD_INVALID_THREAD_ID; obj->func = func; obj->arg = arg; - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0; hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(stacksize, Py_ssize_t, unsigned int), @@ -238,26 +238,26 @@ PyThread_get_thread_ident(void) return GetCurrentThreadId(); } -#ifdef PY_HAVE_THREAD_NATIVE_ID -/* - * Return the native Thread ID (TID) of the calling thread. - * The native ID of a thread is valid and guaranteed to be unique system-wide - * from the time the thread is created until the thread has been terminated. - */ -unsigned long -PyThread_get_thread_native_id(void) -{ - if (!initialized) { - PyThread_init_thread(); - } - - DWORD native_id; - native_id = GetCurrentThreadId(); - return (unsigned long) native_id; -} -#endif - -void _Py_NO_RETURN +#ifdef PY_HAVE_THREAD_NATIVE_ID +/* + * Return the native Thread ID (TID) of the calling thread. + * The native ID of a thread is valid and guaranteed to be unique system-wide + * from the time the thread is created until the thread has been terminated. + */ +unsigned long +PyThread_get_thread_native_id(void) +{ + if (!initialized) { + PyThread_init_thread(); + } + + DWORD native_id; + native_id = GetCurrentThreadId(); + return (unsigned long) native_id; +} +#endif + +void _Py_NO_RETURN PyThread_exit_thread(void) { dprintf(("%lu: PyThread_exit_thread called\n", PyThread_get_thread_ident())); @@ -365,13 +365,13 @@ _pythread_nt_set_stacksize(size_t size) { /* set to default */ if (size == 0) { - _PyInterpreterState_GET()->pythread_stacksize = 0; + _PyInterpreterState_GET()->pythread_stacksize = 0; return 0; } /* valid range? */ if (size >= THREAD_MIN_STACKSIZE && size < THREAD_MAX_STACKSIZE) { - _PyInterpreterState_GET()->pythread_stacksize = size; + _PyInterpreterState_GET()->pythread_stacksize = size; return 0; } diff --git a/contrib/tools/python3/src/Python/thread_pthread.h b/contrib/tools/python3/src/Python/thread_pthread.h index 8a12accebd..83974b4c0c 100644 --- a/contrib/tools/python3/src/Python/thread_pthread.h +++ b/contrib/tools/python3/src/Python/thread_pthread.h @@ -1,4 +1,4 @@ -#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize +#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize /* Posix threads interface */ @@ -13,18 +13,18 @@ #endif #include <signal.h> -#if defined(__linux__) -# include <sys/syscall.h> /* syscall(SYS_gettid) */ -#elif defined(__FreeBSD__) -# include <pthread_np.h> /* pthread_getthreadid_np() */ -#elif defined(__OpenBSD__) -# include <unistd.h> /* getthrid() */ -#elif defined(_AIX) -# include <sys/thread.h> /* thread_self() */ -#elif defined(__NetBSD__) -# include <lwp.h> /* _lwp_self() */ -#endif - +#if defined(__linux__) +# include <sys/syscall.h> /* syscall(SYS_gettid) */ +#elif defined(__FreeBSD__) +# include <pthread_np.h> /* pthread_getthreadid_np() */ +#elif defined(__OpenBSD__) +# include <unistd.h> /* getthrid() */ +#elif defined(_AIX) +# include <sys/thread.h> /* thread_self() */ +#elif defined(__NetBSD__) +# include <lwp.h> /* _lwp_self() */ +#endif + /* The POSIX spec requires that use of pthread_attr_setstacksize be conditional on _POSIX_THREAD_ATTR_STACKSIZE being defined. */ #ifdef _POSIX_THREAD_ATTR_STACKSIZE @@ -41,27 +41,27 @@ */ #if defined(__APPLE__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 #undef THREAD_STACK_SIZE -/* Note: This matches the value of -Wl,-stack_size in configure.ac */ -#define THREAD_STACK_SIZE 0x1000000 +/* Note: This matches the value of -Wl,-stack_size in configure.ac */ +#define THREAD_STACK_SIZE 0x1000000 #endif #if defined(__FreeBSD__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 #undef THREAD_STACK_SIZE #define THREAD_STACK_SIZE 0x400000 #endif -#if defined(_AIX) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 -#undef THREAD_STACK_SIZE -#define THREAD_STACK_SIZE 0x200000 -#endif -/* bpo-38852: test_threading.test_recursion_limit() checks that 1000 recursive - Python calls (default recursion limit) doesn't crash, but raise a regular - RecursionError exception. In debug mode, Python function calls allocates - more memory on the stack, so use a stack of 8 MiB. */ -#if defined(__ANDROID__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 -# ifdef Py_DEBUG -# undef THREAD_STACK_SIZE -# define THREAD_STACK_SIZE 0x800000 -# endif -#endif +#if defined(_AIX) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 +#undef THREAD_STACK_SIZE +#define THREAD_STACK_SIZE 0x200000 +#endif +/* bpo-38852: test_threading.test_recursion_limit() checks that 1000 recursive + Python calls (default recursion limit) doesn't crash, but raise a regular + RecursionError exception. In debug mode, Python function calls allocates + more memory on the stack, so use a stack of 8 MiB. */ +#if defined(__ANDROID__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 +# ifdef Py_DEBUG +# undef THREAD_STACK_SIZE +# define THREAD_STACK_SIZE 0x800000 +# endif +#endif /* for safety, ensure a viable minimum stacksize */ #define THREAD_STACK_MIN 0x8000 /* 32 KiB */ #else /* !_POSIX_THREAD_ATTR_STACKSIZE */ @@ -89,18 +89,18 @@ * mutexes and condition variables: */ #if (defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES) && \ - (defined(HAVE_SEM_TIMEDWAIT) || defined(HAVE_SEM_CLOCKWAIT))) + (defined(HAVE_SEM_TIMEDWAIT) || defined(HAVE_SEM_CLOCKWAIT))) # define USE_SEMAPHORES #else # undef USE_SEMAPHORES #endif -#if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) -// monotonic is supported statically. It doesn't mean it works on runtime. -#define CONDATTR_MONOTONIC -#endif +#if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +// monotonic is supported statically. It doesn't mean it works on runtime. +#define CONDATTR_MONOTONIC +#endif + - /* On platforms that don't use standard POSIX threads pthread_sigmask() * isn't present. DEC threads uses sigprocmask() instead as do most * other UNIX International compliant systems that don't have the full @@ -116,7 +116,7 @@ #define MICROSECONDS_TO_TIMESPEC(microseconds, ts) \ do { \ struct timeval tv; \ - gettimeofday(&tv, NULL); \ + gettimeofday(&tv, NULL); \ tv.tv_usec += microseconds % 1000000; \ tv.tv_sec += microseconds / 1000000; \ tv.tv_sec += tv.tv_usec / 1000000; \ @@ -125,61 +125,61 @@ do { \ ts.tv_nsec = tv.tv_usec * 1000; \ } while(0) -#if defined(CONDATTR_MONOTONIC) || defined(HAVE_SEM_CLOCKWAIT) -static void -monotonic_abs_timeout(long long us, struct timespec *abs) -{ - clock_gettime(CLOCK_MONOTONIC, abs); - abs->tv_sec += us / 1000000; - abs->tv_nsec += (us % 1000000) * 1000; - abs->tv_sec += abs->tv_nsec / 1000000000; - abs->tv_nsec %= 1000000000; -} -#endif - - -/* - * pthread_cond support - */ - -// NULL when pthread_condattr_setclock(CLOCK_MONOTONIC) is not supported. -static pthread_condattr_t *condattr_monotonic = NULL; - -static void -init_condattr(void) -{ -#ifdef CONDATTR_MONOTONIC - static pthread_condattr_t ca; - pthread_condattr_init(&ca); - if (pthread_condattr_setclock(&ca, CLOCK_MONOTONIC) == 0) { - condattr_monotonic = &ca; // Use monotonic clock - } -#endif -} - -int -_PyThread_cond_init(PyCOND_T *cond) -{ - return pthread_cond_init(cond, condattr_monotonic); -} - - -void -_PyThread_cond_after(long long us, struct timespec *abs) -{ -#ifdef CONDATTR_MONOTONIC - if (condattr_monotonic) { - monotonic_abs_timeout(us, abs); - return; - } -#endif - - struct timespec ts; - MICROSECONDS_TO_TIMESPEC(us, ts); - *abs = ts; -} - - +#if defined(CONDATTR_MONOTONIC) || defined(HAVE_SEM_CLOCKWAIT) +static void +monotonic_abs_timeout(long long us, struct timespec *abs) +{ + clock_gettime(CLOCK_MONOTONIC, abs); + abs->tv_sec += us / 1000000; + abs->tv_nsec += (us % 1000000) * 1000; + abs->tv_sec += abs->tv_nsec / 1000000000; + abs->tv_nsec %= 1000000000; +} +#endif + + +/* + * pthread_cond support + */ + +// NULL when pthread_condattr_setclock(CLOCK_MONOTONIC) is not supported. +static pthread_condattr_t *condattr_monotonic = NULL; + +static void +init_condattr(void) +{ +#ifdef CONDATTR_MONOTONIC + static pthread_condattr_t ca; + pthread_condattr_init(&ca); + if (pthread_condattr_setclock(&ca, CLOCK_MONOTONIC) == 0) { + condattr_monotonic = &ca; // Use monotonic clock + } +#endif +} + +int +_PyThread_cond_init(PyCOND_T *cond) +{ + return pthread_cond_init(cond, condattr_monotonic); +} + + +void +_PyThread_cond_after(long long us, struct timespec *abs) +{ +#ifdef CONDATTR_MONOTONIC + if (condattr_monotonic) { + monotonic_abs_timeout(us, abs); + return; + } +#endif + + struct timespec ts; + MICROSECONDS_TO_TIMESPEC(us, ts); + *abs = ts; +} + + /* A pthread mutex isn't sufficient to model the Python lock type * because, according to Draft 5 of the docs (P1003.4a/D5), both of the * following are undefined: @@ -216,7 +216,7 @@ PyThread__init_thread(void) extern void pthread_init(void); pthread_init(); #endif - init_condattr(); + init_condattr(); } /* @@ -267,7 +267,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) return PYTHREAD_INVALID_THREAD_ID; #endif #if defined(THREAD_STACK_SIZE) - PyThreadState *tstate = _PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0; tss = (stacksize != 0) ? stacksize : THREAD_STACK_SIZE; if (tss != 0) { @@ -332,36 +332,36 @@ PyThread_get_thread_ident(void) return (unsigned long) threadid; } -#ifdef PY_HAVE_THREAD_NATIVE_ID -unsigned long -PyThread_get_thread_native_id(void) -{ - if (!initialized) - PyThread_init_thread(); -#ifdef __APPLE__ - uint64_t native_id; - (void) pthread_threadid_np(NULL, &native_id); -#elif defined(__linux__) - pid_t native_id; - native_id = syscall(SYS_gettid); -#elif defined(__FreeBSD__) - int native_id; - native_id = pthread_getthreadid_np(); -#elif defined(__OpenBSD__) - pid_t native_id; - native_id = getthrid(); -#elif defined(_AIX) - tid_t native_id; - native_id = thread_self(); -#elif defined(__NetBSD__) - lwpid_t native_id; - native_id = _lwp_self(); -#endif - return (unsigned long) native_id; -} -#endif - -void _Py_NO_RETURN +#ifdef PY_HAVE_THREAD_NATIVE_ID +unsigned long +PyThread_get_thread_native_id(void) +{ + if (!initialized) + PyThread_init_thread(); +#ifdef __APPLE__ + uint64_t native_id; + (void) pthread_threadid_np(NULL, &native_id); +#elif defined(__linux__) + pid_t native_id; + native_id = syscall(SYS_gettid); +#elif defined(__FreeBSD__) + int native_id; + native_id = pthread_getthreadid_np(); +#elif defined(__OpenBSD__) + pid_t native_id; + native_id = getthrid(); +#elif defined(_AIX) + tid_t native_id; + native_id = thread_self(); +#elif defined(__NetBSD__) + lwpid_t native_id; + native_id = _lwp_self(); +#endif + return (unsigned long) native_id; +} +#endif + +void _Py_NO_RETURN PyThread_exit_thread(void) { dprintf(("PyThread_exit_thread called\n")); @@ -398,7 +398,7 @@ PyThread_allocate_lock(void) } } - dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); + dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); return (PyThread_type_lock)lock; } @@ -440,9 +440,9 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, sem_t *thelock = (sem_t *)lock; int status, error = 0; struct timespec ts; -#ifndef HAVE_SEM_CLOCKWAIT +#ifndef HAVE_SEM_CLOCKWAIT _PyTime_t deadline = 0; -#endif +#endif (void) error; /* silence unused-but-set-variable warning */ dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) called\n", @@ -453,9 +453,9 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, } if (microseconds > 0) { -#ifdef HAVE_SEM_CLOCKWAIT - monotonic_abs_timeout(microseconds, &ts); -#else +#ifdef HAVE_SEM_CLOCKWAIT + monotonic_abs_timeout(microseconds, &ts); +#else MICROSECONDS_TO_TIMESPEC(microseconds, ts); if (!intr_flag) { @@ -464,17 +464,17 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, _PyTime_t timeout = _PyTime_FromNanoseconds(microseconds * 1000); deadline = _PyTime_GetMonotonicClock() + timeout; } -#endif +#endif } while (1) { if (microseconds > 0) { -#ifdef HAVE_SEM_CLOCKWAIT - status = fix_status(sem_clockwait(thelock, CLOCK_MONOTONIC, - &ts)); -#else +#ifdef HAVE_SEM_CLOCKWAIT + status = fix_status(sem_clockwait(thelock, CLOCK_MONOTONIC, + &ts)); +#else status = fix_status(sem_timedwait(thelock, &ts)); -#endif +#endif } else if (microseconds == 0) { status = fix_status(sem_trywait(thelock)); @@ -489,9 +489,9 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, break; } - // sem_clockwait() uses an absolute timeout, there is no need - // to recompute the relative timeout. -#ifndef HAVE_SEM_CLOCKWAIT + // sem_clockwait() uses an absolute timeout, there is no need + // to recompute the relative timeout. +#ifndef HAVE_SEM_CLOCKWAIT if (microseconds > 0) { /* wait interrupted by a signal (EINTR): recompute the timeout */ _PyTime_t dt = deadline - _PyTime_GetMonotonicClock(); @@ -513,19 +513,19 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, microseconds = 0; } } -#endif +#endif } /* Don't check the status if we're stopping because of an interrupt. */ if (!(intr_flag && status == EINTR)) { if (microseconds > 0) { - if (status != ETIMEDOUT) { -#ifdef HAVE_SEM_CLOCKWAIT - CHECK_STATUS("sem_clockwait"); -#else + if (status != ETIMEDOUT) { +#ifdef HAVE_SEM_CLOCKWAIT + CHECK_STATUS("sem_clockwait"); +#else CHECK_STATUS("sem_timedwait"); -#endif - } +#endif + } } else if (microseconds == 0) { if (status != EAGAIN) @@ -577,11 +577,11 @@ PyThread_allocate_lock(void) if (!initialized) PyThread_init_thread(); - lock = (pthread_lock *) PyMem_RawCalloc(1, sizeof(pthread_lock)); + lock = (pthread_lock *) PyMem_RawCalloc(1, sizeof(pthread_lock)); if (lock) { lock->locked = 0; - status = pthread_mutex_init(&lock->mut, NULL); + status = pthread_mutex_init(&lock->mut, NULL); CHECK_STATUS_PTHREAD("pthread_mutex_init"); /* Mark the pthread mutex underlying a Python mutex as pure happens-before. We can't simply mark the @@ -590,7 +590,7 @@ PyThread_allocate_lock(void) will cause errors. */ _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(&lock->mut); - status = _PyThread_cond_init(&lock->lock_released); + status = _PyThread_cond_init(&lock->lock_released); CHECK_STATUS_PTHREAD("pthread_cond_init"); if (error) { @@ -599,7 +599,7 @@ PyThread_allocate_lock(void) } } - dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); + dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); return (PyThread_type_lock) lock; } @@ -649,10 +649,10 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, success = PY_LOCK_ACQUIRED; } else if (microseconds != 0) { - struct timespec abs; - if (microseconds > 0) { - _PyThread_cond_after(microseconds, &abs); - } + struct timespec abs; + if (microseconds > 0) { + _PyThread_cond_after(microseconds, &abs); + } /* continue trying until we get the lock */ /* mut must be locked by me -- part of the condition @@ -661,13 +661,13 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, if (microseconds > 0) { status = pthread_cond_timedwait( &thelock->lock_released, - &thelock->mut, &abs); - if (status == 1) { - break; - } + &thelock->mut, &abs); + if (status == 1) { + break; + } if (status == ETIMEDOUT) break; - CHECK_STATUS_PTHREAD("pthread_cond_timedwait"); + CHECK_STATUS_PTHREAD("pthread_cond_timedwait"); } else { status = pthread_cond_wait( @@ -724,26 +724,26 @@ PyThread_release_lock(PyThread_type_lock lock) #endif /* USE_SEMAPHORES */ int -_PyThread_at_fork_reinit(PyThread_type_lock *lock) -{ - PyThread_type_lock new_lock = PyThread_allocate_lock(); - if (new_lock == NULL) { - return -1; - } - - /* bpo-6721, bpo-40089: The old lock can be in an inconsistent state. - fork() can be called in the middle of an operation on the lock done by - another thread. So don't call PyThread_free_lock(*lock). - - Leak memory on purpose. Don't release the memory either since the - address of a mutex is relevant. Putting two mutexes at the same address - can lead to problems. */ - - *lock = new_lock; - return 0; -} - -int +_PyThread_at_fork_reinit(PyThread_type_lock *lock) +{ + PyThread_type_lock new_lock = PyThread_allocate_lock(); + if (new_lock == NULL) { + return -1; + } + + /* bpo-6721, bpo-40089: The old lock can be in an inconsistent state. + fork() can be called in the middle of an operation on the lock done by + another thread. So don't call PyThread_free_lock(*lock). + + Leak memory on purpose. Don't release the memory either since the + address of a mutex is relevant. Putting two mutexes at the same address + can lead to problems. */ + + *lock = new_lock; + return 0; +} + +int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) { return PyThread_acquire_lock_timed(lock, waitflag ? -1 : 0, /*intr_flag=*/0); @@ -764,7 +764,7 @@ _pythread_pthread_set_stacksize(size_t size) /* set to default */ if (size == 0) { - _PyInterpreterState_GET()->pythread_stacksize = 0; + _PyInterpreterState_GET()->pythread_stacksize = 0; return 0; } @@ -781,7 +781,7 @@ _pythread_pthread_set_stacksize(size_t size) rc = pthread_attr_setstacksize(&attrs, size); pthread_attr_destroy(&attrs); if (rc == 0) { - _PyInterpreterState_GET()->pythread_stacksize = size; + _PyInterpreterState_GET()->pythread_stacksize = size; return 0; } } diff --git a/contrib/tools/python3/src/Python/traceback.c b/contrib/tools/python3/src/Python/traceback.c index d45729d980..23d0e38e73 100644 --- a/contrib/tools/python3/src/Python/traceback.c +++ b/contrib/tools/python3/src/Python/traceback.c @@ -4,9 +4,9 @@ #include "Python.h" #include "code.h" -#include "frameobject.h" // PyFrame_GetBack() -#include "structmember.h" // PyMemberDef -#include "osdefs.h" // SEP +#include "frameobject.h" // PyFrame_GetBack() +#include "structmember.h" // PyMemberDef +#include "osdefs.h" // SEP #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif @@ -86,7 +86,7 @@ tb_new_impl(PyTypeObject *type, PyObject *tb_next, PyFrameObject *tb_frame, } static PyObject * -tb_dir(PyTracebackObject *self, PyObject *Py_UNUSED(ignored)) +tb_dir(PyTracebackObject *self, PyObject *Py_UNUSED(ignored)) { return Py_BuildValue("[ssss]", "tb_frame", "tb_next", "tb_lasti", "tb_lineno"); @@ -147,7 +147,7 @@ static PyMethodDef tb_methods[] = { }; static PyMemberDef tb_memberlist[] = { - {"tb_frame", T_OBJECT, OFF(tb_frame), READONLY|READ_RESTRICTED}, + {"tb_frame", T_OBJECT, OFF(tb_frame), READONLY|READ_RESTRICTED}, {"tb_lasti", T_INT, OFF(tb_lasti), READONLY}, {"tb_lineno", T_INT, OFF(tb_lineno), READONLY}, {NULL} /* Sentinel */ @@ -162,11 +162,11 @@ static void tb_dealloc(PyTracebackObject *tb) { PyObject_GC_UnTrack(tb); - Py_TRASHCAN_BEGIN(tb, tb_dealloc) + Py_TRASHCAN_BEGIN(tb, tb_dealloc) Py_XDECREF(tb->tb_next); Py_XDECREF(tb->tb_frame); PyObject_GC_Del(tb); - Py_TRASHCAN_END + Py_TRASHCAN_END } static int @@ -191,10 +191,10 @@ PyTypeObject PyTraceBack_Type = { sizeof(PyTracebackObject), 0, (destructor)tb_dealloc, /*tp_dealloc*/ - 0, /*tp_vectorcall_offset*/ + 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_as_async*/ + 0, /*tp_as_async*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -226,24 +226,24 @@ PyTypeObject PyTraceBack_Type = { tb_new, /* tp_new */ }; - -PyObject* -_PyTraceBack_FromFrame(PyObject *tb_next, PyFrameObject *frame) -{ - assert(tb_next == NULL || PyTraceBack_Check(tb_next)); - assert(frame != NULL); - - return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_lasti, - PyFrame_GetLineNumber(frame)); -} - - + +PyObject* +_PyTraceBack_FromFrame(PyObject *tb_next, PyFrameObject *frame) +{ + assert(tb_next == NULL || PyTraceBack_Check(tb_next)); + assert(frame != NULL); + + return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_lasti, + PyFrame_GetLineNumber(frame)); +} + + int PyTraceBack_Here(PyFrameObject *frame) { PyObject *exc, *val, *tb, *newtb; PyErr_Fetch(&exc, &val, &tb); - newtb = _PyTraceBack_FromFrame(tb, frame); + newtb = _PyTraceBack_FromFrame(tb, frame); if (newtb == NULL) { _PyErr_ChainExceptions(exc, val, tb); return -1; @@ -375,7 +375,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) int fd; int i; char *found_encoding; - const char *encoding; + const char *encoding; PyObject *io; PyObject *binary; PyObject *fob = NULL; @@ -383,7 +383,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) PyObject *res; char buf[MAXPATHLEN+1]; int kind; - const void *data; + const void *data; /* open the file */ if (filename == NULL) @@ -429,7 +429,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) if (fob == NULL) { PyErr_Clear(); - res = _PyObject_CallMethodIdNoArgs(binary, &PyId_close); + res = _PyObject_CallMethodIdNoArgs(binary, &PyId_close); Py_DECREF(binary); if (res) Py_DECREF(res); @@ -449,7 +449,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) break; } } - res = _PyObject_CallMethodIdNoArgs(fob, &PyId_close); + res = _PyObject_CallMethodIdNoArgs(fob, &PyId_close); if (res) Py_DECREF(res); else @@ -560,28 +560,28 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) tb = tb->tb_next; } while (tb != NULL && err == 0) { - PyCodeObject *code = PyFrame_GetCode(tb->tb_frame); + PyCodeObject *code = PyFrame_GetCode(tb->tb_frame); if (last_file == NULL || - code->co_filename != last_file || + code->co_filename != last_file || last_line == -1 || tb->tb_lineno != last_line || - last_name == NULL || code->co_name != last_name) { + last_name == NULL || code->co_name != last_name) { if (cnt > TB_RECURSIVE_CUTOFF) { err = tb_print_line_repeated(f, cnt); } - last_file = code->co_filename; + last_file = code->co_filename; last_line = tb->tb_lineno; - last_name = code->co_name; + last_name = code->co_name; cnt = 0; } cnt++; if (err == 0 && cnt <= TB_RECURSIVE_CUTOFF) { - err = tb_displayline(f, code->co_filename, tb->tb_lineno, - code->co_name); + err = tb_displayline(f, code->co_filename, tb->tb_lineno, + code->co_name); if (err == 0) { err = PyErr_CheckSignals(); } } - Py_DECREF(code); + Py_DECREF(code); tb = tb->tb_next; } if (err == 0 && cnt > TB_RECURSIVE_CUTOFF) { @@ -622,8 +622,8 @@ PyTraceBack_Print(PyObject *v, PyObject *f) return err; } -/* Format an integer in range [0; 0xffffffff] to decimal and write it - into the file fd. +/* Format an integer in range [0; 0xffffffff] to decimal and write it + into the file fd. This function is signal safe. */ @@ -719,26 +719,26 @@ _Py_DumpASCII(int fd, PyObject *text) truncated = 0; } - // Is an ASCII string? - if (ascii->state.ascii) { - assert(kind == PyUnicode_1BYTE_KIND); - char *str = data; - - int need_escape = 0; - for (i=0; i < size; i++) { - ch = str[i]; - if (!(' ' <= ch && ch <= 126)) { - need_escape = 1; - break; - } - } - if (!need_escape) { - // The string can be written with a single write() syscall - _Py_write_noraise(fd, str, size); - goto done; - } - } - + // Is an ASCII string? + if (ascii->state.ascii) { + assert(kind == PyUnicode_1BYTE_KIND); + char *str = data; + + int need_escape = 0; + for (i=0; i < size; i++) { + ch = str[i]; + if (!(' ' <= ch && ch <= 126)) { + need_escape = 1; + break; + } + } + if (!need_escape) { + // The string can be written with a single write() syscall + _Py_write_noraise(fd, str, size); + goto done; + } + } + for (i=0; i < size; i++) { if (kind != PyUnicode_WCHAR_KIND) ch = PyUnicode_READ(kind, data, i); @@ -762,8 +762,8 @@ _Py_DumpASCII(int fd, PyObject *text) _Py_DumpHexadecimal(fd, ch, 8); } } - -done: + +done: if (truncated) { PUTS(fd, "..."); } @@ -776,9 +776,9 @@ done: static void dump_frame(int fd, PyFrameObject *frame) { - PyCodeObject *code = PyFrame_GetCode(frame); + PyCodeObject *code = PyFrame_GetCode(frame); PUTS(fd, " File "); - if (code->co_filename != NULL + if (code->co_filename != NULL && PyUnicode_Check(code->co_filename)) { PUTS(fd, "\""); @@ -789,7 +789,7 @@ dump_frame(int fd, PyFrameObject *frame) } /* PyFrame_GetLineNumber() was introduced in Python 2.7.0 and 3.2.0 */ - int lineno = PyCode_Addr2Line(code, frame->f_lasti); + int lineno = PyCode_Addr2Line(code, frame->f_lasti); PUTS(fd, ", line "); if (lineno >= 0) { _Py_DumpDecimal(fd, (unsigned long)lineno); @@ -799,7 +799,7 @@ dump_frame(int fd, PyFrameObject *frame) } PUTS(fd, " in "); - if (code->co_name != NULL + if (code->co_name != NULL && PyUnicode_Check(code->co_name)) { _Py_DumpASCII(fd, code->co_name); } @@ -808,7 +808,7 @@ dump_frame(int fd, PyFrameObject *frame) } PUTS(fd, "\n"); - Py_DECREF(code); + Py_DECREF(code); } static void @@ -817,35 +817,35 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header) PyFrameObject *frame; unsigned int depth; - if (write_header) { + if (write_header) { PUTS(fd, "Stack (most recent call first):\n"); - } - - // Use a borrowed reference. Avoid Py_INCREF/Py_DECREF, since this function - // can be called in a signal handler by the faulthandler module which must - // not modify Python objects. - frame = tstate->frame; - if (frame == NULL) { - PUTS(fd, "<no Python frame>\n"); + } + + // Use a borrowed reference. Avoid Py_INCREF/Py_DECREF, since this function + // can be called in a signal handler by the faulthandler module which must + // not modify Python objects. + frame = tstate->frame; + if (frame == NULL) { + PUTS(fd, "<no Python frame>\n"); return; - } + } depth = 0; - while (1) { + while (1) { if (MAX_FRAME_DEPTH <= depth) { PUTS(fd, " ...\n"); break; } - if (!PyFrame_Check(frame)) { + if (!PyFrame_Check(frame)) { break; - } + } dump_frame(fd, frame); - PyFrameObject *back = frame->f_back; - - if (back == NULL) { - break; - } - frame = back; + PyFrameObject *back = frame->f_back; + + if (back == NULL) { + break; + } + frame = back; depth++; } } @@ -902,9 +902,9 @@ _Py_DumpTracebackThreads(int fd, PyInterpreterState *interp, Python thread state of the current thread. PyThreadState_Get() doesn't give the state of the thread that caused - the fault if the thread released the GIL, and so - _PyThreadState_GET() cannot be used. Read the thread specific - storage (TSS) instead: call PyGILState_GetThisThreadState(). */ + the fault if the thread released the GIL, and so + _PyThreadState_GET() cannot be used. Read the thread specific + storage (TSS) instead: call PyGILState_GetThisThreadState(). */ current_tstate = PyGILState_GetThisThreadState(); } |