Skip to content

Commit

Permalink
Fixed python2.6 compatibilit with sys.version_info tuple.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Antukh committed Mar 8, 2013
1 parent 8ad539a commit d4a1f07
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion djorm_hstore/expressions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import sys
if sys.version_info.major > 2:
if sys.version_info[0] > 2:
basestring = str

from djorm_expressions.base import SqlExpression
Expand Down
2 changes: 1 addition & 1 deletion djorm_hstore/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import forms, util
import sys

if sys.version_info.major < 3:
if sys.version_info[0] < 3:
text_type = unicode
binary_type = str
else:
Expand Down
2 changes: 1 addition & 1 deletion djorm_hstore/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_query_set(self):
from psycopg2.extras import register_hstore

def register_hstore_handler(connection, **kwargs):
if sys.version_info.major < 3:
if sys.version_info[0] < 3:
register_hstore(connection.cursor(), globally=True, unicode=True)
else:
register_hstore(connection.cursor(), globally=True)
Expand Down
3 changes: 2 additions & 1 deletion djorm_hstore/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from django.core.exceptions import ObjectDoesNotExist

import sys
if sys.version_info.major > 2:

if sys.version_info[0] > 2:
basestring = str

def acquire_reference(reference):
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = "djorm-ext-hstore",
version = '0.4.2',
version = '0.4.3',
url = 'https://github.com/niwibe/djorm-ext-hstore',
license = 'BSD',
platforms = ['OS Independent'],
Expand All @@ -30,6 +30,7 @@
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
#"Programming Language :: Python :: 3.2",
#"Programming Language :: Python :: 3.3",
Expand Down

0 comments on commit d4a1f07

Please sign in to comment.