◐ Shell
clean mode source ↗

fix: re-raise existing exception when available by KowalskiThomas · Pull Request #667 · msgpack/msgpack-python

What is this PR?

This PR addresses an issue I found while working on #666 and reported in the description there.

Looking at the usages of unpack_callback_uint32 (here for example, which calls into this) it seems like it checks for error values -2 and -3, but -1 will just raise ValueError("Unpack failed: error = %d" % (ret,)).

It believe it should just raise to raise the existing exception set by PyErr_SetString if it exists. This PR addresses that problem here and another place.