diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-14 09:24:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 09:24:05 (GMT) |
commit | 279f44678c8b84a183f9eeb85e0b086228154497 (patch) | |
tree | 9cacd41975bf15ab7a94fc5ba6a2df57f8e02ee5 /Modules/_ssl.c | |
parent | d057b896f97e6d7447b9bf9246770c41cf205299 (diff) | |
download | cpython-279f44678c8b84a183f9eeb85e0b086228154497.zip cpython-279f44678c8b84a183f9eeb85e0b086228154497.tar.gz cpython-279f44678c8b84a183f9eeb85e0b086228154497.tar.bz2 |
bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933)
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.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 16 |
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; |