Open lordmauve opened 7 years ago
This is occurring for two reasons:
We don't special case __chopmain__
- which is the module where imported __main__
functions are created - in the same way we special-case __main__
I believe imp.find_source()
will not work on objects created from source in __chopmain__
. We could work around this by storing the source for the object - perhaps in a WeakKeyDictionary. We could consult this dictionary and then fall back to imp.find_source()
.
I wrote this code in a Jupyter Notebook cell:
This crashes with this exception: