Commit 323327b6 authored by Christian Heimes's avatar Christian Heimes Committed by Christian Heimes

Fix bytes/str comparison in JWE

In Python 3, '' != b''. With bytes warning enabled, comparison of bytes
and str raise an exception, too.
Signed-off-by: 's avatarChristian Heimes <>
parent a55d16c7
......@@ -457,7 +457,7 @@ class JWE(object):
p = base64url_decode(str(c[0]))
o['protected'] = p.decode('utf-8')
ekey = base64url_decode(str(c[1]))
if ekey != '':
if ekey != b'':
o['encrypted_key'] = base64url_decode(str(c[1]))
o['iv'] = base64url_decode(str(c[2]))
o['ciphertext'] = base64url_decode(str(c[3]))
......@@ -10,7 +10,7 @@ deps =
sitepackages = True
commands =
{envpython} -m coverage run -m pytest --capture=no --strict {posargs}
{envpython} -bb -m coverage run -m pytest --capture=no --strict {posargs}
{envpython} -m coverage report -m
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment