From a5300e8584ae1722ec4f5f6449db69d8bb96fb93 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 25 Apr 2019 14:24:30 +0300 Subject: [PATCH] Took into account pylint undefined-loop-variable warnings --- src/bitmessageqt/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index c9b3f4e6..8286e6e8 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1801,6 +1801,7 @@ class MyForm(settingsmixin.SMainWindow): self.ui.tableWidgetInboxSubscriptions, self.ui.tableWidgetInboxChans ): + i = None for i in range(inbox.rowCount()): if msgid == \ inbox.item(i, 3).data(QtCore.Qt.UserRole).toPyObject(): @@ -1813,7 +1814,8 @@ class MyForm(settingsmixin.SMainWindow): # wrong assumption about current folder here: self.getCurrentFolder(treeWidget), treeWidget ) - inbox.removeRow(i) + if i: + inbox.removeRow(i) def newVersionAvailable(self, version): self.notifiedNewVersion = ".".join(str(n) for n in version) @@ -2311,6 +2313,7 @@ class MyForm(settingsmixin.SMainWindow): acct.parseMessage(toAddress, fromAddress, subject, "") else: acct = ret + # pylint:disable=undefined-loop-variable self.propagateUnreadCount(widget=treeWidget if ret else None) if BMConfigParser().getboolean( 'bitmessagesettings', 'showtraynotifications'):