aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/context.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2025-06-13 00:05:26 +0300
committershadchin <shadchin@yandex-team.com>2025-06-13 00:35:30 +0300
commit796b9088366b10b4cd42885101fc20c0b5709b07 (patch)
treef287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Python/context.c
parentc72bca862651e507d2ff4980ef7f4ff7267a7227 (diff)
downloadydb-796b9088366b10b4cd42885101fc20c0b5709b07.tar.gz
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Python/context.c')
-rw-r--r--contrib/tools/python3/Python/context.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/tools/python3/Python/context.c b/contrib/tools/python3/Python/context.c
index 7bccfad11a4..e5899219daa 100644
--- a/contrib/tools/python3/Python/context.c
+++ b/contrib/tools/python3/Python/context.c
@@ -821,20 +821,19 @@ contextvar_new(PyObject *name, PyObject *def)
return NULL;
}
- var->var_hash = contextvar_generate_hash(var, name);
- if (var->var_hash == -1) {
- Py_DECREF(var);
- return NULL;
- }
-
var->var_name = Py_NewRef(name);
-
var->var_default = Py_XNewRef(def);
var->var_cached = NULL;
var->var_cached_tsid = 0;
var->var_cached_tsver = 0;
+ var->var_hash = contextvar_generate_hash(var, name);
+ if (var->var_hash == -1) {
+ Py_DECREF(var);
+ return NULL;
+ }
+
if (_PyObject_GC_MAY_BE_TRACKED(name) ||
(def != NULL && _PyObject_GC_MAY_BE_TRACKED(def)))
{