sage
sage copied to clipboard
`reset()` modifies `__name__`
Steps To Reproduce
as in the title.
sage: __name__
'__main__'
sage: reset()
sage: __name__
'sage.all_cmdline'
Expected Behavior
the last line doesn't modify __name__, or change it to "__main__"
Actual Behavior
Additional Information
No response
Environment
- OS:
- Sage Version:
Checklist
- [x] I have searched the existing issues for a bug report that matches the one I want to file, without success.
- [x] I have read the documentation and troubleshoot guide
This problem is probably realted:
In x.sage, type:
print(__name__)
In sage 10.7, sage x.sage prints sage.all. But in sage 10.5, sage x.sage prints __main__.
In sage 10.7,
sage x.sageprintssage.all. But in sage 10.5,sage x.sageprints__main__.
I came here to report this. This effectively breaks scripts that gatekeep execution by if __name__ == "__main__"