s4-pyrpc: Print location and type name we got when checking for types
authorKamen Mazdrashki <kamenim@samba.org>
Wed, 15 Sep 2010 23:17:34 +0000 (02:17 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Fri, 17 Sep 2010 10:53:03 +0000 (13:53 +0300)
source4/librpc/rpc/pyrpc.h

index 651f8f11f5e8c609050599fa166ae997d7d4c042..c3bc83877ccb4d130486dd72de46bc534f65b31e 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 for %s", (type)->tp_name, #var); \
+               PyErr_Format(PyExc_TypeError, __location__ ": Expected type '%s' for '%s' of type '%s'", (type)->tp_name, #var, Py_TYPE(var)->tp_name); \
                fail; \
        }