Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b5dbed

Browse files
committed
Attempt to import readline at interactive startup.
1 parent 717c6f9 commit 9b5dbed

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Modules/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ Py_Main(argc, argv)
229229
fclose(fp);
230230
}
231231
}
232+
if (isatty(fileno(stdin))) {
233+
PyObject *v;
234+
v = PyImport_ImportModule("readline");
235+
if (v == NULL)
236+
PyErr_Clear();
237+
else
238+
Py_DECREF(v);
239+
}
232240
}
233241
sts = PyRun_AnyFile(
234242
fp,

0 commit comments

Comments
 (0)