From 2cb631201b85714c31b44897902f08a0c70f48f0 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 28 Jan 2018 19:27:54 +0100 Subject: [PATCH 1/2] the safer compare_digest method is only available with python 2.7.7 --- knox/auth.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 _ From 665c7e9a4cf20f60884895ed58957c7ec8bd9fc3 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 28 Jan 2018 19:30:36 +0100 Subject: [PATCH 2/2] release notes for 3.1.2 --- CHANGELOG.rst | 5 +++++ docs/changes.md | 3 +++ setup.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) 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/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,