Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame^] | 1 | From 44eaa60cc6c86951ce36811e80c3411d1b1e4c39 Mon Sep 17 00:00:00 2001 |
| 2 | From: Charles Duffy <charles@dyfis.net> |
| 3 | Date: Fri, 19 Jan 2024 17:47:59 -0600 |
| 4 | Subject: [PATCH] Extend aio-libs/multidict#909 to 3.12 as well to address aio-libs/multidict#926 |
| 5 | |
| 6 | Upstream-Status: Submitted [https://github.com/aio-libs/multidict/pull/929] |
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 8 | --- |
| 9 | multidict/_multidict.c | 68 +++++++++++++++++++++--------------------- |
| 10 | 1 file changed, 34 insertions(+), 34 deletions(-) |
| 11 | |
| 12 | diff --git a/multidict/_multidict.c b/multidict/_multidict.c |
| 13 | index 228d4df..6086495 100644 |
| 14 | --- a/multidict/_multidict.c |
| 15 | +++ b/multidict/_multidict.c |
| 16 | @@ -9,7 +9,7 @@ |
| 17 | #include "_multilib/iter.h" |
| 18 | #include "_multilib/views.h" |
| 19 | |
| 20 | -#if PY_MAJOR_VERSION < 3 || PY_MINOR_VERSION < 13 |
| 21 | +#if PY_MAJOR_VERSION < 3 || PY_MINOR_VERSION < 12 |
| 22 | #ifndef _PyArg_UnpackKeywords |
| 23 | #define FASTCALL_OLD |
| 24 | #endif |
| 25 | @@ -444,7 +444,7 @@ fail: |
| 26 | static inline PyObject * |
| 27 | multidict_getall( |
| 28 | MultiDictObject *self, |
| 29 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 30 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 31 | PyObject *args, |
| 32 | PyObject *kwds |
| 33 | #else |
| 34 | @@ -458,7 +458,7 @@ multidict_getall( |
| 35 | *key = NULL, |
| 36 | *_default = NULL; |
| 37 | |
| 38 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 39 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 40 | static char *getall_keywords[] = {"key", "default", NULL}; |
| 41 | |
| 42 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getall", |
| 43 | @@ -509,7 +509,7 @@ skip_optional_pos: |
| 44 | static inline PyObject * |
| 45 | multidict_getone( |
| 46 | MultiDictObject *self, |
| 47 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 48 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 49 | PyObject *args, |
| 50 | PyObject *kwds |
| 51 | #else |
| 52 | @@ -522,7 +522,7 @@ multidict_getone( |
| 53 | PyObject *key = NULL, |
| 54 | *_default = NULL; |
| 55 | |
| 56 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 57 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 58 | static char *getone_keywords[] = {"key", "default", NULL}; |
| 59 | |
| 60 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getone", |
| 61 | @@ -563,7 +563,7 @@ skip_optional_pos: |
| 62 | static inline PyObject * |
| 63 | multidict_get( |
| 64 | MultiDictObject *self, |
| 65 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 66 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 67 | PyObject *args, |
| 68 | PyObject *kwds |
| 69 | #else |
| 70 | @@ -577,7 +577,7 @@ multidict_get( |
| 71 | *_default = Py_None, |
| 72 | *ret; |
| 73 | |
| 74 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 75 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 76 | static char *getone_keywords[] = {"key", "default", NULL}; |
| 77 | |
| 78 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getone", |
| 79 | @@ -833,7 +833,7 @@ multidict_tp_init(MultiDictObject *self, PyObject *args, PyObject *kwds) |
| 80 | static inline PyObject * |
| 81 | multidict_add( |
| 82 | MultiDictObject *self, |
| 83 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 84 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 85 | PyObject *args, |
| 86 | PyObject *kwds |
| 87 | #else |
| 88 | @@ -846,7 +846,7 @@ multidict_add( |
| 89 | PyObject *key = NULL, |
| 90 | *val = NULL; |
| 91 | |
| 92 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 93 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 94 | static char *kwlist[] = {"key", "value", NULL}; |
| 95 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:add", |
| 96 | kwlist, &key, &val)) |
| 97 | @@ -913,7 +913,7 @@ multidict_clear(MultiDictObject *self) |
| 98 | static inline PyObject * |
| 99 | multidict_setdefault( |
| 100 | MultiDictObject *self, |
| 101 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 102 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 103 | PyObject *args, |
| 104 | PyObject *kwds |
| 105 | #else |
| 106 | @@ -926,7 +926,7 @@ multidict_setdefault( |
| 107 | PyObject *key = NULL, |
| 108 | *_default = NULL; |
| 109 | |
| 110 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 111 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 112 | static char *setdefault_keywords[] = {"key", "default", NULL}; |
| 113 | |
| 114 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:setdefault", |
| 115 | @@ -967,7 +967,7 @@ skip_optional_pos: |
| 116 | static inline PyObject * |
| 117 | multidict_popone( |
| 118 | MultiDictObject *self, |
| 119 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 120 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 121 | PyObject *args, |
| 122 | PyObject *kwds |
| 123 | #else |
| 124 | @@ -981,7 +981,7 @@ multidict_popone( |
| 125 | *_default = NULL, |
| 126 | *ret_val = NULL; |
| 127 | |
| 128 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 129 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 130 | static char *popone_keywords[] = {"key", "default", NULL}; |
| 131 | |
| 132 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:popone", |
| 133 | @@ -1046,7 +1046,7 @@ skip_optional_pos: |
| 134 | static inline PyObject * |
| 135 | multidict_pop( |
| 136 | MultiDictObject *self, |
| 137 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 138 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 139 | PyObject *args, |
| 140 | PyObject *kwds |
| 141 | #else |
| 142 | @@ -1060,7 +1060,7 @@ multidict_pop( |
| 143 | *_default = NULL, |
| 144 | *ret_val = NULL; |
| 145 | |
| 146 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 147 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 148 | static char *pop_keywords[] = {"key", "default", NULL}; |
| 149 | |
| 150 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:popone", |
| 151 | @@ -1113,7 +1113,7 @@ skip_optional_pos: |
| 152 | static inline PyObject * |
| 153 | multidict_popall( |
| 154 | MultiDictObject *self, |
| 155 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 156 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 157 | PyObject *args, |
| 158 | PyObject *kwds |
| 159 | #else |
| 160 | @@ -1128,7 +1128,7 @@ multidict_popall( |
| 161 | *ret_val = NULL; |
| 162 | |
| 163 | |
| 164 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 165 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 166 | static char *popall_keywords[] = {"key", "default", NULL}; |
| 167 | |
| 168 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:popall", |
| 169 | @@ -1270,7 +1270,7 @@ static PyMethodDef multidict_methods[] = { |
| 170 | { |
| 171 | "getall", |
| 172 | (PyCFunction)multidict_getall, |
| 173 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 174 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 175 | METH_VARARGS |
| 176 | #else |
| 177 | METH_FASTCALL |
| 178 | @@ -1281,7 +1281,7 @@ static PyMethodDef multidict_methods[] = { |
| 179 | { |
| 180 | "getone", |
| 181 | (PyCFunction)multidict_getone, |
| 182 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 183 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 184 | METH_VARARGS |
| 185 | #else |
| 186 | METH_FASTCALL |
| 187 | @@ -1292,7 +1292,7 @@ static PyMethodDef multidict_methods[] = { |
| 188 | { |
| 189 | "get", |
| 190 | (PyCFunction)multidict_get, |
| 191 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 192 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 193 | METH_VARARGS |
| 194 | #else |
| 195 | METH_FASTCALL |
| 196 | @@ -1321,7 +1321,7 @@ static PyMethodDef multidict_methods[] = { |
| 197 | { |
| 198 | "add", |
| 199 | (PyCFunction)multidict_add, |
| 200 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 201 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 202 | METH_VARARGS |
| 203 | #else |
| 204 | METH_FASTCALL |
| 205 | @@ -1350,7 +1350,7 @@ static PyMethodDef multidict_methods[] = { |
| 206 | { |
| 207 | "setdefault", |
| 208 | (PyCFunction)multidict_setdefault, |
| 209 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 210 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 211 | METH_VARARGS |
| 212 | #else |
| 213 | METH_FASTCALL |
| 214 | @@ -1361,7 +1361,7 @@ static PyMethodDef multidict_methods[] = { |
| 215 | { |
| 216 | "popone", |
| 217 | (PyCFunction)multidict_popone, |
| 218 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 219 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 220 | METH_VARARGS |
| 221 | #else |
| 222 | METH_FASTCALL |
| 223 | @@ -1372,7 +1372,7 @@ static PyMethodDef multidict_methods[] = { |
| 224 | { |
| 225 | "pop", |
| 226 | (PyCFunction)multidict_pop, |
| 227 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 228 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 229 | METH_VARARGS |
| 230 | #else |
| 231 | METH_FASTCALL |
| 232 | @@ -1383,7 +1383,7 @@ static PyMethodDef multidict_methods[] = { |
| 233 | { |
| 234 | "popall", |
| 235 | (PyCFunction)multidict_popall, |
| 236 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 237 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 238 | METH_VARARGS |
| 239 | #else |
| 240 | METH_FASTCALL |
| 241 | @@ -1559,7 +1559,7 @@ multidict_proxy_tp_init(MultiDictProxyObject *self, PyObject *args, |
| 242 | static inline PyObject * |
| 243 | multidict_proxy_getall( |
| 244 | MultiDictProxyObject *self, |
| 245 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 246 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 247 | PyObject *args, |
| 248 | PyObject *kwds |
| 249 | #else |
| 250 | @@ -1572,7 +1572,7 @@ multidict_proxy_getall( |
| 251 | return multidict_getall( |
| 252 | self->md, |
| 253 | args, |
| 254 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 255 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 256 | kwds |
| 257 | #else |
| 258 | nargs, |
| 259 | @@ -1584,7 +1584,7 @@ multidict_proxy_getall( |
| 260 | static inline PyObject * |
| 261 | multidict_proxy_getone( |
| 262 | MultiDictProxyObject *self, |
| 263 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 264 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 265 | PyObject *args, |
| 266 | PyObject *kwds |
| 267 | #else |
| 268 | @@ -1596,7 +1596,7 @@ multidict_proxy_getone( |
| 269 | { |
| 270 | return multidict_getone( |
| 271 | self->md, args, |
| 272 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 273 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 274 | kwds |
| 275 | #else |
| 276 | nargs, kwnames |
| 277 | @@ -1607,7 +1607,7 @@ multidict_proxy_getone( |
| 278 | static inline PyObject * |
| 279 | multidict_proxy_get( |
| 280 | MultiDictProxyObject *self, |
| 281 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 282 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 283 | PyObject *args, |
| 284 | PyObject *kwds |
| 285 | #else |
| 286 | @@ -1620,7 +1620,7 @@ multidict_proxy_get( |
| 287 | return multidict_get( |
| 288 | self->md, |
| 289 | args, |
| 290 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 291 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 292 | kwds |
| 293 | #else |
| 294 | nargs, |
| 295 | @@ -1734,7 +1734,7 @@ static PyMethodDef multidict_proxy_methods[] = { |
| 296 | { |
| 297 | "getall", |
| 298 | (PyCFunction)multidict_proxy_getall, |
| 299 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 300 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 301 | METH_VARARGS |
| 302 | #else |
| 303 | METH_FASTCALL |
| 304 | @@ -1745,7 +1745,7 @@ static PyMethodDef multidict_proxy_methods[] = { |
| 305 | { |
| 306 | "getone", |
| 307 | (PyCFunction)multidict_proxy_getone, |
| 308 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 309 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 310 | METH_VARARGS |
| 311 | #else |
| 312 | METH_FASTCALL |
| 313 | @@ -1756,7 +1756,7 @@ static PyMethodDef multidict_proxy_methods[] = { |
| 314 | { |
| 315 | "get", |
| 316 | (PyCFunction)multidict_proxy_get, |
| 317 | -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 |
| 318 | +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 12 |
| 319 | METH_VARARGS |
| 320 | #else |
| 321 | METH_FASTCALL |
| 322 | -- |
| 323 | 2.43.0 |
| 324 | |