Skip to content

Loading…

python 3.3 support fix #28

Merged
merged 2 commits into from

2 participants

@vitaly4uk

No description provided.

@dcramer dcramer merged commit e95cbf5 into dcramer:master
@dcramer
Owner

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. @vitaly4uk

    python 3.3 support fix

    vitaly4uk committed
  2. @vitaly4uk

    python 3.3 support fix

    vitaly4uk committed
Showing with 7 additions and 3 deletions.
  1. +3 −2 uuidfield/__init__.py
  2. +4 −1 uuidfield/fields.py
View
5 uuidfield/__init__.py
@@ -1,7 +1,8 @@
+from __future__ import absolute_import
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-uuidfield').version
-except Exception, e:
+except Exception as e:
VERSION = 'unknown'
-from fields import UUIDField
+from .fields import UUIDField
View
5 uuidfield/fields.py
@@ -2,7 +2,10 @@
from django import forms
from django.db.models import Field, SubfieldBase
-from django.utils.encoding import smart_unicode
+try:
+ from django.utils.encoding import smart_unicode
+except ImportError:
+ from django.utils.encoding import smart_text as smart_unicode
try:
# psycopg2 needs us to register the uuid type
Something went wrong with that request. Please try again.