Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to drop support for python 2.6 and 3.3 #301

Merged
merged 2 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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')
Expand Down
13 changes: 0 additions & 13 deletions jwt/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down