Skip to content

Commit 34a16e2

Browse files
committed
fix #6846
1 parent b6c999e commit 34a16e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/plugins/db_manager/dlg_sql_window.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,20 @@ def fillColumnCombos(self):
191191
connector = self.db.connector
192192
sql = u"SELECT * FROM (%s\n) AS %s LIMIT 0" % ( unicode(query), connector.quoteId(alias) )
193193

194+
c = None
194195
try:
195196
c = connector._execute(None, sql)
196197
cols = connector._get_cursor_columns(c)
197198

198-
except BaseError, e:
199+
except (BaseError, Warning) as e:
199200
QApplication.restoreOverrideCursor()
200201
DlgDbError.showError(e, self)
201202
return
202203

203204
finally:
204-
c.close()
205-
del c
205+
if c:
206+
c.close()
207+
del c
206208

207209
cols.sort()
208210
self.uniqueCombo.addItems( cols )

0 commit comments

Comments
 (0)