diff options
author | Guido van Rossum <guido@python.org> | 2007-07-09 14:29:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-09 14:29:40 (GMT) |
commit | 5ed033b5a21d56db0dbb0b2535b83afd5cad143d (patch) | |
tree | c71f90134e631b26ffe0507c139c3b070266c832 /Modules/sha512module.c | |
parent | 867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029 (diff) | |
download | cpython-5ed033b5a21d56db0dbb0b2535b83afd5cad143d.zip cpython-5ed033b5a21d56db0dbb0b2535b83afd5cad143d.tar.gz cpython-5ed033b5a21d56db0dbb0b2535b83afd5cad143d.tar.bz2 |
Change hashlib to return bytes from digest() instead of str8.
Diffstat (limited to 'Modules/sha512module.c')
-rw-r--r-- | Modules/sha512module.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/sha512module.c b/Modules/sha512module.c index 9f47b61..f2aae3a 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -498,7 +498,7 @@ SHA512_digest(SHAobject *self, PyObject *unused) SHAcopy(self, &temp); sha512_final(digest, &temp); - return PyString_FromStringAndSize((const char *)digest, self->digestsize); + return PyBytes_FromStringAndSize((const char *)digest, self->digestsize); } PyDoc_STRVAR(SHA512_hexdigest__doc__, @@ -576,9 +576,9 @@ static PyObject * SHA512_get_name(PyObject *self, void *closure) { if (((SHAobject *)self)->digestsize == 64) - return PyString_FromStringAndSize("SHA512", 6); + return PyUnicode_FromStringAndSize("SHA512", 6); else - return PyString_FromStringAndSize("SHA384", 6); + return PyUnicode_FromStringAndSize("SHA384", 6); } static PyGetSetDef SHA_getseters[] = { |