Skip to content

Commit 43de604

Browse files
committed
Fix tox failures
1 parent acdb658 commit 43de604

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
prune .idea
12
include *.in
23
include *.py
34
include tests/*.py

signedjson/sign.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ def verify_signed_json(json_object, signature_name, verify_key):
9797

9898
try:
9999
signature_b64 = signatures[signature_name][key_id]
100-
except:
100+
except KeyError:
101101
raise SignatureVerifyException(
102102
"Missing signature for %s, %s" % (signature_name, key_id)
103103
)
104104

105105
try:
106106
signature = decode_base64(signature_b64)
107-
except:
107+
except Exception:
108108
raise SignatureVerifyException(
109109
"Invalid signature base64 for %s, %s" % (signature_name, key_id)
110110
)
@@ -119,8 +119,7 @@ def verify_signed_json(json_object, signature_name, verify_key):
119119

120120
try:
121121
verify_key.verify(message, signature)
122-
except:
123-
logger.exception("Error verifying signature")
122+
except Exception as e:
124123
raise SignatureVerifyException(
125-
"Unable to verify signature for %s " % signature_name
124+
"Unable to verify signature for %s: %s %s" % (signature_name, type(e), e)
126125
)

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = packaging, pep8, py3pep8, py27, py33, py34, pypy
2+
envlist = packaging, pep8, py3pep8, py27, py33, py34, py35, py36, py37, py38, pypy
33

44
[testenv]
55
deps =
@@ -19,10 +19,10 @@ commands = check-manifest
1919
basepython = python2.7
2020
deps =
2121
flake8
22-
commands = flake8 .
22+
commands = flake8 signedjson tests setup.py
2323

2424
[testenv:py3pep8]
25-
basepython = python3.4
25+
basepython = python3.7
2626
deps =
2727
flake8
28-
commands = flake8 .
28+
commands = flake8 signedjson tests setup.py

0 commit comments

Comments
 (0)