Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions choice/basicterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def pick_choice(self):
end = start + self.PAGE_SIZE
for i, c in enumerate(self.choices[start:end]):
print(" {}: {}".format(i, c[1]))
if self.global_actions is not None:
if self.global_actions:
print()
for ga in self.global_actions:
if ga[0] == ga[1]:
Expand Down Expand Up @@ -84,7 +84,7 @@ def ask(self):
print("{} is not a valid choice".format(resp))

assert choice is not None
if self.actions is None or len(self.actions) == 1:
if len(self.actions) <= 1:
return choice[0]

action = None
Expand Down Expand Up @@ -149,4 +149,3 @@ def ask(self):
else:
print("Please answer 'y'es or 'n'o")
return self.ask()

2 changes: 1 addition & 1 deletion choice/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# outlist contains elements (id, display)
def idNameList(inlist):
if inlist is None:
return None
return []

outlist = []
for item in inlist:
Expand Down