Closed mwtoews closed 1 month ago
Another arbitrary decision that can be changed is the return code. I've set this as 1 for now. But it could also be restored to 130 (the default for KeyboardInterrupt
) or 0 for "no error". Opinions welcome.
Update: after reading up on error codes, it seems that 130 is a better choice for CTRL+C.
See related xref #3217 #3218. This PR moves the try/catch to _script_main
where is is more generically caught.
Thank you @mwtoews!
This tidies-up messages while using interactive codespell, if the user decides to cancel using CTRL+C.
For example, before this PR:
and after this PR:
And the same behaviour if a user starts codespell with
python -m codespell_lib ...
Currently there is no test for this. It's probably possible, but not easy for me to construct. If this is important to include, I'd appreciate some tips on how to enable testing
SIGINT
.