Fix iterating and removing over list
Return after removing and raise exception if removable item not found
This commit is contained in:
parent
0ce73df57d
commit
22a9823871
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user