gh-128863: Deprecate _PyLong_Sign() function (#129176)

Replace _PyLong_Sign() with PyLong_GetSign().
This commit is contained in:
Victor Stinner 2025-01-23 03:11:53 +01:00 committed by GitHub
parent 0093a31273
commit 1d485db953
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 29 additions and 15 deletions

View file

@ -2159,8 +2159,10 @@ save_long(PicklerObject *self, PyObject *obj)
unsigned char *pdata;
char header[5];
int i;
int sign = _PyLong_Sign(obj);
int sign;
assert(PyLong_Check(obj));
(void)PyLong_GetSign(obj, &sign);
if (sign == 0) {
header[0] = LONG1;
header[1] = 0; /* It's 0 -- an empty bytestring. */