Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make include_shebang_line clearer #1418

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Make include_shebang_line clearer #1418

merged 1 commit into from
Nov 19, 2022

Conversation

casey
Copy link
Owner

@casey casey commented Nov 19, 2022

@pfmoore Check out this version, it should be clearer. We don't want to include the shebang line if we're on windows or if the interpreter is cmd. Strictly speaking, I don't think the second condition is required, since it's unlikely that anyone will use cmd anywhere but windows, but I wanted to change as little as possible.

@casey casey enabled auto-merge (squash) November 19, 2022 20:52
@casey casey merged commit 6ff18af into master Nov 19, 2022
@casey casey deleted the omit-shebang-on-windows branch November 19, 2022 20:56
@pfmoore
Copy link
Contributor

pfmoore commented Nov 19, 2022

Yep, that works fine. A shebang of #!py now (reliably) runs the script under Python on Windows1.

Footnotes

  1. Well, ignoring bug https://github.com/python/cpython/issues/99442 in Python 3.11, but that's their problem, not yours 🙂 And it will be fixed when 3.11.1 comes out.

@casey
Copy link
Owner Author

casey commented Nov 19, 2022

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants