From 7f276779046f50df342b0ef8ef10be009c5ee1bb Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Wed, 28 Dec 2022 16:04:18 +0100 Subject: [PATCH] work around curl 7.87 curl_easy_setopt() being broken. --- src/python.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python.c b/src/python.c index 4d5f5f3..931c86d 100644 --- a/src/python.c +++ b/src/python.c @@ -6399,6 +6399,7 @@ static PyObject * pycurl_handle_setopt_string(struct pycurl_data *data, int idx, PyObject *obj) { const char *str; + CURLoption option; if (!PyUnicode_Check(obj)) { PyErr_Format(PyExc_RuntimeError, @@ -6410,8 +6411,8 @@ pycurl_handle_setopt_string(struct pycurl_data *data, int idx, PyObject *obj) if ((str = PyUnicode_AsUTF8(obj)) == NULL) return (NULL); - curl_easy_setopt(data->curl.handle, - CURLOPTTYPE_OBJECTPOINT + py_curlopt[idx].value, str); + option = CURLOPTTYPE_OBJECTPOINT + py_curlopt[idx].value; + curl_easy_setopt(data->curl.handle, option, str); Py_RETURN_TRUE; }