Author: Ronan Lamy <[email protected]>
Branch: py3.6
Changeset: r97232:50a7b57689ea
Date: 2019-08-21 16:51 +0100
http://bitbucket.org/pypy/pypy/changeset/50a7b57689ea/
Log: Fix handling of 1st argument to hashlib.blake2{b,s}() to match
CPython 3.6.9 (bpo-33729)
diff --git a/lib_pypy/_blake2/__init__.py b/lib_pypy/_blake2/__init__.py
--- a/lib_pypy/_blake2/__init__.py
+++ b/lib_pypy/_blake2/__init__.py
@@ -10,7 +10,7 @@
MAX_KEY_SIZE = _lib.BLAKE_KEYBYTES
MAX_DIGEST_SIZE = _lib.BLAKE_OUTBYTES
- def __new__(cls, string=None, *, digest_size=MAX_DIGEST_SIZE,
+ def __new__(cls, _string=None, *, digest_size=MAX_DIGEST_SIZE,
key=None, salt=None, person=None, fanout=1, depth=1,
leaf_size=None, node_offset=None, node_depth=0,
inner_size=0, last_node=False):
@@ -101,8 +101,8 @@
_lib.blake_update(self._state, block, len(block))
# secure_zero_memory(block, sizeof(block)
- if string:
- self.update(string)
+ if _string is not None:
+ self.update(_string)
return self
@property
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit