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

Handle EOF in prompts #107

Merged
merged 1 commit into from
Apr 19, 2022
Merged

Handle EOF in prompts #107

merged 1 commit into from
Apr 19, 2022

Conversation

vpodzime
Copy link
Contributor

Same as if user just hit ENTER -- use the default.

Ticket: ENT-8488
Changelog: None

Same as if user just hit ENTER -- use the default.

Ticket: ENT-8488
Changelog: None
@vpodzime vpodzime requested review from olehermanse and larsewi April 19, 2022 09:17
answer = input(prompt)
except EOFError:
answer = ""

if answer == "":
if default is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't

if default is not None:
    answer = default
else:
    answer = None

equivalent to

answer = default

?

Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

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

ACK

@olehermanse olehermanse merged commit 0cca636 into cfengine:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants