@@ -390,7 +390,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
390
390
Usage example::
391
391
392
392
int32_t value;
393
- Py_ssize_t bytes = PyLong_AsNativeBits (pylong, &value, sizeof (value), -1 );
393
+ Py_ssize_t bytes = PyLong_AsNativeBytes (pylong, &value, sizeof (value), -1 );
394
394
if (bytes < 0 ) {
395
395
// Failed. A Python exception was set with the reason.
396
396
return NULL;
@@ -418,7 +418,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
418
418
called twice: first to determine the buffer size, then to fill it::
419
419
420
420
// Ask how much space we need.
421
- Py_ssize_t expected = PyLong_AsNativeBits (pylong, NULL, 0, -1);
421
+ Py_ssize_t expected = PyLong_AsNativeBytes (pylong, NULL, 0, -1);
422
422
if (expected < 0) {
423
423
// Failed. A Python exception was set with the reason.
424
424
return NULL;
@@ -430,7 +430,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
430
430
return NULL;
431
431
}
432
432
// Safely get the entire value.
433
- Py_ssize_t bytes = PyLong_AsNativeBits (pylong, bignum, expected, -1);
433
+ Py_ssize_t bytes = PyLong_AsNativeBytes (pylong, bignum, expected, -1);
434
434
if (bytes < 0) { // Exception has been set.
435
435
free(bignum);
436
436
return NULL;
0 commit comments