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

Gracefully handle ^D and treat it like ^C. #14

Merged
merged 1 commit into from Jun 21, 2018
Merged

Gracefully handle ^D and treat it like ^C. #14

merged 1 commit into from Jun 21, 2018

Conversation

iamleot
Copy link
Contributor

@iamleot iamleot commented Jun 21, 2018

Previously EOF was not handled and pressing ^D leads to an EOFError exception
(for Unix muscle memory is usually handy to just exit via a ^D), e.g.:

% cvss_calculator
Interactive CVSS3 calculator

Attack Vector: Network | Adjacent | Local | Physical
Attack Vector: N/A/L/P ^D
Traceback (most recent call last):
  File "/usr/pkg/bin/cvss_calculator-2.7", line 11, in <module>
    load_entry_point('cvss==1.7', 'console_scripts', 'cvss_calculator')()
  File "/usr/pkg/lib/python2.7/site-packages/cvss/cvss_calculator.py", line 42, in main
    vector_string = ask_interactively(version, args.all, args.no_colors)
  File "/usr/pkg/lib/python2.7/site-packages/cvss/interactive.py", line 98, in ask_interactively
    input_value = string_input().upper()
EOFError

Handle EOFError exception in the same way of KeyboardInterrupt.

Previously EOF was not handled and pressing ^D leads to an EOFError exception
(for Unix muscle memory is usually handy to just exit via a ^D).
Handle EOFError exception in the same way of KeyboardInterrupt.
@skontar skontar merged commit 38bad98 into RedHatProductSecurity:master Jun 21, 2018
@skontar
Copy link
Collaborator

skontar commented Jun 21, 2018

Thanks!

@iamleot
Copy link
Contributor Author

iamleot commented Jun 22, 2018 via email

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.

None yet

2 participants