Fix iterating and removing over list

Return after removing and raise exception if removable item not found
This commit is contained in:
donoban 2018-11-25 18:37:34 +01:00
parent 0ce73df57d
commit 22a9823871
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5
2 changed files with 6 additions and 0 deletions

View File

@ -494,6 +494,9 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
self.tr(msg))
self.threads_list.remove(thread)
return
raise RuntimeError('No finished thread found')
def closeEvent(self, event):
# pylint: disable=invalid-name

View File

@ -240,10 +240,13 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
self.tr(msg))
self.threads_list.remove(thread)
return
if self.thread_closes:
self.done(0)
raise RuntimeError('No finished thread found')
def keyPressEvent(self, event): # pylint: disable=invalid-name
if event.key() == QtCore.Qt.Key_Enter \
or event.key() == QtCore.Qt.Key_Return: