summaryrefslogtreecommitdiff
path: root/OpenSSL/util.c
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@divmod.com>2010-08-12 20:17:59 -0400
committerJean-Paul Calderone <exarkun@divmod.com>2010-08-12 20:17:59 -0400
commit728eba9b62cb3608d6ff73ab0545ceb940301078 (patch)
treef0708e9ae468db93b487584a7befd3d89d192589 /OpenSSL/util.c
parent072195d56591c82654800a46e86c8637131443b5 (diff)
downloadpyopenssl-728eba9b62cb3608d6ff73ab0545ceb940301078.tar.gz
Handle the difference between PyNumber_ToBase(16) and PyString_Format("%x")
Diffstat (limited to 'OpenSSL/util.c')
-rw-r--r--OpenSSL/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/OpenSSL/util.c b/OpenSSL/util.c
index 76a4a25..661bb1d 100644
--- a/OpenSSL/util.c
+++ b/OpenSSL/util.c
@@ -77,6 +77,14 @@ PyObject* PyOpenSSL_LongToHex(PyObject *o) {
goto err;
}
+#ifdef PY3
+ {
+ PyObject *hexbytes = PyUnicode_AsASCIIString(hex);
+ Py_DECREF(hex);
+ hex = hexbytes;
+ }
+#endif
+
return hex;
err: