Skip to content

Commit f42377a

Browse files
address review
1 parent f00e23f commit f42377a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,6 +2794,9 @@ int
27942794
PyUnstable_SetImmortal(PyObject *op)
27952795
{
27962796
assert(op != NULL);
2797+
if (!_PyObject_IsUniquelyReferenced(op) || PyUnicode_Check(op)) {
2798+
return 0;
2799+
}
27972800
_Py_SetImmortal(op);
27982801
return 1;
27992802
}

0 commit comments

Comments
 (0)