diff options
author | D'Arcy J.M. Cain | 2002-11-25 03:11:15 +0000 |
---|---|---|
committer | D'Arcy J.M. Cain | 2002-11-25 03:11:15 +0000 |
commit | b64e766643b64fa9d3cae3c80dcdb7b8d02df9ca (patch) | |
tree | 0c90600759c7f108fdf505754f36428bdcd33680 | |
parent | 5e41b20a21b532e4df5fac1588f520387aa9d0e0 (diff) |
I'm sending you a small patch to pgdb.py module. This
raises pgdb.DatabaseError when any of the fetch*
methods was invoked but previous call to execute* did
not produce any result set or no call was issued yet.
Also, raises pgdb.NotSupportedError when .nextset() is
invoked, instead of NameError.
This behaviour complies with DB-API 2.0.
Thanks for your work!
Timur Irmatov.
-rw-r--r-- | src/interfaces/python/pgdb.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interfaces/python/pgdb.py b/src/interfaces/python/pgdb.py index 78ca61ade5..62b551b995 100644 --- a/src/interfaces/python/pgdb.py +++ b/src/interfaces/python/pgdb.py @@ -240,7 +240,10 @@ class pgdbCursor: size = self.arraysize if keep == 1: self.arraysize = size - res = self.__source.fetch(size) + + try: res = self.__source.fetch(size) + except _pg.error, e: raise DatabaseError, str(e) + result = [] for r in res: row = [] @@ -253,6 +256,9 @@ class pgdbCursor: result.append(row) return result + def nextset(self): + raise NotSupportedError, "nextset() is not supported" + def setinputsizes(self, sizes): pass |