diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 21:20:39 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 21:20:39 (GMT) |
commit | 721738fbee8d75dab5a5d3c4f3dbd7c72d76925e (patch) | |
tree | c0e693ed7f2e6c44d48555f3cc4d8775ac8e14bb /Modules/_ssl.c | |
parent | 9351117139363f3e600c541bc88139702a055db8 (diff) | |
parent | 6f430e496339aea3e688165340456b555d5e1035 (diff) | |
download | cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.zip cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.gz cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.bz2 |
Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b5d1530..1104a4e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1037,15 +1037,15 @@ PySSL_peercert(PySSLSocket *self, PyObject *args) PyObject *retval = NULL; int len; int verification; - PyObject *binary_mode = Py_None; + int binary_mode = 0; - if (!PyArg_ParseTuple(args, "|O:peer_certificate", &binary_mode)) + if (!PyArg_ParseTuple(args, "|p:peer_certificate", &binary_mode)) return NULL; if (!self->peer_cert) Py_RETURN_NONE; - if (PyObject_IsTrue(binary_mode)) { + if (binary_mode) { /* return cert in DER-encoded format */ unsigned char *bytes_buf = NULL; |