summaryrefslogtreecommitdiffstats
path: root/Modules/sha512module.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-09 14:29:40 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-09 14:29:40 (GMT)
commit5ed033b5a21d56db0dbb0b2535b83afd5cad143d (patch)
treec71f90134e631b26ffe0507c139c3b070266c832 /Modules/sha512module.c
parent867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029 (diff)
downloadcpython-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.c6
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[] = {