This commit is contained in:
blueloveTH 2022-12-10 22:14:55 +08:00
parent c5b263d5a8
commit 0a90998fe2
7 changed files with 12 additions and 8 deletions

View File

@ -17,9 +17,10 @@ The initial version. Hello, world!
+ Fix a bug about comment and indentation + Fix a bug about comment and indentation
+ Fix a bug about compile error line number + Fix a bug about compile error line number
## 0.4.8+5 ## 0.4.8+6
+ Downgrade to `sdk>=2.17.0` + Downgrade to `sdk>=2.17.0`
+ Fix some bugs about compile error + Fix some bugs about compile error
+ Fix a bug for jsonify `nan` or `inf` + Fix a bug for jsonify `nan` or `inf`
+ Add `math.isnan` and `math.isinf` + Add `math.isnan` and `math.isinf`
+ Fix a bug of `__checkType`

View File

@ -1,6 +1,6 @@
name: pocketpy name: pocketpy
description: A lightweight Python interpreter for game engines. description: A lightweight Python interpreter for game engines.
version: 0.4.8+5 version: 0.4.8+6
homepage: https://pocketpy.dev homepage: https://pocketpy.dev
repository: https://github.com/blueloveth/pocketpy repository: https://github.com/blueloveth/pocketpy

View File

@ -3077,6 +3077,7 @@ struct Py_ : PyObject {
#define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT) #define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT)
#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName()) #define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName())
#define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__])
class RangeIterator : public BaseIterator { class RangeIterator : public BaseIterator {
@ -4823,7 +4824,7 @@ public:
inline void __checkType(const PyVar& obj, const PyVar& type){ inline void __checkType(const PyVar& obj, const PyVar& type){
#ifndef PKPY_NO_TYPE_CHECK #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 #endif
} }

@ -1 +1 @@
Subproject commit b1d3e4f63e539272d5b77bfb44ed8f5778efef9e Subproject commit eaeddb40e8691f6fbc8419da1d4996583aef07a8

View File

@ -3077,6 +3077,7 @@ struct Py_ : PyObject {
#define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT) #define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT)
#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName()) #define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName())
#define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__])
class RangeIterator : public BaseIterator { class RangeIterator : public BaseIterator {
@ -4823,7 +4824,7 @@ public:
inline void __checkType(const PyVar& obj, const PyVar& type){ inline void __checkType(const PyVar& obj, const PyVar& type){
#ifndef PKPY_NO_TYPE_CHECK #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 #endif
} }

View File

@ -90,4 +90,5 @@ struct Py_ : PyObject {
}; };
#define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT) #define UNION_GET(T, obj) (((Py_<T>*)((obj).get()))->_valueT)
#define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName()) #define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->_typeName())
#define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__])

View File

@ -943,7 +943,7 @@ public:
inline void __checkType(const PyVar& obj, const PyVar& type){ inline void __checkType(const PyVar& obj, const PyVar& type){
#ifndef PKPY_NO_TYPE_CHECK #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 #endif
} }