Message305052
Not sure if it's stated before, this difference of behavior also has other effects, e.g.
$ python -m test.test_traceback
# Ran 61 tests in 0.449s
# FAILED (failures=5)
This is because the loader associated with the module get confused, it loaded the original module as the proper module and then the module changed name to __main__ but the loader is still associated with the old module name, so call to `get_source` fails.
$ cat > test_m.py
print(__loader__.get_source(__name__))
$ python -m test_m
# ImportError: loader for test_m cannot handle __main__ |
|
Date |
User |
Action |
Args |
2017-10-26 13:43:11 | isaiah | set | recipients:
+ isaiah, brett.cannon, vinay.sajip, jaraco, ncoghlan, eric.araujo, Arfrever, eric.snow, serhiy.storchaka |
2017-10-26 13:43:11 | isaiah | set | messageid: <1509025391.01.0.213398074469.issue16737@psf.upfronthosting.co.za> |
2017-10-26 13:43:11 | isaiah | link | issue16737 messages |
2017-10-26 13:43:10 | isaiah | create | |
|