THRIFT-3525 py:dynamic fails to handle binary list/set/map element
This closes #775
diff --git a/lib/py/src/protocol/fastbinary.c b/lib/py/src/protocol/fastbinary.c
index 714fb13..eaecb8c 100644
--- a/lib/py/src/protocol/fastbinary.c
+++ b/lib/py/src/protocol/fastbinary.c
@@ -947,7 +947,7 @@
}
if (parsedspec.type != type) {
if (!skip(input, type)) {
- PyErr_SetString(PyExc_TypeError, "struct field had wrong type while reading and can't be skipped");
+ PyErr_Format(PyExc_TypeError, "struct field had wrong type: expected %d but got %d", parsedspec.type, type);
goto error;
} else {
continue;