summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-07-01 18:44:20 (GMT)
committerGuido van Rossum <guido@python.org>1991-07-01 18:44:20 (GMT)
commitefc0bd02e5a661ede3737ff1d051973166425514 (patch)
treead197380ae3104a0c90e89ba6e6f5b6994efb390 /Python/compile.c
parent89d55cad95697c6807e8dee1642564478f38fdd6 (diff)
downloadcpython-efc0bd02e5a661ede3737ff1d051973166425514.zip
cpython-efc0bd02e5a661ede3737ff1d051973166425514.tar.gz
cpython-efc0bd02e5a661ede3737ff1d051973166425514.tar.bz2
Check for identical types before comparing objects to see if they
are the same -- 0 and 0.0 compare equal but should be considered different here!
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7605003..71d13bc 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -292,7 +292,7 @@ com_add(c, list, v)
int i;
for (i = n; --i >= 0; ) {
object *w = getlistitem(list, i);
- if (cmpobject(v, w) == 0)
+ if (v->ob_type == w->ob_type && cmpobject(v, w) == 0)
return i;
}
if (addlistitem(list, v) != 0)