diff options
| author | martinko | 2012-05-11 06:30:33 +0000 |
|---|---|---|
| committer | martinko | 2012-05-11 06:30:33 +0000 |
| commit | 60ea682083e30c62c3298b37a9024c41a6ecc3f6 (patch) | |
| tree | a036a51c605fd7911a7b1a85b0623e0437fc3c8b /python/skytools | |
| parent | 073e24f90efb7c77b32c8e6e30dcd976da13fab7 (diff) | |
| parent | b399a33ed51d3d98e7a8469dd24b408d4c25c481 (diff) | |
Merge branch 'master' of skype-git:/git/dba/skytools-3
Diffstat (limited to 'python/skytools')
| -rw-r--r-- | python/skytools/psycopgwrapper.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/python/skytools/psycopgwrapper.py b/python/skytools/psycopgwrapper.py index 8c6d90b6..7cca9e23 100644 --- a/python/skytools/psycopgwrapper.py +++ b/python/skytools/psycopgwrapper.py @@ -107,8 +107,14 @@ class _CompatCursor(psycopg2.extras.DictCursor): class _CompatConnection(psycopg2.extensions.connection): """Connection object that uses _CompatCursor.""" my_name = '?' - def cursor(self): - return psycopg2.extensions.connection.cursor(self, cursor_factory = _CompatCursor) + def cursor(self, name = None): + if name: + return psycopg2.extensions.connection.cursor(self, + cursor_factory = _CompatCursor, + name = name) + else: + return psycopg2.extensions.connection.cursor(self, + cursor_factory = _CompatCursor) def connect_database(connstr, keepalive = True, tcp_keepidle = 4 * 60, # 7200 |
