fix "local variable 'txt' referenced before assignment"

This commit is contained in:
Damien Elmes 2014-01-13 19:07:34 +09:00
parent cc98ef3763
commit c5df294a28

View File

@ -96,10 +96,14 @@ class DataModel(QAbstractTableModel):
return return
elif role == Qt.DisplayRole and section < len(self.activeCols): elif role == Qt.DisplayRole and section < len(self.activeCols):
type = self.columnType(section) type = self.columnType(section)
txt = None
for stype, name in self.browser.columns: for stype, name in self.browser.columns:
if type == stype: if type == stype:
txt = name txt = name
break break
# handle case where extension has set an invalid column type
if not txt:
txt = self.browser.columns[0][1]
return txt return txt
else: else:
return return