summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index ea195bc..9bb7ffa 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -74,8 +74,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
ste->ste_table = st;
ste->ste_id = k; /* ste owns reference to k */
- Py_INCREF(name);
- ste->ste_name = name;
+ ste->ste_name = Py_NewRef(name);
ste->ste_symbols = NULL;
ste->ste_varnames = NULL;
@@ -286,8 +285,7 @@ _PySymtable_Build(mod_ty mod, PyObject *filename, PyFutureFeatures *future)
_PySymtable_Free(st);
return NULL;
}
- Py_INCREF(filename);
- st->st_filename = filename;
+ st->st_filename = Py_NewRef(filename);
st->st_future = future;
/* Setup recursion depth check counters */
@@ -1949,8 +1947,7 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
return 0;
}
else {
- store_name = name;
- Py_INCREF(store_name);
+ store_name = Py_NewRef(name);
}
if (!_PyUnicode_EqualToASCIIString(name, "*")) {
int r = symtable_add_def(st, store_name, DEF_IMPORT, LOCATION(a));