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

Fix bad return code in bash activation if hashing is disabled #2717

Merged
merged 1 commit into from
May 13, 2024

Conversation

fenkes-ibm
Copy link
Contributor

If hashing is disabled in bash, the hash command will return a nonzero return code. Since it is the last command in the script that return code will also be the "return code" of the source command, so if anyone uses

source activate.sh || die horribly

having hashing disabled will ruin their day.

Fix this by overriding the return code of hash if it's bad. Add tests to verify a good return code and try with and without hashing.

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failing.

If hashing is disabled in bash, the `hash` command will return a nonzero
return code. Since it is the last command in the script that return code
will also be the "return code" of the source command, so if anyone uses

source activate.sh || die horribly

having hashing disabled will ruin their day.

Fix this by overriding the return code of `hash` if it's bad.
Add tests to verify a good return code and try with and without hashing.
@fenkes-ibm
Copy link
Contributor Author

Ah, looks like I wedged in before #2721. Rebased, let's try again.

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat enabled auto-merge (squash) May 13, 2024 17:16
@fenkes-ibm
Copy link
Contributor Author

[email protected] on macos timed out? 🤨 maybe it just had a bad day and needs a rerun?

@gaborbernat gaborbernat merged commit 09c1c69 into pypa:main May 13, 2024
47 checks passed
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