summaryrefslogtreecommitdiff
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-02-07 22:12:01 +0000
committerRaymond Hettinger <python@rcn.com>2007-02-07 22:12:01 +0000
commit127ef44c7b56b726abcdddda28c88996b66076c0 (patch)
tree4b98d9cd4cc4c16c4bb900ec665e53ae840daffe /Objects/abstract.c
parent113776c41134bd499efe2b404e25446b31b5c48d (diff)
downloadcpython-git-127ef44c7b56b726abcdddda28c88996b66076c0.tar.gz
Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 7115c523c2..7462c58dec 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1157,6 +1157,8 @@ PySequence_Check(PyObject *s)
{
if (s && PyInstance_Check(s))
return PyObject_HasAttrString(s, "__getitem__");
+ if (PyObject_IsInstance(s, &PyDict_Type))
+ return 0;
return s != NULL && s->ob_type->tp_as_sequence &&
s->ob_type->tp_as_sequence->sq_item != NULL;
}