[Python-checkins] cpython (2.7): Make an error message more understandable and consistent with other error

raymond.hettinger python-checkins at python.org
Sun Nov 20 19:39:01 CET 2011


http://hg.python.org/cpython/rev/70a949f2a1cd
changeset:   73627:70a949f2a1cd
branch:      2.7
parent:      73620:de1ecda2afa2
user:        Raymond Hettinger <python at rcn.com>
date:        Sun Nov 20 10:38:53 2011 -0800
summary:
  Make an error message more understandable and consistent with other error messages.

files:
  Objects/abstract.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -156,7 +156,7 @@
                               "be integer, not '%.200s'", key);
     }
 
-    return type_error("'%.200s' object is not subscriptable", o);
+    return type_error("'%.200s' object has no attribute '__getitem__'", o);
 }
 
 int

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list