Nick Coghlan wrote: > I consider the proposed import change (looking for __module_name__ in the > main > module) a bug fix for the interaction between PEP 338 and 328, but I'll hold > off on committing it until I get the OK from yourself or Neal (and put the > patch on SF in the meantime).
Or maybe not, since SF is still broken :( You can find the diff here instead: http://members.iinet.net.au/~ncoghlan/main_relative_imports.diff The patch includes updates to import.c so that relative imports from a main module executed with -m will work automatically, some additional tests in test_runpy to make sure this all works as intended, and a couple of paragraphs in the tutorial about using explicit relative imports instead of implicit ones. The changes to make runpy set '__module_name__' as well as '__name__' (and the associated doc and test changes) have already been committed. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com