You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, if someone does mochi blahblah.mochi and uses __loader__, or __file__, or tries to import something script-relative (which I assume relies on __file__) within blahblah.mochi, problems can happen.
Basically, if someone does
mochi blahblah.mochi
and uses__loader__
, or__file__
, or tries to import something script-relative (which I assume relies on__file__
) within blahblah.mochi, problems can happen.in addition, using
__file__
to load script-relative files is fairly common practice ( http://stackoverflow.com/a/1270970 )Best options (in my opinion) to fix the problem would either be
runpy
to automatically load the script using the pre-existing import mechanics(2) does come at a maintainance cost however
when / if I have free time any time soon, I'll give (1) a shot, and I'll make a pull request for it
Below is just to show effects, please feel free to delete as its not that relevant (its more to prove that it has an effect)
1.py:
withinfile is the same, sans import
1.mochi
withinfilemoch.mochi is the same sans import
relevant
tree
outputand the output of executing such things
The text was updated successfully, but these errors were encountered: