diff options
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; |