Modified return value back to {}

This commit is contained in:
Anton Hvornum 2021-04-14 11:58:51 +02:00 committed by GitHub
parent 91723e7dd9
commit c07d286f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -386,7 +386,9 @@ def select_mirror_regions(mirrors, show_top_mirrors=True):
print(' -- You can skip this step by leaving the option blank --')
selected_mirror = input('Select one of the above regions to download packages from (by number or full name): ')
if len(selected_mirror.strip()) == 0:
return {"mirror": None}
# Returning back empty options which can be both used to
# do "if x:" logic as well as do `x.get('mirror', {}).get('sub', None)` chaining
return {}
elif selected_mirror.isdigit() and int(selected_mirror) <= len(regions)-1:
# I'm leaving "mirrors" on purpose here.