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

Multiple use of "remove_item" fails #81

Open
KCWF2 opened this issue Sep 1, 2022 · 0 comments
Open

Multiple use of "remove_item" fails #81

KCWF2 opened this issue Sep 1, 2022 · 0 comments

Comments

@KCWF2
Copy link

KCWF2 commented Sep 1, 2022

Bug found, could you assist? When trying to remove multiple items from the menu (of type FunctionItem) the menu errors out:

Putting this in the function called by "FunctionItem" fails, however if I remove all but one "remove_item" statement it works fine.
menu.remove_item(menu_functionitem_quizcreate)
menu.remove_item(menu_functionitem_quizedit)

where those items are defined by:
menu_functionitem_quizcreate = FunctionItem("Quiz Create", myQuizCreate, [])
menu_functionitem_quizedit = FunctionItem("Quiz Edit", myQuizEdit, [])

Errors generated:

Exception in thread Thread-1 (_wrap_start):
Traceback (most recent call last):
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\site-packages\consolemenu\console_menu.py", line 172, in _wrap_start
self._main_loop()
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\site-packages\consolemenu\console_menu.py", line 229, in _main_loop
self.process_user_input()
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\site-packages\consolemenu\console_menu.py", line 322, in process_user_input
self.select()
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\site-packages\consolemenu\console_menu.py", line 363, in select
self.selected_item.clean_up()
File "C:\Users\Ken\AppData\Local\Programs\Python\Python310\lib\site-packages\consolemenu\console_menu.py", line 103, in selected_item
return self.items[self.current_option]
IndexError: list index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant