https://github.com/python/cpython/commit/926ff69f3f59c97a73b90dbaa0842b14339bf66d
commit: 926ff69f3f59c97a73b90dbaa0842b14339bf66d
branch: main
author: Victor Stinner <[email protected]>
committer: cfbolz <[email protected]>
date: 2025-04-23T18:54:13+02:00
summary:
gh-132825: Fix typo in dict_unhashable_type() name (#132847)
files:
M Objects/dictobject.c
M Objects/setobject.c
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index c34d17b2259be3..4fdfd63cd4f714 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -2277,7 +2277,7 @@ PyDict_GetItem(PyObject *op, PyObject *key)
}
static void
-dict_unhashtable_type(PyObject *key)
+dict_unhashable_type(PyObject *key)
{
PyObject *exc = PyErr_GetRaisedException();
assert(exc != NULL);
@@ -2302,7 +2302,7 @@ _PyDict_LookupIndex(PyDictObject *mp, PyObject *key)
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return -1;
}
@@ -2399,7 +2399,7 @@ PyDict_GetItemRef(PyObject *op, PyObject *key, PyObject
**result)
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
*result = NULL;
return -1;
}
@@ -2415,7 +2415,7 @@ _PyDict_GetItemRef_Unicode_LockHeld(PyDictObject *op,
PyObject *key, PyObject **
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
*result = NULL;
return -1;
}
@@ -2453,7 +2453,7 @@ PyDict_GetItemWithError(PyObject *op, PyObject *key)
}
hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return NULL;
}
@@ -2611,7 +2611,7 @@ setitem_take2_lock_held(PyDictObject *mp, PyObject *key,
PyObject *value)
assert(PyDict_Check(mp));
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
Py_DECREF(key);
Py_DECREF(value);
return -1;
@@ -2763,7 +2763,7 @@ PyDict_DelItem(PyObject *op, PyObject *key)
assert(key);
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return -1;
}
@@ -3086,7 +3086,7 @@ pop_lock_held(PyObject *op, PyObject *key, PyObject
**result)
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
if (result) {
*result = NULL;
}
@@ -3421,7 +3421,7 @@ dict_subscript(PyObject *self, PyObject *key)
hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return NULL;
}
ix = _Py_dict_lookup_threadsafe(mp, key, hash, &value);
@@ -4302,7 +4302,7 @@ dict_get_impl(PyDictObject *self, PyObject *key, PyObject
*default_value)
hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return NULL;
}
ix = _Py_dict_lookup_threadsafe(self, key, hash, &val);
@@ -4335,7 +4335,7 @@ dict_setdefault_ref_lock_held(PyObject *d, PyObject *key,
PyObject *default_valu
hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
if (result) {
*result = NULL;
}
@@ -4764,7 +4764,7 @@ PyDict_Contains(PyObject *op, PyObject *key)
{
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- dict_unhashtable_type(key);
+ dict_unhashable_type(key);
return -1;
}
@@ -6855,7 +6855,7 @@ _PyDict_SetItem_LockHeld(PyDictObject *dict, PyObject
*name, PyObject *value)
if (value == NULL) {
Py_hash_t hash = _PyObject_HashFast(name);
if (hash == -1) {
- dict_unhashtable_type(name);
+ dict_unhashable_type(name);
return -1;
}
return delitem_knownhash_lock_held((PyObject *)dict, name, hash);
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 73cebbe7e1ecdf..90e7e6ae14affe 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -212,7 +212,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t
hash)
}
static void
-set_unhashtable_type(PyObject *key)
+set_unhashable_type(PyObject *key)
{
PyObject *exc = PyErr_GetRaisedException();
assert(exc != NULL);
@@ -232,7 +232,7 @@ _PySet_AddTakeRef(PySetObject *so, PyObject *key)
{
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- set_unhashtable_type(key);
+ set_unhashable_type(key);
Py_DECREF(key);
return -1;
}
@@ -401,7 +401,7 @@ set_add_key(PySetObject *so, PyObject *key)
{
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- set_unhashtable_type(key);
+ set_unhashable_type(key);
return -1;
}
return set_add_entry(so, key, hash);
@@ -412,7 +412,7 @@ set_contains_key(PySetObject *so, PyObject *key)
{
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- set_unhashtable_type(key);
+ set_unhashable_type(key);
return -1;
}
return set_contains_entry(so, key, hash);
@@ -423,7 +423,7 @@ set_discard_key(PySetObject *so, PyObject *key)
{
Py_hash_t hash = _PyObject_HashFast(key);
if (hash == -1) {
- set_unhashtable_type(key);
+ set_unhashable_type(key);
return -1;
}
return set_discard_entry(so, key, hash);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]