specify exception; convert match result to None

This commit is contained in:
root 2018-08-31 15:13:06 +08:00
parent 8aa27dcdf5
commit 77e6b395e5

View file

@ -306,9 +306,9 @@ class AddonsDialog(QDialog):
def _onAddonItemSelected(self, row_int): def _onAddonItemSelected(self, row_int):
try: try:
addon = self.addons[row_int][1] addon = self.addons[row_int][1]
except: except IndexError:
addon = '' addon = ''
self.form.viewPage.setEnabled(True if re.match(r"^\d+$", addon) else False) self.form.viewPage.setEnabled(bool (re.match(r"^\d+$", addon)))
def annotatedName(self, dir): def annotatedName(self, dir):
meta = self.mgr.addonMeta(dir) meta = self.mgr.addonMeta(dir)