Author: Carl Friedrich Bolz <[email protected]>
Branch: py3.5
Changeset: r88296:0a68df568b22
Date: 2016-11-10 18:01 +0100
http://bitbucket.org/pypy/pypy/changeset/0a68df568b22/
Log: fix return value too
diff --git a/pypy/module/_hashlib/interp_hashlib.py
b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -206,4 +206,4 @@
dklen, buf.raw)
if not r:
raise ValueError
- return space.wrap(buf.str(dklen))
+ return space.newbytes(buf.str(dklen))
diff --git a/pypy/module/_hashlib/test/test_hashlib.py
b/pypy/module/_hashlib/test/test_hashlib.py
--- a/pypy/module/_hashlib/test/test_hashlib.py
+++ b/pypy/module/_hashlib/test/test_hashlib.py
@@ -92,6 +92,7 @@
except ImportError:
skip("Requires OpenSSL >= 1.1")
out = pbkdf2_hmac('sha1', b'password', b'salt', 1)
+ assert type(out) is bytes
assert out == '0c60c80f961f0e71f3a9b524af6012062fe037a6'.decode('hex')
out = pbkdf2_hmac('sha1', b'password', b'salt', 2, None)
assert out == 'ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'.decode('hex')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit