Restructured endless loop definition

I prefer to easily spot an endless loop by not having external variables attached to the loop condition.
Since we never updated `exists` it's a dummy variable that I expect to be updated some where in order to break it.
When that's not the case, it's more clear that it's an endless loop if there's no conditions attached to the loop definition.
This commit is contained in:
Anton Hvornum 2021-04-22 21:36:31 +02:00 committed by GitHub
parent bd9d2c9125
commit 74951b841c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -130,8 +130,7 @@ def ask_for_additional_users(prompt='Any additional users to install (leave blan
return users, super_users
def ask_for_a_timezone():
exists = False
while not exists:
while True:
timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
if timezone == '':
timezone = 'UTC'