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 */
}
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 *
}
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 */
}
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 */