diff --git a/choice/basicterm.py b/choice/basicterm.py index 902a40e..1314df4 100644 --- a/choice/basicterm.py +++ b/choice/basicterm.py @@ -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]: @@ -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 @@ -149,4 +149,3 @@ def ask(self): else: print("Please answer 'y'es or 'n'o") return self.ask() - diff --git a/choice/util.py b/choice/util.py index f612a8f..6a4e2b7 100644 --- a/choice/util.py +++ b/choice/util.py @@ -1,7 +1,7 @@ # outlist contains elements (id, display) def idNameList(inlist): if inlist is None: - return None + return [] outlist = [] for item in inlist: