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

fix: ensure word is in the list #290

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

thall
Copy link
Contributor

@thall thall commented Aug 9, 2023

Currently the if statement will be true for input

word: 'VOD', string: 'VOD: Some movie'

but then crash when trying to remove it from the list, since
VOD is not in the list, but rather VOD:.

Stacktrace:

Traceback (most recent call last):
  File "/nix/store/2v34x6pa77nh2xn7sz7jvf3zf9nzgj3m-hypnotix-3.5/lib/hypnotix/hypnotix.py", line 425, in show_groups
    label.set_text("%s (%d)" % (self.remove_word("VOD", group.name), len(group.channels)))
  File "/nix/store/2v34x6pa77nh2xn7sz7jvf3zf9nzgj3m-hypnotix-3.5/lib/hypnotix/hypnotix.py", line 515, in remove_word
    words.remove(word)
ValueError: list.remove(x): x not in list

Currently the if statement will be true for input
```
word: 'VOD', string: 'VOD: Some movie'
```
but then crash when trying to remove it from the list, since
`VOD` is not in the list, but rather `VOD:`.

Stacktrace:
```
Traceback (most recent call last):
  File "/nix/store/2v34x6pa77nh2xn7sz7jvf3zf9nzgj3m-hypnotix-3.5/lib/hypnotix/hypnotix.py", line 425, in show_groups
    label.set_text("%s (%d)" % (self.remove_word("VOD", group.name), len(group.channels)))
  File "/nix/store/2v34x6pa77nh2xn7sz7jvf3zf9nzgj3m-hypnotix-3.5/lib/hypnotix/hypnotix.py", line 515, in remove_word
    words.remove(word)
ValueError: list.remove(x): x not in list
```
@thall thall force-pushed the fix-check-correct-variable branch from 361c4d3 to cabef58 Compare August 9, 2023 14:47
@thall thall changed the title fix: check if word contains in the list to be removed from fix: ensure word is in the list Aug 9, 2023
@mtwebster mtwebster merged commit b3eb36f into linuxmint:master Aug 9, 2023
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants