diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 4 | ||||
-rw-r--r-- | Python/clinic/Python-tokenize.c.h | 4 | ||||
-rw-r--r-- | Python/clinic/_warnings.c.h | 6 | ||||
-rw-r--r-- | Python/clinic/bltinmodule.c.h | 18 | ||||
-rw-r--r-- | Python/clinic/import.c.h | 6 | ||||
-rw-r--r-- | Python/clinic/instruction_sequence.c.h | 8 | ||||
-rw-r--r-- | Python/clinic/marshal.c.h | 10 | ||||
-rw-r--r-- | Python/clinic/sysmodule.c.h | 14 | ||||
-rw-r--r-- | Python/clinic/traceback.c.h | 4 |
9 files changed, 63 insertions, 11 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 7a12a86e22e..10e415fa052 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -3121,9 +3121,7 @@ zip_next(PyObject *self) } // 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); - } + _PyTuple_Recycle(result); } else { result = PyTuple_New(tuplesize); if (result == NULL) diff --git a/Python/clinic/Python-tokenize.c.h b/Python/clinic/Python-tokenize.c.h index 2a0d50bda65..9e64c2055a8 100644 --- a/Python/clinic/Python-tokenize.c.h +++ b/Python/clinic/Python-tokenize.c.h @@ -22,9 +22,11 @@ tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(extra_tokens), &_Py_ID(encoding), }, }; #undef NUM_KEYWORDS @@ -81,4 +83,4 @@ skip_optional_kwonly: exit: return return_value; } -/*[clinic end generated code: output=831a75133d4a5034 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4c448f34d9c835c0 input=a9049054013a1b77]*/ diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index bcb4b344fa4..8bda830ccb9 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -81,9 +81,11 @@ warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(message), &_Py_ID(category), &_Py_ID(stacklevel), &_Py_ID(source), &_Py_ID(skip_file_prefixes), }, }; #undef NUM_KEYWORDS @@ -189,9 +191,11 @@ warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(message), &_Py_ID(category), &_Py_ID(filename), &_Py_ID(lineno), &_Py_ID(module), &_Py_ID(registry), &_Py_ID(module_globals), &_Py_ID(source), }, }; #undef NUM_KEYWORDS @@ -280,4 +284,4 @@ warnings_filters_mutated_lock_held(PyObject *module, PyObject *Py_UNUSED(ignored { return warnings_filters_mutated_lock_held_impl(module); } -/*[clinic end generated code: output=d9d32a8b59a30683 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=610ed5764bf40bb5 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index e5f634e34cb..c826a5724f7 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -46,9 +46,11 @@ builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(name), &_Py_ID(globals), &_Py_ID(locals), &_Py_ID(fromlist), &_Py_ID(level), }, }; #undef NUM_KEYWORDS @@ -270,9 +272,11 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(source), &_Py_ID(filename), &_Py_ID(mode), &_Py_ID(flags), &_Py_ID(dont_inherit), &_Py_ID(optimize), &_Py_ID(_feature_version), }, }; #undef NUM_KEYWORDS @@ -425,9 +429,11 @@ builtin_eval(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(globals), &_Py_ID(locals), }, }; #undef NUM_KEYWORDS @@ -504,9 +510,11 @@ builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(globals), &_Py_ID(locals), &_Py_ID(closure), }, }; #undef NUM_KEYWORDS @@ -857,9 +865,11 @@ builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(base), &_Py_ID(exp), &_Py_ID(mod), }, }; #undef NUM_KEYWORDS @@ -933,9 +943,11 @@ builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(sep), &_Py_ID(end), &_Py_ID(file), &_Py_ID(flush), }, }; #undef NUM_KEYWORDS @@ -1075,9 +1087,11 @@ builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(number), &_Py_ID(ndigits), }, }; #undef NUM_KEYWORDS @@ -1142,9 +1156,11 @@ builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(start), }, }; #undef NUM_KEYWORDS @@ -1252,4 +1268,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c08e0e086a791ff0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e7a5d0851d7f2cfb input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 0e6a560d57c..9bbb13f7566 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -199,9 +199,11 @@ _imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(withdata), }, }; #undef NUM_KEYWORDS @@ -572,9 +574,11 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(key), &_Py_ID(source), }, }; #undef NUM_KEYWORDS @@ -625,4 +629,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d0e278351d6adbb1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=24f597d6b0f3feed input=a9049054013a1b77]*/ diff --git a/Python/clinic/instruction_sequence.c.h b/Python/clinic/instruction_sequence.c.h index 41ab2de44e4..f780627bae6 100644 --- a/Python/clinic/instruction_sequence.c.h +++ b/Python/clinic/instruction_sequence.c.h @@ -60,9 +60,11 @@ InstructionSequenceType_use_label(PyObject *self, PyObject *const *args, Py_ssiz static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(label), }, }; #undef NUM_KEYWORDS @@ -122,9 +124,11 @@ InstructionSequenceType_addop(PyObject *self, PyObject *const *args, Py_ssize_t static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(opcode), &_Py_ID(oparg), &_Py_ID(lineno), &_Py_ID(col_offset), &_Py_ID(end_lineno), &_Py_ID(end_col_offset), }, }; #undef NUM_KEYWORDS @@ -235,9 +239,11 @@ InstructionSequenceType_add_nested(PyObject *self, PyObject *const *args, Py_ssi static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(nested), }, }; #undef NUM_KEYWORDS @@ -304,4 +310,4 @@ InstructionSequenceType_get_instructions(PyObject *self, PyObject *Py_UNUSED(ign { return InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); } -/*[clinic end generated code: output=e6b5d05bde008cc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c80501a59a1a1103 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index d9bbb052741..6c00b2b31b0 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -44,9 +44,11 @@ marshal_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(allow_code), }, }; #undef NUM_KEYWORDS @@ -134,9 +136,11 @@ marshal_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(allow_code), }, }; #undef NUM_KEYWORDS @@ -211,9 +215,11 @@ marshal_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(allow_code), }, }; #undef NUM_KEYWORDS @@ -293,9 +299,11 @@ marshal_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(allow_code), }, }; #undef NUM_KEYWORDS @@ -343,4 +351,4 @@ exit: return return_value; } -/*[clinic end generated code: output=c7ef4f599658d8ab input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3e4bfc070a3c78ac input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 1e53624d4d4..d274b0c924c 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -31,9 +31,11 @@ sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(hook), }, }; #undef NUM_KEYWORDS @@ -619,9 +621,11 @@ sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args, static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(depth), }, }; #undef NUM_KEYWORDS @@ -921,9 +925,11 @@ sys_set_int_max_str_digits(PyObject *module, PyObject *const *args, Py_ssize_t n static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(maxdigits), }, }; #undef NUM_KEYWORDS @@ -1071,9 +1077,11 @@ sys_getunicodeinternedsize(PyObject *module, PyObject *const *args, Py_ssize_t n static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(_only_immortal), }, }; #undef NUM_KEYWORDS @@ -1533,9 +1541,11 @@ sys__dump_tracelets(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(outpath), }, }; #undef NUM_KEYWORDS @@ -1595,9 +1605,11 @@ sys__getframemodulename(PyObject *module, PyObject *const *args, Py_ssize_t narg static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(depth), }, }; #undef NUM_KEYWORDS @@ -1754,4 +1766,4 @@ exit: #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=1e5f608092c12636 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=75e202eec4450f50 input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index 5eb31a18946..deae2efa3eb 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -29,9 +29,11 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD + Py_hash_t ob_hash; PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, .ob_item = { &_Py_ID(tb_next), &_Py_ID(tb_frame), &_Py_ID(tb_lasti), &_Py_ID(tb_lineno), }, }; #undef NUM_KEYWORDS @@ -130,4 +132,4 @@ traceback_tb_next_set(PyObject *self, PyObject *value, void *Py_UNUSED(context)) return return_value; } -/*[clinic end generated code: output=ca43786e235e38f4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5361141395da963e input=a9049054013a1b77]*/ |