|
|
@@ -3077,6 +3077,7 @@ struct Py_ : PyObject {
|
|
|
|
|
|
#define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT)
|
|
|
#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName())
|
|
|
+#define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__])
|
|
|
|
|
|
|
|
|
class RangeIterator : public BaseIterator {
|
|
|
@@ -4823,7 +4824,7 @@ public:
|
|
|
|
|
|
inline void __checkType(const PyVar& obj, const PyVar& type){
|
|
|
#ifndef PKPY_NO_TYPE_CHECK
|
|
|
- if(!obj->isType(type)) typeError("expected '" + UNION_TP_NAME(type) + "', but got '" + UNION_TP_NAME(obj) + "'");
|
|
|
+ if(!obj->isType(type)) typeError("expected '" + UNION_NAME(type) + "', but got '" + UNION_TP_NAME(obj) + "'");
|
|
|
#endif
|
|
|
}
|
|
|
|