mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Supporting rl_library_version is more trouble than it's worth --
readline doesn't have it before readline 2.2 and there's no compile-time way to find out which readline version is in use. Sigh. GNU readline sucks.
This commit is contained in:
parent
3105f920bf
commit
1ea64ea3ab
1 changed files with 1 additions and 8 deletions
|
@ -38,7 +38,6 @@ extern int read_history(char *);
|
||||||
extern int write_history(char *);
|
extern int write_history(char *);
|
||||||
extern int history_truncate_file(char *, int);
|
extern int history_truncate_file(char *, int);
|
||||||
extern Function *rl_event_hook;
|
extern Function *rl_event_hook;
|
||||||
extern char *rl_library_version;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pointers needed from outside (but not declared in a header file). */
|
/* Pointers needed from outside (but not declared in a header file). */
|
||||||
|
@ -495,16 +494,10 @@ static char doc_module[] =
|
||||||
DL_EXPORT(void)
|
DL_EXPORT(void)
|
||||||
initreadline(void)
|
initreadline(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d, *v;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule4("readline", readline_methods, doc_module,
|
m = Py_InitModule4("readline", readline_methods, doc_module,
|
||||||
(PyObject *)NULL, PYTHON_API_VERSION);
|
(PyObject *)NULL, PYTHON_API_VERSION);
|
||||||
|
|
||||||
d = PyModule_GetDict(m);
|
|
||||||
v = PyString_FromString(rl_library_version);
|
|
||||||
PyDict_SetItemString(d, "library_version", v);
|
|
||||||
Py_XDECREF(v);
|
|
||||||
|
|
||||||
if (isatty(fileno(stdin))) {
|
if (isatty(fileno(stdin))) {
|
||||||
PyOS_ReadlineFunctionPointer = call_readline;
|
PyOS_ReadlineFunctionPointer = call_readline;
|
||||||
setup_readline();
|
setup_readline();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue