Skip to content

Commit a20a4a4

Browse files
committed
Remove unnecessary error check for PyUnicode_Type.tp_hash
1 parent 6c3041f commit a20a4a4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Objects/dictobject.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,10 +1139,7 @@ check_keys_and_hash(PyDictKeysObject *dk, PyObject *key)
11391139
Py_hash_t hash = unicode_get_hash(key);
11401140
if (hash == -1) {
11411141
hash = PyUnicode_Type.tp_hash(key);
1142-
if (hash == -1) {
1143-
PyErr_Clear();
1144-
return -1;
1145-
}
1142+
assert(hash != -1);
11461143
}
11471144
return hash;
11481145
}

0 commit comments

Comments
 (0)