diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-07-18 17:59:13 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-07-18 17:59:13 (GMT) |
commit | d113c967b4810b504d97ec97459dc85bd3a3facd (patch) | |
tree | 0c9438073f20fd04d73132365416eeea1340ae44 /Modules/_ssl.c | |
parent | 92b3e065172940f546374c4285988b69497c88f5 (diff) | |
download | cpython-d113c967b4810b504d97ec97459dc85bd3a3facd.zip cpython-d113c967b4810b504d97ec97459dc85bd3a3facd.tar.gz cpython-d113c967b4810b504d97ec97459dc85bd3a3facd.tar.bz2 |
improve style of the convert macro (#24655)
Patch by Brian Cain.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index c27073c..4dc1534 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -3372,20 +3372,20 @@ PySSL_get_default_verify_paths(PyObject *self) PyObject *odir_env = NULL; PyObject *odir = NULL; -#define convert(info, target) { \ +#define CONVERT(info, target) { \ const char *tmp = (info); \ target = NULL; \ if (!tmp) { Py_INCREF(Py_None); target = Py_None; } \ else if ((target = PyUnicode_DecodeFSDefault(tmp)) == NULL) { \ target = PyBytes_FromString(tmp); } \ if (!target) goto error; \ - } while(0) + } - convert(X509_get_default_cert_file_env(), ofile_env); - convert(X509_get_default_cert_file(), ofile); - convert(X509_get_default_cert_dir_env(), odir_env); - convert(X509_get_default_cert_dir(), odir); -#undef convert + CONVERT(X509_get_default_cert_file_env(), ofile_env); + CONVERT(X509_get_default_cert_file(), ofile); + CONVERT(X509_get_default_cert_dir_env(), odir_env); + CONVERT(X509_get_default_cert_dir(), odir); +#undef CONVERT return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir); |