Nick Coghlan <ncogh...@gmail.com> added the comment: If you need to support Python 2.6 as well as 3.1, the simplest thing to do is just tell people to run "pygame.tests.main" always (i.e. completely skip the idea of executing the package directly and always run a submodule instead).
The reason the distinction between packages and modules matters is that the import system has to do more bookkeeping for packages (since they can contain modules and subpackages). Direct execution of packages was meant to be disallowed because the Python 2.5 accident means the __init__ module runs without that extra bookkeeping having been set up properly, which can lead to a broken import system. Unfortunately, the relevant error message was lost for 2.5 in a refactoring that merged duplicated code from a couple of different parts of the standard library. I added Barry to the nosy list as the 2.6 release manager. I'm reluctant to re-enable a known-broken behaviour at all, but if Barry thinks it would be worthwhile downgrading this to a DeprecationWarning rather than an outright error in the next 2.6 maintenance then I would be willing to do that. That would still leave you with people getting a warning though, so I don't think it would be that much of a gain in practice. ---------- nosy: +barry _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2751> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com