Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2024
1 parent 6119564 commit ceca44f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bindings/python/NumericBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ static SVInt SVIntFromPyInt(const py::int_& value) {
std::vector<byte> mem(numBytes);

int r = -1;
// fix build error with python 3.13
#if PY_VERSION_HEX < 0x030D0000
r = _PyLong_AsByteArray(reinterpret_cast<PyLongObject*>(value.ptr()),
reinterpret_cast<unsigned char*>(mem.data()), numBytes, 1, 1);
#else
r = _PyLong_AsByteArray(reinterpret_cast<PyLongObject*>(value.ptr()),
reinterpret_cast<unsigned char*>(mem.data()), numBytes, 1, 1, 0);
// No exception is thrown here because it will be done later.
#endif
// fix build error with python 3.13
#if PY_VERSION_HEX < 0x030D0000
r = _PyLong_AsByteArray(reinterpret_cast<PyLongObject*>(value.ptr()),
reinterpret_cast<unsigned char*>(mem.data()), numBytes, 1, 1);
#else
r = _PyLong_AsByteArray(reinterpret_cast<PyLongObject*>(value.ptr()),
reinterpret_cast<unsigned char*>(mem.data()), numBytes, 1, 1, 0);
// No exception is thrown here because it will be done later.
#endif

if (r == -1)
throw py::error_already_set();
Expand Down

0 comments on commit ceca44f

Please sign in to comment.