From 1ab175006dcbe76cd89a4f941e0b5ea2d98089bd Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 31 Aug 2025 13:35:25 +0800 Subject: [PATCH] fix a bug of property --- src/public/internal.c | 2 +- tests/95_bugs.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/public/internal.c b/src/public/internal.c index 832e30e7..964800d7 100644 --- a/src/public/internal.c +++ b/src/public/internal.c @@ -260,7 +260,7 @@ bool pk_loadmethod(py_StackRef self, py_Name name) { self[0] = *py_getslot(cls_var, 0); self[1] = ti->self; break; - default: c11__unreachable(); + default: return false; } return true; } diff --git a/tests/95_bugs.py b/tests/95_bugs.py index fe9071bd..c4ccae94 100644 --- a/tests/95_bugs.py +++ b/tests/95_bugs.py @@ -169,4 +169,14 @@ for x in xs: xs.append(x+1) assert res == list(range(101)) -assert xs == res \ No newline at end of file +assert xs == res + +# call property +from vmath import vec2 + +a = vec2(1, 2) +try: + x = a.x() + exit(1) +except TypeError: + pass \ No newline at end of file