blockpy-edu / blockpy

Blockly that's more Python than JavaScript, powered with Skulpt
Apache License 2.0
391 stars 130 forks source link

pprint module not working correctly; produces runtime error #107

Open acbart opened 3 years ago

acbart commented 3 years ago

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.