Skip to content

Commit a420161

Browse files
cla7aye15I4ndmiss-islington
authored andcommitted
gh-122431: Correct the non-negative error message in readline.append_history_file (GH-143075)
"positive" -> "non-negative", since zero is included. (cherry picked from commit a273bc9) Co-authored-by: Zheng Yu <dataisland@outlook.com>
1 parent a6cfdb5 commit a420161

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Corrected the error message in :func:`readline.append_history_file` to state that ``nelements`` must be non-negative instead of positive.

Modules/readline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ readline_append_history_file_impl(PyObject *module, int nelements,
353353
{
354354
if (nelements < 0)
355355
{
356-
PyErr_SetString(PyExc_ValueError, "nelements must be positive");
356+
PyErr_SetString(PyExc_ValueError, "nelements must be non-negative");
357357
return NULL;
358358
}
359359

0 commit comments

Comments
 (0)