Antoine Pitrou added the comment: Well, basically some sys attributes (including meta_path) are cleaned during shutdown, so if some code executes afterwards and tries to import something, importlib will complain that meta_path is empty.
Unless the warning is genuinely useful, I would suggest simply removing it. Printing warnings during import can also degenerate into an infinite recursion, if printing the warning needs to import a module, for example: ./python -Wa -c "import sys; sys.meta_path = None; import logging" ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21049> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com