python: raise OSError when shared library is missing #44

Merged
andrew merged 1 commits from weaselbot/weaseljson:weaselbot/issue-38 into main 2026-06-29 18:53:50 +00:00
Member

Closes #38

WeaselJsonParser.__init__ no longer calls sys.exit(1) when libweaseljson.so/libweaseljson.dylib cannot be loaded. Instead it raises OSError, letting callers handle a missing native library gracefully. A regression test is added to test_python_bindings.py.

Closes #38 `WeaselJsonParser.__init__` no longer calls `sys.exit(1)` when `libweaseljson.so`/`libweaseljson.dylib` cannot be loaded. Instead it raises `OSError`, letting callers handle a missing native library gracefully. A regression test is added to `test_python_bindings.py`.
weaselbot added 1 commit 2026-06-29 18:03:14 +00:00
python: raise OSError when shared library is missing
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 52s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 50s
CI / pre-commit (pull_request) Successful in 52s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m31s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m25s
96f61665bf
Replace sys.exit(1) in WeaselJsonParser.__init__ with an OSError so
callers can handle a missing libweaseljson gracefully. Also add a test
that verifies the constructor raises OSError for a non-existent build
directory.

Closes #38
andrew scheduled this pull request to auto merge when all checks succeed 2026-06-29 18:38:43 +00:00
andrew merged commit 82bdc8a080 into main 2026-06-29 18:53:50 +00:00
andrew deleted branch weaselbot/issue-38 2026-06-29 18:53:50 +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#44