diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-04-23 15:56:36 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-04-23 15:56:36 (GMT) |
commit | d4404d659c4b7d9a825571cc27707e28aa61251f (patch) | |
tree | c04cea65eaedadbabd0609c108a0b2b46073fcf5 | |
parent | 976db921b8817d7d21e09415661283bfdfb1a72c (diff) | |
parent | 53b977127fe8192f8bdf6a400de81086e128e936 (diff) | |
download | cpython-d4404d659c4b7d9a825571cc27707e28aa61251f.zip cpython-d4404d659c4b7d9a825571cc27707e28aa61251f.tar.gz cpython-d4404d659c4b7d9a825571cc27707e28aa61251f.tar.bz2 |
merge heads
-rw-r--r-- | Objects/dictobject.c | 2 |
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; |