diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2011-05-18 20:53:07 -0400 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2011-05-18 20:53:07 -0400 |
commit | 489969fe3d576fc467ba27d6ad2eda090f6616c5 (patch) | |
tree | 695057dbca4f72863a7eb649775c093c7e70fd2f | |
parent | db0bf44fbfa3ac33272defe90249eca0ba247668 (diff) | |
download | pyopenssl-489969fe3d576fc467ba27d6ad2eda090f6616c5.tar.gz |
Use PyBytes_ for 3.x compatibility
-rw-r--r-- | OpenSSL/crypto/x509.c | 2 | ||||
-rw-r--r-- | OpenSSL/test/test_crypto.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/OpenSSL/crypto/x509.c b/OpenSSL/crypto/x509.c index 4f29b97..9ee28e8 100644 --- a/OpenSSL/crypto/x509.c +++ b/OpenSSL/crypto/x509.c @@ -543,7 +543,7 @@ crypto_X509_get_signature_algorithm(crypto_X509Obj *self, PyObject *args) { PyErr_SetString(PyExc_ValueError, "Undefined signature algorithm"); return NULL; } - return PyString_FromString(OBJ_nid2ln(nid)); + return PyBytes_FromString(OBJ_nid2ln(nid)); } diff --git a/OpenSSL/test/test_crypto.py b/OpenSSL/test/test_crypto.py index 1fcb543..55c42f1 100644 --- a/OpenSSL/test/test_crypto.py +++ b/OpenSSL/test/test_crypto.py @@ -1486,7 +1486,7 @@ WpOdIpB8KksUTCzV591Nr1wd the algorithm used to sign the certificate. """ cert = load_certificate(FILETYPE_PEM, self.pemData) - self.assertEqual(cert.get_signature_algorithm(), "sha1WithRSAEncryption") + self.assertEqual(cert.get_signature_algorithm(), b("sha1WithRSAEncryption")) def test_get_undefined_signature_algorithm(self): |