Apparently, if you import a module that contains a field with the same name, the exec implementation we use breaks down. I'm super unclear why and how, but that needs to be fixed.
Easy way to trigger the bad behavior:
import pprint
assert False, pprint.__name__
This will print out answer.py instead of pprint.
It's possible this only happens with the pprint module, I haven't experimented.
Apparently, if you import a module that contains a field with the same name, the
exec
implementation we use breaks down. I'm super unclear why and how, but that needs to be fixed.Easy way to trigger the bad behavior:
This will print out
answer.py
instead ofpprint
.It's possible this only happens with the
pprint
module, I haven't experimented.