Skip to content

Commit a656a68

Browse files
authored
Merge branch 'main' into warnings-as-error-2
2 parents e0479be + 2d83891 commit a656a68

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/library/sys.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
12471247

12481248
.. versionadded:: 3.13
12491249

1250+
.. impl-detail::
1251+
1252+
It is not guaranteed to exist in all implementations of Python.
12501253

12511254
.. function:: is_finalizing()
12521255

Objects/dictobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,18 +1412,20 @@ compare_unicode_unicode_threadsafe(PyDictObject *mp, PyDictKeysObject *dk,
14121412
{
14131413
PyDictUnicodeEntry *ep = &((PyDictUnicodeEntry *)ep0)[ix];
14141414
PyObject *startkey = _Py_atomic_load_ptr_relaxed(&ep->me_key);
1415-
assert(startkey == NULL || PyUnicode_CheckExact(startkey));
14161415
if (startkey == key) {
1416+
assert(PyUnicode_CheckExact(startkey));
14171417
return 1;
14181418
}
14191419
if (startkey != NULL) {
14201420
if (_Py_IsImmortal(startkey)) {
1421+
assert(PyUnicode_CheckExact(startkey));
14211422
return unicode_get_hash(startkey) == hash && unicode_eq(startkey, key);
14221423
}
14231424
else {
14241425
if (!_Py_TryIncrefCompare(&ep->me_key, startkey)) {
14251426
return DKIX_KEY_CHANGED;
14261427
}
1428+
assert(PyUnicode_CheckExact(startkey));
14271429
if (unicode_get_hash(startkey) == hash && unicode_eq(startkey, key)) {
14281430
Py_DECREF(startkey);
14291431
return 1;

0 commit comments

Comments
 (0)