Skip to content

Commit bf49f61

Browse files
committed
Convert check to assert
1 parent 2ebf8a0 commit bf49f61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/unicodeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15344,8 +15344,9 @@ intern_common(PyInterpreterState *interp, PyObject *s /* stolen */,
1534415344
/* Look in the global cache now. */
1534515345
{
1534615346
PyObject *r = (PyObject *)_Py_hashtable_get(INTERNED_STRINGS, s);
15347-
if (r != NULL && r != s) {
15347+
if (r != NULL) {
1534815348
assert(_Py_IsImmortal(r));
15349+
assert(r != s); // r must be statically_allocated; s is not
1534915350
Py_DECREF(s);
1535015351
return Py_NewRef(r);
1535115352
}

0 commit comments

Comments
 (0)