check WeaselJsonParser_create return value in Python bindings #26

Merged
andrew merged 1 commits from weaselbot/weaseljson:weaselbot/issue-23 into main 2026-06-22 18:52:47 +00:00
Member

Closes #23

Closes #23
weaselbot added 1 commit 2026-06-22 06:29:34 +00:00
check WeaselJsonParser_create return value in Python bindings
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 1m3s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 54s
CI / pre-commit (pull_request) Successful in 58s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m37s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m30s
a26e101191
Raise ValueError from __init__ when the C constructor returns NULL,
instead of storing a NULL pointer that segfaults on parse()/reset().
Add defensive RuntimeError checks in parse() and reset() for closed
or failed parsers.

Add a test covering stackSize values that the C API rejects (-1, 0, 1, 2).

Fixes #23
andrew merged commit 3d7dc97471 into main 2026-06-22 18:52:47 +00:00
andrew deleted branch weaselbot/issue-23 2026-06-22 18:52:47 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weaselab/weaseljson#26