diff --git a/.travis.yml b/.travis.yml index b985141b..6f819af3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,7 @@ addons: sudo: false env: - TOXENV=flake8 - - TOXENV=py26-crypto - TOXENV=py27-crypto - - TOXENV=py33-crypto - TOXENV=py34-crypto - TOXENV=py35-crypto - TOXENV=py36-crypto diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dd5a19a..696a6a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). [Unreleased][unreleased] ------------------------------------------------------------------------- ### Changed + +- Dropped support for python 2.6 and 3.3 [#297][297] + ### Fixed ### Added diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index 9e201410..5ddc8a30 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -7,7 +7,7 @@ from .api_jws import PyJWS from .algorithms import Algorithm, get_default_algorithms # NOQA -from .compat import string_types, timedelta_total_seconds +from .compat import string_types from .exceptions import ( DecodeError, ExpiredSignatureError, ImmatureSignatureError, InvalidAudienceError, InvalidIssuedAtError, @@ -101,7 +101,7 @@ def _validate_claims(self, payload, options, audience=None, issuer=None, DeprecationWarning) if isinstance(leeway, timedelta): - leeway = timedelta_total_seconds(leeway) + leeway = leeway.total_seconds() if not isinstance(audience, (string_types, type(None))): raise TypeError('audience must be a string or None') diff --git a/jwt/compat.py b/jwt/compat.py index b928c7d2..c30f109c 100644 --- a/jwt/compat.py +++ b/jwt/compat.py @@ -21,19 +21,6 @@ string_types = (text_type, binary_type) -def timedelta_total_seconds(delta): - try: - delta.total_seconds - except AttributeError: - # On Python 2.6, timedelta instances do not have - # a .total_seconds() method. - total_seconds = delta.days * 24 * 60 * 60 + delta.seconds - else: - total_seconds = delta.total_seconds() - - return total_seconds - - try: constant_time_compare = hmac.compare_digest except AttributeError: diff --git a/setup.py b/setup.py index 5bdb19f5..2e5c272c 100755 --- a/setup.py +++ b/setup.py @@ -60,9 +60,7 @@ def get_version(package): 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tox.ini b/tox.ini index 2ed7fdde..22623484 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{26,27,33,34,35,36}-crypto, py{27,35,36}-contrib_crypto, py{27,35,36}-nocrypto, flake8 +envlist = py{27,34,35,36}-crypto, py{27,35,36}-contrib_crypto, py{27,35,36}-nocrypto, flake8 [testenv] commands =