Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed the postgres version getting code to use cursor.fetchone() in…

…stead 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
  • Loading branch information...
commit a72f908924290f85d5e73baee5ebc88049893bdf 1 parent f2582eb
@jacobian jacobian authored
View
2  django/db/backends/postgresql/base.py
@@ -86,7 +86,7 @@ def cursor(self):
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
View
2  django/db/backends/postgresql_psycopg2/base.py
@@ -54,7 +54,7 @@ def cursor(self):
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
Please sign in to comment.
Something went wrong with that request. Please try again.