Skip to content

Commit f7acd60

Browse files
kumaraditya303corona10
authored andcommitted
use unique ref
1 parent 4f18916 commit f7acd60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/unicodeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ static int
18161816
unicode_modifiable(PyObject *unicode)
18171817
{
18181818
assert(_PyUnicode_CHECK(unicode));
1819-
if (Py_REFCNT(unicode) != 1)
1819+
if (!_PyObject_IsUniquelyReferenced(unicode))
18201820
return 0;
18211821
if (PyUnicode_HASH(unicode) != -1)
18221822
return 0;
@@ -14738,7 +14738,7 @@ _PyUnicode_FormatLong(PyObject *val, int alt, int prec, int type)
1473814738
assert(PyUnicode_IS_ASCII(result));
1473914739

1474014740
/* To modify the string in-place, there can only be one reference. */
14741-
if (Py_REFCNT(result) != 1) {
14741+
if (!_PyObject_IsUniquelyReferenced(result)) {
1474214742
Py_DECREF(result);
1474314743
PyErr_BadInternalCall();
1474414744
return NULL;

0 commit comments

Comments
 (0)