Skip to content

Conversation

@stopthatcow
Copy link
Contributor

Makes bash completion about 10ms faster by exiting python using os._exit() rather than sys.exit().

@stopthatcow
Copy link
Contributor Author

Some concerns have been raised about testability but I think fast_exit in this specific case is ok because it is only used when bash completion is invoked (something we don't test directly). If we did want to test it we'd just need to launch the test using subprocess. Bzr actually uses this 'trick' in all exit code paths I believe to try to be more responsive as a CLI. I got the inspiration from here

@untitaker
Copy link
Contributor

I suppose we can use it as long as we don't actually test anything.

@untitaker untitaker merged commit 1867ede into pallets:master May 4, 2017
@stopthatcow stopthatcow deleted the feature/faster_bash_completion branch May 5, 2017 15:17
@davidism davidism added this to the 7.0 milestone Sep 19, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants