Implement PEP 393.
diff --git a/Modules/md5module.c b/Modules/md5module.c
index de43f1c..b6ab5ca 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -376,7 +376,7 @@
unsigned char digest[MD5_DIGESTSIZE];
struct md5_state temp;
PyObject *retval;
- Py_UNICODE *hex_digest;
+ Py_UCS1 *hex_digest;
int i, j;
/* Get the raw (binary) digest value */
@@ -384,14 +384,10 @@
md5_done(&temp, digest);
/* Create a new string */
- retval = PyUnicode_FromStringAndSize(NULL, MD5_DIGESTSIZE * 2);
+ retval = PyUnicode_New(MD5_DIGESTSIZE * 2, 127);
if (!retval)
return NULL;
- hex_digest = PyUnicode_AS_UNICODE(retval);
- if (!hex_digest) {
- Py_DECREF(retval);
- return NULL;
- }
+ hex_digest = PyUnicode_1BYTE_DATA(retval);
/* Make hex version of the digest */
for(i=j=0; i<MD5_DIGESTSIZE; i++) {