diff options
author | Jean-Paul Calderone <exarkun@divmod.com> | 2010-08-12 20:17:59 -0400 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@divmod.com> | 2010-08-12 20:17:59 -0400 |
commit | 728eba9b62cb3608d6ff73ab0545ceb940301078 (patch) | |
tree | f0708e9ae468db93b487584a7befd3d89d192589 /OpenSSL/util.c | |
parent | 072195d56591c82654800a46e86c8637131443b5 (diff) | |
download | pyopenssl-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.c | 8 |
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: |