New submission from Nick Coghlan <ncogh...@gmail.com>: Problems noted by PJE on import-sig: ==================================== For example, PathFinder's find_module treats an empty path the same as sys.path, and will also fail if for some reason the bool() of a PEP 302 finder or loader object is False. Also, module_for_loader() will create a new module object, if you have a False module subclass in sys.modules.
... These distinctions could be more problematic than they appear, as it's possible to inadvertently make your loader or your module subclass capable of being False (for example, if you subclassed a sequence type or implemented a __len__), and this could lead to some very subtle bugs, albeit very rare ones as well. ;-) =================================== The import test cases should include some examples of such pathological objects, with importlib then updated appropriately. ---------- assignee: brett.cannon messages: 140770 nosy: brett.cannon, ncoghlan priority: normal severity: normal stage: test needed status: open title: Use 'is not None' where appropriate in importlib type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12599> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com