Commit a9380514 authored by Guido van Rossum's avatar Guido van Rossum

Move the "import readline" to an earlier place so it is also done when

"-i" is given.  (Yes, I know, giving in to Marc Lemburg who wanted
this :-)
parent 60ed49ca
......@@ -228,6 +228,16 @@ Py_Main(argc, argv)
PySys_SetArgv(argc-optind, argv+optind);
if ((inspect || (command == NULL && filename == NULL)) &&
isatty(fileno(stdin))) {
PyObject *v;
v = PyImport_ImportModule("readline");
if (v == NULL)
PyErr_Clear();
else
Py_DECREF(v);
}
if (command) {
sts = PyRun_SimpleString(command) != 0;
free(command);
......@@ -243,14 +253,6 @@ Py_Main(argc, argv)
fclose(fp);
}
}
if (isatty(fileno(stdin))) {
PyObject *v;
v = PyImport_ImportModule("readline");
if (v == NULL)
PyErr_Clear();
else
Py_DECREF(v);
}
}
sts = PyRun_AnyFile(
fp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment