Skip to content

Commit aee8c21

Browse files
[3.14] gh-122431: Correct the non-negative error message in readline.append_history_file (GH-143075) (GH-143090)
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 e25083a commit aee8c21

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
@@ -391,7 +391,7 @@ readline_append_history_file_impl(PyObject *module, int nelements,
391391
{
392392
if (nelements < 0)
393393
{
394-
PyErr_SetString(PyExc_ValueError, "nelements must be positive");
394+
PyErr_SetString(PyExc_ValueError, "nelements must be non-negative");
395395
return NULL;
396396
}
397397

0 commit comments

Comments
 (0)