only support append_history if readline has it

This commit is contained in:
Benjamin Peterson 2014-11-26 14:35:12 -06:00
parent 810aa6db34
commit d1e22ba7db
5 changed files with 56 additions and 0 deletions

View file

@ -237,6 +237,7 @@ Save a readline history file.\n\
The default filename is ~/.history.");
#ifdef HAVE_RL_APPEND_HISTORY
/* Exported function to save part of a readline history file */
static PyObject *
@ -270,6 +271,7 @@ PyDoc_STRVAR(doc_append_history_file,
"append_history_file(nelements[, filename]) -> None\n\
Append the last nelements of the history list to file.\n\
The default filename is ~/.history.");
#endif
/* Set history length */
@ -782,7 +784,9 @@ static struct PyMethodDef readline_methods[] =
METH_VARARGS, doc_read_history_file},
{"write_history_file", write_history_file,
METH_VARARGS, doc_write_history_file},
#ifdef HAVE_RL_APPEND_HISTORY
{"append_history_file", append_history_file,
#endif
METH_VARARGS, doc_append_history_file},
{"get_history_item", get_history_item,
METH_VARARGS, doc_get_history_item},