pidl: give the varible name for bad type in python calls
authorAndrew Tridgell <tridge@samba.org>
Sun, 22 Aug 2010 04:49:10 +0000 (14:49 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 22 Aug 2010 04:57:34 +0000 (14:57 +1000)
This makes it much clearer which argument to a function had the wrong
type

source4/librpc/rpc/pyrpc.h

index f49122a0aef75e5ea2dc58bb699a91ddf53d3e49..4ba9bd3e1fbc1f8a4c36b61c8f876b64d4b925b3 100644 (file)
@@ -24,7 +24,7 @@
 
 #define PY_CHECK_TYPE(type, var, fail) \
        if (!PyObject_TypeCheck(var, type)) {\
-               PyErr_Format(PyExc_TypeError, "Expected type %s", (type)->tp_name); \
+               PyErr_Format(PyExc_TypeError, "Expected type %s for %s", (type)->tp_name, #var); \
                fail; \
        }