]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix a couple problems with the last patch picked up by Michael Hudson
authorSkip Montanaro <skip@pobox.com>
Mon, 16 Aug 2004 16:15:13 +0000 (16:15 +0000)
committerSkip Montanaro <skip@pobox.com>
Mon, 16 Aug 2004 16:15:13 +0000 (16:15 +0000)
Modules/readline.c

index 043e3653353b7dc8d547eefaa6c6e58a45b60392..40d489f0a57c78574a4d8daa7026711590af744f 100644 (file)
@@ -304,11 +304,9 @@ py_remove_history(PyObject *self, PyObject *args)
                 return NULL;
         entry = remove_history(entry_number);
         if (!entry) {
-                char buf[80];
-                PyOS_snprintf(buf, sizeof(buf),
-                              "No history item at position %i",
-                              entry_number);
-                PyErr_SetString(PyExc_ValueError, buf);
+                PyErr_Format(PyExc_ValueError,
+                             "No history item at position %d",
+                             entry_number);
                 return NULL;
         }
         /* free memory allocated for the history entry */
@@ -323,7 +321,7 @@ py_remove_history(PyObject *self, PyObject *args)
 }
 
 PyDoc_STRVAR(doc_remove_history,
-"remove_history(pos) -> None\n\
+"remove_history_item(pos) -> None\n\
 remove history item given by its position");
 
 static PyObject *
@@ -338,11 +336,9 @@ py_replace_history(PyObject *self, PyObject *args)
         }
         old_entry = replace_history_entry(entry_number, line, (void *)NULL);
         if (!old_entry) {
-                char buf[80];
-                PyOS_snprintf(buf, sizeof(buf),
-                              "No history item at position %i",
-                              entry_number);
-                PyErr_SetString(PyExc_ValueError, buf);
+                PyErr_Format(PyExc_ValueError,
+                             "No history item at position %d",
+                             entry_number);
                 return NULL;
         }
         /* free memory allocated for the old history entry */
@@ -357,7 +353,7 @@ py_replace_history(PyObject *self, PyObject *args)
 }
 
 PyDoc_STRVAR(doc_replace_history,
-"replace_history(pos, line) -> None\n\
+"replace_history_item(pos, line) -> None\n\
 replaces history item given by its position with contents of line");
 
 /* Add a line to the history buffer */