Nick Coghlan <ncogh...@gmail.com> added the comment:
Good point regarding the heuristic: it would need to take the requested module name into account to be correct. * check if the requested module was found relative to the current directory (can be worked out from __main__.__spec__ and the current working directory) * if it was, make sys.path[0] the absolute path of the current directory * otherwise, remove sys.path[0] entirely ---------- nosy: +ncoghlan _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31874> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com