| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It can now have one of three forms: * basename(argv0) -- for simple scripts * python arv0 -- for directories, ZIP files, etc * python -m module -- for imported modules
| if (modspec.name == '__main__' and not modspec.parent and modspec.has_location | ||
| and _os.path.dirname(modspec.origin) == _os.path.join(_os.getcwd(), arg0)): |
There was a problem hiding this comment.
Actually, it seems that this condition can be simplified to simply modspec.name == '__main__'. What are your thoughts @ncoghlan?
Sorry, something went wrong.
There was a problem hiding this comment.
Actually, additionally checks were just an obstacle, because of differences in normalization between Unix and Windows. So I removed them.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM! Assorted minor comments inline, either tweaking docs wording, or else making the code handle obscure edge cases more gracefully.
Sorry, something went wrong.
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
There was a problem hiding this comment.
Thank you for your suggestions @ncoghlan. I applied them all.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
It can now have one of three forms:
📚 Documentation preview 📚: https://cpython-previews--124799.org.readthedocs.build/