Brett Cannon added the comment: I think the check can be removed as long as an AttributeError is caught when trying to access module.__name__ and a message mentioning that the user probably meant to pass in a module is used, e.g.:
try: name = module.__spec__.name except AttributeError: try: name = module.__name__ except AttributeError: raise TypeError("argument should be a module") ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19468> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com