goto error;
}
- if (_PyLong_Sign(length_attr) == -1) {
+ if (_PyLong_IsNegative((PyLongObject *)length_attr)) {
Py_DECREF(length_attr);
PyErr_SetString(PyExc_ValueError,
"The '_length_' attribute must not be negative");
#include "pycore_crossinterp.h" // struct _xid
#include "pycore_interp.h" // _PyInterpreterState_IDIncref()
#include "pycore_initconfig.h" // _PyErr_SetFromPyStatus()
-#include "pycore_long.h" // _PyLong_IsNegative()
#include "pycore_modsupport.h" // _PyArg_BadArgument()
#include "pycore_namespace.h" // _PyNamespace_New()
#include "pycore_pybuffer.h" // _PyBuffer_ReleaseInInterpreterAndRawFree()
#include "Python.h"
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_initconfig.h" // _PyStatus_OK()
-#include "pycore_long.h" // _PyLong_Sign()
+#include "pycore_long.h" // _PyLong_IsNegative()
#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
*/
if (!err) {
assert(PyLong_Check(value));
- /* Whether or not it is less than or equal to
- zero is determined by the sign of ob_size
- */
- if (_PyLong_Sign(value) < 0)
+ if (_PyLong_IsNegative((PyLongObject *)value))
result = PY_OFF_T_MIN;
else
result = PY_OFF_T_MAX;