Message142395
Interestingly, there's already the following code in Modules/main.c:
if ((Py_InspectFlag || (command == NULL && filename == NULL && module == NULL)) &&
isatty(fileno(stdin))) {
PyObject *v;
v = PyImport_ImportModule("readline");
if (v == NULL)
PyErr_Clear();
else
Py_DECREF(v);
}
...meaning readline already gets imported automatically when desired. And indeed:
$ ./python -S
Python 3.3.0a0 (default:50f1922bc1d5, Aug 18 2011, 00:09:47)
[GCC 4.5.2] on linux2
>>> import sys
>>> sys.modules['readline']
<module 'readline' from '/home/antoine/cpython/default/build/lib.linux-x86_64-3.3-pydebug/readline.cpython-33dm.so'>
So perhaps we could simply change this code to import another, private module (e.g. "_setupinteractive.py") which would setup readline and rlcompleter? |
|
Date |
User |
Action |
Args |
2011-08-18 18:37:54 | pitrou | set | recipients:
+ pitrou, loewis, ronaldoussoren, cben, belopolsky, ned.deily, eric.araujo, r.david.murray, lesmana |
2011-08-18 18:37:54 | pitrou | set | messageid: <1313692674.05.0.0224326448436.issue5845@psf.upfronthosting.co.za> |
2011-08-18 18:37:53 | pitrou | link | issue5845 messages |
2011-08-18 18:37:53 | pitrou | create | |
|