summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-04-23 15:56:36 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-04-23 15:56:36 (GMT)
commitd4404d659c4b7d9a825571cc27707e28aa61251f (patch)
treec04cea65eaedadbabd0609c108a0b2b46073fcf5
parent976db921b8817d7d21e09415661283bfdfb1a72c (diff)
parent53b977127fe8192f8bdf6a400de81086e128e936 (diff)
downloadcpython-d4404d659c4b7d9a825571cc27707e28aa61251f.zip
cpython-d4404d659c4b7d9a825571cc27707e28aa61251f.tar.gz
cpython-d4404d659c4b7d9a825571cc27707e28aa61251f.tar.bz2
merge heads
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 2e45c8d..2afbbae 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -3686,7 +3686,7 @@ _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr,
res = PyDict_SetItem(dict, key, value);
if (cached != ((PyDictObject *)dict)->ma_keys) {
/* Either update tp->ht_cached_keys or delete it */
- if (cached->dk_refcnt == 1) {
+ if (cached->dk_refcnt == 1 && PyDict_CheckExact(dict)) {
CACHED_KEYS(tp) = make_keys_shared(dict);
if (CACHED_KEYS(tp) == NULL)
return -1;