diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f0d369a9..923456fc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,8 @@ +###### +3.1.2 +###### +- restore compability with Python <2.7.7 + ###### 3.1.1 ###### diff --git a/docs/changes.md b/docs/changes.md index db7bd06e..40aa11db 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,5 +1,8 @@ #Changelog +## 3.1.2 +- restore compability with Python <2.7.7 + ## 3.1.1 - use hmac.compare_digest instead of == for comparing hashes for more security diff --git a/knox/auth.py b/knox/auth.py index baf78768..b4fba714 100644 --- a/knox/auth.py +++ b/knox/auth.py @@ -1,4 +1,8 @@ -from hmac import compare_digest +try: + from hmac import compare_digest +except ImportError: + def compare_digest(a, b): + return a == b from django.conf import settings from django.utils.translation import ugettext_lazy as _ diff --git a/setup.py b/setup.py index 3c8fc29e..bfb2616f 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='3.1.1', + version='3.1.2', description='Authentication for django rest framework', long_description=long_description,