summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Zíma <vlastimil.zima@nic.cz>2019-06-17 15:09:06 +0200
committerVlastimil Zíma <vlastimil.zima@nic.cz>2019-06-17 15:09:06 +0200
commit745c18a98bc9504f76b92847ce06c339fe466898 (patch)
tree76e6de4ec16988ac5f7c8d3851fd343d951eed38
parent68e07736e8ad2122e232258f9d0f067f6f74796a (diff)
parent4bd4181e1b6982fb6078d285c94e983a79bc3eb5 (diff)
downloadopenid-745c18a98bc9504f76b92847ce06c339fe466898.tar.gz
Merge branch 'py37'
-rw-r--r--.travis.yml3
-rw-r--r--openid/consumer/consumer.py2
-rw-r--r--openid/fetchers.py2
-rw-r--r--openid/test/test_cryptutil.py14
-rw-r--r--setup.py1
-rw-r--r--tox.ini6
6 files changed, 13 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml
index 091d075..e8be119 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,6 @@
language: python
+# Enable python 3.7
+dist: xenial
sudo: false
@@ -7,6 +9,7 @@ python:
- "3.4"
- "3.5"
- "3.6"
+ - "3.7"
- "pypy"
addons:
diff --git a/openid/consumer/consumer.py b/openid/consumer/consumer.py
index 86acd8f..275a08a 100644
--- a/openid/consumer/consumer.py
+++ b/openid/consumer/consumer.py
@@ -1185,7 +1185,7 @@ class GenericConsumer(object):
try:
assoc = self._requestAssociation(
endpoint, assoc_type, session_type)
- except ServerError as why:
+ except ServerError:
# Do not keep trying, since it rejected the
# association type that it told us to use.
_LOGGER.error('Server %s refused its suggested association type: session_type=%s, assoc_type=%s',
diff --git a/openid/fetchers.py b/openid/fetchers.py
index f8e6e37..8a10993 100644
--- a/openid/fetchers.py
+++ b/openid/fetchers.py
@@ -289,7 +289,7 @@ class CurlHTTPFetcher(HTTPFetcher):
# and the blank line from the end
empty_line = lines.pop()
if empty_line:
- raise HTTPError("No blank line at end of headers: %r" % (line,))
+ raise HTTPError("No blank line at end of headers: %r" % empty_line)
headers = {}
for line in lines:
diff --git a/openid/test/test_cryptutil.py b/openid/test/test_cryptutil.py
index eae2a1c..106be42 100644
--- a/openid/test/test_cryptutil.py
+++ b/openid/test/test_cryptutil.py
@@ -10,15 +10,9 @@ import six
from openid import cryptutil
+
# Most of the purpose of this test is to make sure that cryptutil can
# find a good source of randomness on this machine.
-if six.PY2:
- long_int = long
-else:
- assert six.PY3
- long_int = int
-
-
class TestLongBinary(unittest.TestCase):
"""Test `longToBinary` and `binaryToLong` functions."""
@@ -27,7 +21,7 @@ class TestLongBinary(unittest.TestCase):
for iteration in range(500):
n = 0
for i in range(10):
- n += long_int(random.randrange(MAX))
+ n += random.randrange(MAX)
s = cryptutil.longToBinary(n)
assert isinstance(s, six.binary_type)
@@ -101,7 +95,7 @@ class TestLongToBase64(unittest.TestCase):
try:
for line in f:
parts = line.strip().split(' ')
- assert parts[0] == cryptutil.longToBase64(long_int(parts[1]))
+ assert parts[0] == cryptutil.longToBase64(int(parts[1]))
finally:
f.close()
@@ -114,6 +108,6 @@ class TestBase64ToLong(unittest.TestCase):
try:
for line in f:
parts = line.strip().split(' ')
- assert long_int(parts[1]) == cryptutil.base64ToLong(parts[0])
+ assert int(parts[1]) == cryptutil.base64ToLong(parts[0])
finally:
f.close()
diff --git a/setup.py b/setup.py
index 621c4c8..f368c49 100644
--- a/setup.py
+++ b/setup.py
@@ -39,6 +39,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
diff --git a/tox.ini b/tox.ini
index c548f3f..bbcdc0b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,13 +1,13 @@
[tox]
envlist =
quality
- py{27,34,35,36}-{openid,djopenid,httplib2,pycurl,requests}
+ py{27,34,35,36,37}-{openid,djopenid,httplib2,pycurl,requests}
pypy-{openid,djopenid,httplib2,pycurl,requests}
# tox-travis specials
[travis]
python =
- 2.7: py27, quality
+ 3.7: py37, quality
# Generic specification for all unspecific environments
[testenv]
@@ -28,7 +28,7 @@ commands =
djopenid: coverage run --parallel-mode --branch --source=openid,examples --module unittest discover --start={toxinidir}/examples
[testenv:quality]
-basepython = python2.7
+basepython = python3.7
extras =
quality
commands =