This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients BreamoreBoy, brett.cannon, eric.snow, ncoghlan
Date 2014-10-03.12:53:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412340820.08.0.717230043837.issue19468@psf.upfronthosting.co.za>
In-reply-to
Content
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")
History
Date User Action Args
2014-10-03 12:53:40brett.cannonsetrecipients: + brett.cannon, ncoghlan, BreamoreBoy, eric.snow
2014-10-03 12:53:40brett.cannonsetmessageid: <1412340820.08.0.717230043837.issue19468@psf.upfronthosting.co.za>
2014-10-03 12:53:40brett.cannonlinkissue19468 messages
2014-10-03 12:53:39brett.cannoncreate