Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
My concern about importing readline at the top of the module is that importing readline has a side effect. The only module which imports it unconditionally at the top is rlcompleter. In all other places it is imported lazily. And importing readline ahead may not fix the original issue, because there are other modules lazily imported in pdb: runpy, shlex, pydoc. Perhaps we should just say that sys.modules should not be iterated directly, you should first make a copy. There are other issues about RuntimeError raised during iterating sys.modules. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue20703> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com