Message270359
Perhaps a suitable outcome here would be to just add an unconditional RuntimeWarning when the target of "-m" is already in sys.modules after the parent package import, along the lines of:
"RuntimeWarning: '<module>' already in sys.modules prior to '__main__' execution; this may result in unpredictable behaviour"
Then if folks get the "ValueError: package.module.__spec__ is not set" message, that would be an example of the noted "unpredictable behaviour", and the suggested resolution would be the path Wolfgang took: find a way to eliminate the warning when executing that particular module as __main__. |
|
Date |
User |
Action |
Args |
2016-07-14 03:44:38 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, eric.snow, martin.panter, wolma |
2016-07-14 03:44:38 | ncoghlan | set | messageid: <1468467878.43.0.00339039871135.issue27487@psf.upfronthosting.co.za> |
2016-07-14 03:44:38 | ncoghlan | link | issue27487 messages |
2016-07-14 03:44:38 | ncoghlan | create | |
|