summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-09-14 10:31:50 (GMT)
committerGitHub <noreply@github.com>2019-09-14 10:31:50 (GMT)
commitd322abbb83eb751045246a70f39d040d13a6108b (patch)
tree40ecc91950b369af1aaaebdd677c071aeae72d53 /Modules/_ssl.c
parent66da347ef0034ad9bddc7fad112025c886249f0d (diff)
downloadcpython-d322abbb83eb751045246a70f39d040d13a6108b.zip
cpython-d322abbb83eb751045246a70f39d040d13a6108b.tar.gz
cpython-d322abbb83eb751045246a70f39d040d13a6108b.tar.bz2
[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141)
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all. (cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 64060c6..6f1f9c8 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -3883,15 +3883,15 @@ error:
/*[clinic input]
_ssl._SSLContext.load_cert_chain
certfile: object
- keyfile: object = NULL
- password: object = NULL
+ keyfile: object = None
+ password: object = None
[clinic start generated code]*/
static PyObject *
_ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile,
PyObject *keyfile, PyObject *password)
-/*[clinic end generated code: output=9480bc1c380e2095 input=7cf9ac673cbee6fc]*/
+/*[clinic end generated code: output=9480bc1c380e2095 input=30bc7e967ea01a58]*/
{
PyObject *certfile_bytes = NULL, *keyfile_bytes = NULL;
pem_password_cb *orig_passwd_cb = SSL_CTX_get_default_passwd_cb(self->ctx);
@@ -3917,7 +3917,7 @@ _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile,
}
goto error;
}
- if (password && password != Py_None) {
+ if (password != Py_None) {
if (PyCallable_Check(password)) {
pw_info.callable = password;
} else if (!_pwinfo_set(&pw_info, password,
@@ -4075,9 +4075,9 @@ _add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len,
/*[clinic input]
_ssl._SSLContext.load_verify_locations
- cafile: object = NULL
- capath: object = NULL
- cadata: object = NULL
+ cafile: object = None
+ capath: object = None
+ cadata: object = None
[clinic start generated code]*/
@@ -4086,7 +4086,7 @@ _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
PyObject *cafile,
PyObject *capath,
PyObject *cadata)
-/*[clinic end generated code: output=454c7e41230ca551 input=997f1fb3a784ef88]*/
+/*[clinic end generated code: output=454c7e41230ca551 input=42ecfe258233e194]*/
{
PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
const char *cafile_buf = NULL, *capath_buf = NULL;