Commit 2b6ac5e3 authored by Neal Norwitz's avatar Neal Norwitz

Use unicode.

parent 29e1f363
...@@ -215,7 +215,7 @@ EVP_repr(PyObject *self) ...@@ -215,7 +215,7 @@ EVP_repr(PyObject *self)
{ {
char buf[100]; char buf[100];
PyOS_snprintf(buf, sizeof(buf), "<%s HASH object @ %p>", PyOS_snprintf(buf, sizeof(buf), "<%s HASH object @ %p>",
PyString_AsString(((EVPobject *)self)->name), self); PyUnicode_AsString(((EVPobject *)self)->name), self);
return PyUnicode_FromString(buf); return PyUnicode_FromString(buf);
} }
...@@ -416,7 +416,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict) ...@@ -416,7 +416,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
/* used in the init function to setup a constructor */ /* used in the init function to setup a constructor */
#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \ #define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \ CONST_ ## NAME ## _name_obj = PyUnicode_FromString(#NAME); \
if (EVP_get_digestbyname(#NAME)) { \ if (EVP_get_digestbyname(#NAME)) { \
CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \ CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \ EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment