Skip to content

Commit a85846b

Browse files
Use private C API instead of PyLong_IsNegative().
1 parent 64abcc3 commit a85846b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/resource.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <string.h>
88
#include <sys/resource.h> // getrusage()
99
#include <unistd.h> // getpagesize()
10+
#include <internal/pycore_long.h> // _PyLong_IsNegative()
1011

1112
/* On some systems, these aren't in any header file.
1213
On others they are, with inconsistent prototypes.
@@ -155,7 +156,7 @@ py2rlim(PyObject *obj, rlim_t *out)
155156
if (obj == NULL) {
156157
return -1;
157158
}
158-
int neg = PyLong_IsNegative(obj);
159+
int neg = _PyLong_IsNegative((const PyLongObject *)obj);
159160
assert(neg >= 0);
160161
Py_ssize_t bytes = PyLong_AsNativeBytes(obj, out, sizeof(*out),
161162
Py_ASNATIVEBYTES_NATIVE_ENDIAN |

0 commit comments

Comments
 (0)