From 0a90998fe2393bb30877978e7ba1de3b5e51e6ce Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 10 Dec 2022 22:14:55 +0800 Subject: [PATCH] up --- plugins/flutter/CHANGELOG.md | 5 +++-- plugins/flutter/pubspec.yaml | 2 +- plugins/flutter/src/pocketpy.h | 3 ++- plugins/godot/godot-cpp | 2 +- plugins/unity/com.bl.pocketpy/Plugins/iOS/pocketpy.h | 3 ++- src/obj.h | 3 ++- src/vm.h | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/flutter/CHANGELOG.md b/plugins/flutter/CHANGELOG.md index f09177bd..27ec326f 100644 --- a/plugins/flutter/CHANGELOG.md +++ b/plugins/flutter/CHANGELOG.md @@ -17,9 +17,10 @@ The initial version. Hello, world! + Fix a bug about comment and indentation + Fix a bug about compile error line number -## 0.4.8+5 +## 0.4.8+6 + Downgrade to `sdk>=2.17.0` + Fix some bugs about compile error + Fix a bug for jsonify `nan` or `inf` -+ Add `math.isnan` and `math.isinf` \ No newline at end of file ++ Add `math.isnan` and `math.isinf` ++ Fix a bug of `__checkType` \ No newline at end of file diff --git a/plugins/flutter/pubspec.yaml b/plugins/flutter/pubspec.yaml index cd828f07..277964c4 100644 --- a/plugins/flutter/pubspec.yaml +++ b/plugins/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: pocketpy description: A lightweight Python interpreter for game engines. -version: 0.4.8+5 +version: 0.4.8+6 homepage: https://pocketpy.dev repository: https://github.com/blueloveth/pocketpy diff --git a/plugins/flutter/src/pocketpy.h b/plugins/flutter/src/pocketpy.h index cd5eec97..bcad5d69 100644 --- a/plugins/flutter/src/pocketpy.h +++ b/plugins/flutter/src/pocketpy.h @@ -3077,6 +3077,7 @@ struct Py_ : PyObject { #define UNION_GET(T, obj) (((Py_*)((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 } diff --git a/plugins/godot/godot-cpp b/plugins/godot/godot-cpp index b1d3e4f6..eaeddb40 160000 --- a/plugins/godot/godot-cpp +++ b/plugins/godot/godot-cpp @@ -1 +1 @@ -Subproject commit b1d3e4f63e539272d5b77bfb44ed8f5778efef9e +Subproject commit eaeddb40e8691f6fbc8419da1d4996583aef07a8 diff --git a/plugins/unity/com.bl.pocketpy/Plugins/iOS/pocketpy.h b/plugins/unity/com.bl.pocketpy/Plugins/iOS/pocketpy.h index cd5eec97..bcad5d69 100644 --- a/plugins/unity/com.bl.pocketpy/Plugins/iOS/pocketpy.h +++ b/plugins/unity/com.bl.pocketpy/Plugins/iOS/pocketpy.h @@ -3077,6 +3077,7 @@ struct Py_ : PyObject { #define UNION_GET(T, obj) (((Py_*)((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 } diff --git a/src/obj.h b/src/obj.h index d7ff8565..0bf5062d 100644 --- a/src/obj.h +++ b/src/obj.h @@ -90,4 +90,5 @@ struct Py_ : PyObject { }; #define UNION_GET(T, obj) (((Py_*)((obj).get()))->_valueT) -#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName()) \ No newline at end of file +#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName()) +#define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__]) \ No newline at end of file diff --git a/src/vm.h b/src/vm.h index 7a462d1f..3bacdaad 100644 --- a/src/vm.h +++ b/src/vm.h @@ -943,7 +943,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 }