Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Fixed to work with either normal DBAPI Row.cursor.description or pyOD…
Browse files Browse the repository at this point in the history
…BC Row.cursor_description
  • Loading branch information
Wesley Mason authored and 1stvamp committed Jul 21, 2010
1 parent e48480a commit 236cea6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyDBCLI/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ def default(self, line):
# If this DBAPI doesn't provide a keys(), then
# try cursor.description
keys = []
for r in row.cursor.description:
if hasattr(row, 'cursor'):
description = getattr(row, 'cursor').description
else:
description = getattr(row, 'cursor_description')
for r in description:
keys.append(r[0])
else:
keys = keys()
Expand Down

0 comments on commit 236cea6

Please sign in to comment.