|
1 | | -#include "pyconfig.h" // Py_GIL_DISABLED |
2 | | - |
3 | | -#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API) |
4 | | - // Need limited C API for METH_FASTCALL |
5 | | - #define Py_LIMITED_API 0x030d0000 |
6 | | -#endif |
7 | | - |
8 | 1 | #include "parts.h" |
9 | 2 | #include "util.h" |
10 | 3 |
|
@@ -303,13 +296,11 @@ test_pyset_add_frozenset(PyObject *self, PyObject *Py_UNUSED(ignored)) |
303 | 296 | return raiseTestError("test_pyset_add_frozenset", |
304 | 297 | "test object should be tracked"); |
305 | 298 | } |
306 | | - Py_RETURN_NONE; |
307 | 299 | if (PySet_Add(frozenset, tracked_obj) < 0) { |
308 | 300 | Py_DECREF(frozenset); |
309 | 301 | Py_DECREF(tracked_obj); |
310 | 302 | return NULL; |
311 | 303 | } |
312 | | - |
313 | 304 | if (!PyObject_GC_IsTracked(frozenset)) { |
314 | 305 | Py_DECREF(frozenset); |
315 | 306 | Py_DECREF(tracked_obj); |
@@ -366,24 +357,6 @@ test_set_contains_does_not_convert_unhashable_key(PyObject *self, PyObject *Py_U |
366 | 357 | return NULL; |
367 | 358 | } |
368 | 359 |
|
369 | | -// Interface to PySet_Add, returning the set |
370 | | -static PyObject * |
371 | | -pyset_add(PyObject *self, PyObject *const *args, Py_ssize_t nargs) |
372 | | -{ |
373 | | - if (nargs != 2) { |
374 | | - PyErr_SetString(PyExc_TypeError, |
375 | | - "pyset_add requires exactly 2 arguments"); |
376 | | - return NULL; |
377 | | - } |
378 | | - PyObject *set = args[0]; |
379 | | - PyObject *item = args[1]; |
380 | | - |
381 | | - int return_value = PySet_Add(set, item); |
382 | | - if (return_value < 0) { |
383 | | - return NULL; |
384 | | - } |
385 | | - return Py_NewRef(set); |
386 | | -} |
387 | 360 |
|
388 | 361 | static PyMethodDef test_methods[] = { |
389 | 362 | {"set_check", set_check, METH_O}, |
|
0 commit comments