Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b744fa5

Browse filesBrowse files
authored
gh-111140: minor docs typos cleanup in the C example API calls. (#118612)
1 parent b4f8eb0 commit b744fa5
Copy full SHA for b744fa5

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎Doc/c-api/long.rst

Copy file name to clipboardExpand all lines: Doc/c-api/long.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
390390
Usage example::
391391
392392
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);
394394
if (bytes < 0) {
395395
// Failed. A Python exception was set with the reason.
396396
return NULL;
@@ -418,7 +418,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
418418
called twice: first to determine the buffer size, then to fill it::
419419
420420
// 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);
422422
if (expected < 0) {
423423
// Failed. A Python exception was set with the reason.
424424
return NULL;
@@ -430,7 +430,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
430430
return NULL;
431431
}
432432
// 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);
434434
if (bytes < 0) { // Exception has been set.
435435
free(bignum);
436436
return NULL;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.