blockpy icon indicating copy to clipboard operation
blockpy copied to clipboard

pprint module not working correctly; produces runtime error

Open acbart opened this issue 5 years ago • 0 comments

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.

acbart avatar Nov 11 '20 18:11 acbart