Rev 4763: Improve the error message when you have a bad object type. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-st-concat
John Arbash Meinel
john at arbash-meinel.com
Wed Oct 21 04:54:10 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1-st-concat
------------------------------------------------------------
revno: 4763
revision-id: john at arbash-meinel.com-20091021035352-aiwgzctxahbflehc
parent: john at arbash-meinel.com-20091021035026-7kovycamyswcycma
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-st-concat
timestamp: Tue 2009-10-20 22:53:52 -0500
message:
Improve the error message when you have a bad object type.
-------------- next part --------------
=== modified file 'bzrlib/_static_tuple_c.c'
--- a/bzrlib/_static_tuple_c.c 2009-10-21 03:41:36 +0000
+++ b/bzrlib/_static_tuple_c.c 2009-10-21 03:53:52 +0000
@@ -250,8 +250,9 @@
obj = PyTuple_GET_ITEM(args, i);
if (!PyString_CheckExact(obj)) {
if (!StaticTuple_CheckExact(obj)) {
- PyErr_SetString(PyExc_TypeError, "StaticTuple.__init__(...)"
- " requires that all items are strings or StaticTuple.");
+ PyErr_Format(PyExc_TypeError, "StaticTuple(...)"
+ " requires that all items are strings or StaticTuples"
+ " not %s.", Py_TYPE(obj)->tp_name);
type->tp_dealloc((PyObject *)self);
return NULL;
}
More information about the bazaar-commits
mailing list