kevinheavey / solders

A high-performance Python toolkit for Solana, written in Rust
https://kevinheavey.github.io/solders/
Apache License 2.0
205 stars 23 forks source link

Panic output can't be prevented #91

Closed krruzic closed 4 months ago

krruzic commented 4 months ago

Not sure how to title this. My code looks like this:

from solders.keypair import Keypair
try:
    Keypair.from_base58_string("test")
except:
    print("Invalid keypair")

Output:

called `Result::unwrap()` on an `Err` value: signature::Error { source: Some(candidate keypair byte array is too short) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Invalid keypair

I expect only my print statement to be outputted, but the rust panic prints are still printed. I've tried redirecting stderr too.