summaryrefslogtreecommitdiff
path: root/lib/psycopg1.py
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-06-17 15:17:57 +0000
committerFederico Di Gregorio <fog@initd.org>2005-06-17 15:17:57 +0000
commitd7b10f4a9c17647d5e76eb70d29280d55c26ac62 (patch)
tree40bacd5ce2176ada330855c708786f4418f39add /lib/psycopg1.py
parent90f1a134310097a092c5c17b028b65943d540e83 (diff)
downloadpsycopg2-d7b10f4a9c17647d5e76eb70d29280d55c26ac62.tar.gz
psycopg1 .dictfetchone() fixed (closes #27).
Diffstat (limited to 'lib/psycopg1.py')
-rw-r--r--lib/psycopg1.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/psycopg1.py b/lib/psycopg1.py
index 09b6e84..614418f 100644
--- a/lib/psycopg1.py
+++ b/lib/psycopg1.py
@@ -65,8 +65,11 @@ class cursor(_2cursor):
def dictfetchone(self):
row = _2cursor.fetchone(self)
- return self.__build_dict(row)
-
+ if row:
+ return self.__build_dict(row)
+ else:
+ return row
+
def dictfetchmany(self, size):
res = []
rows = _2cursor.fetchmany(self, size)