summaryrefslogtreecommitdiff
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-26 14:35:12 -0600
committerBenjamin Peterson <benjamin@python.org>2014-11-26 14:35:12 -0600
commitd1e22ba7db9d8668c486eb77999bbbbdca8b09d3 (patch)
tree6a5b823ea0994796e3a3abd5489b4056cfd273b7 /Modules/readline.c
parent810aa6db3472e48e182b185cc4375615977c85f5 (diff)
downloadcpython-git-d1e22ba7db9d8668c486eb77999bbbbdca8b09d3.tar.gz
only support append_history if readline has it
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index b5a0eba50b..7e0282c578 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -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},