Python optimizations strip out asserts. Fix that.
ECDSA_verify returns 1 on success, 0 on invalid signatures, but -1 for errors, which is still bool(-1)==True.