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 ncoghlan
Recipients ncoghlan
Date 2013-11-25.12:39:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Issue 19769 shows that if __main__ in a package throws ImportError, runpy will incorrectly report the package as not being directly executable (when it actually claims to be executable, it's just broken)

This can be fixed in 3.3+ by checking for an appropriate value in the name attribute of the caught exception, and only wrapping it if the failed lookup was for the __main__ submodule we're looking for.

The associated test can just use a that deliberately raises ImportError.
Date User Action Args
2013-11-25 12:39:47ncoghlansetrecipients: + ncoghlan
2013-11-25 12:39:47ncoghlansetmessageid: <>
2013-11-25 12:39:47ncoghlanlinkissue19771 messages
2013-11-25 12:39:46ncoghlancreate