diff --git a/bindings/python/NumericBindings.cpp b/bindings/python/NumericBindings.cpp index 46985945f..e1692824e 100644 --- a/bindings/python/NumericBindings.cpp +++ b/bindings/python/NumericBindings.cpp @@ -33,15 +33,15 @@ static SVInt SVIntFromPyInt(const py::int_& value) { std::vector mem(numBytes); int r = -1; - // fix build error with python 3.13 - #if PY_VERSION_HEX < 0x030D0000 - r = _PyLong_AsByteArray(reinterpret_cast(value.ptr()), - reinterpret_cast(mem.data()), numBytes, 1, 1); - #else - r = _PyLong_AsByteArray(reinterpret_cast(value.ptr()), - reinterpret_cast(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(value.ptr()), + reinterpret_cast(mem.data()), numBytes, 1, 1); +#else + r = _PyLong_AsByteArray(reinterpret_cast(value.ptr()), + reinterpret_cast(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();