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/_hashopenssl.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/_hashopenssl.c')
-rw-r--r-- | Modules/_hashopenssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 98c91d1..47fc674 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -103,7 +103,7 @@ EVP_digest(EVPobject *self, PyObject *unused) digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); - retval = PyString_FromStringAndSize((const char *)digest, digest_size); + retval = PyBytes_FromStringAndSize((const char *)digest, digest_size); EVP_MD_CTX_cleanup(&temp_ctx); return retval; } @@ -133,7 +133,7 @@ EVP_hexdigest(EVPobject *self, PyObject *unused) retval = PyString_FromStringAndSize(NULL, digest_size * 2); if (!retval) return NULL; - hex_digest = PyString_AsString(retval); + hex_digest = PyString_AS_STRING(retval); if (!hex_digest) { Py_DECREF(retval); return NULL; |