summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2007-03-01 17:54:35 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2007-03-01 17:54:35 +0000
commita72f908924290f85d5e73baee5ebc88049893bdf (patch)
tree1cd4bcdd4ad6a00a3ef347e705db7bea86eaaf49
parentf2582eb972303978a5fa115825a646a230624116 (diff)
Changed the postgres version getting code to use cursor.fetchone() instead of dictfetchone(); some versions (including mine) of psycopg don't export dictfetch functions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/backends/postgresql/base.py2
-rw-r--r--django/db/backends/postgresql_psycopg2/base.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index a7503ec533..1aeaa8b437 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -86,7 +86,7 @@ class DatabaseWrapper(local):
global postgres_version
if not postgres_version:
cursor.execute("SELECT version()")
- postgres_version = [int(val) for val in cursor.dictfetchone()['version'].split()[1].split('.')]
+ postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
if settings.DEBUG:
return util.CursorDebugWrapper(cursor, self)
return cursor
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index c1b8ae5916..46ae67779d 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -54,7 +54,7 @@ class DatabaseWrapper(local):
global postgres_version
if not postgres_version:
cursor.execute("SELECT version()")
- postgres_version = [int(val) for val in cursor.dictfetchone()['version'].split()[1].split('.')]
+ postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
if settings.DEBUG:
return util.CursorDebugWrapper(cursor, self)
return cursor