diff --git a/swauth/middleware.py b/swauth/middleware.py
index <HASH>..<HASH> 100644
--- a/swauth/middleware.py
+++ b/swauth/middleware.py
@@ -20,6 +20,7 @@ import hmac
 from httplib import HTTPConnection
 from httplib import HTTPSConnection
 import json
+import six
 import swift
 from time import gmtime
 from time import strftime
@@ -374,9 +375,9 @@ class Swauth(object):
             password = creds_dict['hash']
 
             # https://bugs.python.org/issue5285
-            if isinstance(password, unicode):
+            if isinstance(password, six.text_type):
                 password = password.encode('utf-8')
-            if isinstance(msg, unicode):
+            if isinstance(msg, six.text_type):
                 msg = msg.encode('utf-8')
 
             valid_signature = base64.encodestring(hmac.new(
Replace unicode with six.text_type

The unicode() built-in does not exist under Python 3 so use
six.text_type, which is set correctly to str or unicode, instead.

Change-Id: Ieb<I>c<I>b4a<I>ce<I>cb3adc<I>f5e<I>f6