PyQt6-sip 13.5.2__tar.gz → 13.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of PyQt6-sip might be problematic. Click here for more details.

Files changed (28) hide show
  1. PyQt6_sip-13.8.0/LICENSE +22 -0
  2. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/MANIFEST.in +0 -1
  3. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/PKG-INFO +5 -9
  4. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/PyQt6_sip.egg-info/PKG-INFO +5 -9
  5. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/PyQt6_sip.egg-info/SOURCES.txt +0 -3
  6. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/setup.cfg +3 -3
  7. PyQt6_sip-13.8.0/setup.py +23 -0
  8. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip.h +23 -20
  9. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_array.c +10 -16
  10. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_array.h +4 -13
  11. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_core.c +70 -41
  12. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_core.h +10 -18
  13. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_descriptors.c +4 -17
  14. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_enum.c +4 -13
  15. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_enum.h +4 -13
  16. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_int_convertors.c +4 -13
  17. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_object_map.c +10 -19
  18. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_threads.c +3 -13
  19. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/sip_voidptr.c +16 -15
  20. PyQt6_sip-13.5.2/LICENSE +0 -49
  21. PyQt6_sip-13.5.2/LICENSE-GPL2 +0 -344
  22. PyQt6_sip-13.5.2/LICENSE-GPL3 +0 -678
  23. PyQt6_sip-13.5.2/setup.py +0 -45
  24. PyQt6_sip-13.5.2/sip_bool.cpp +0 -23
  25. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/PyQt6_sip.egg-info/dependency_links.txt +0 -0
  26. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/PyQt6_sip.egg-info/top_level.txt +0 -0
  27. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/README +0 -0
  28. {PyQt6_sip-13.5.2 → PyQt6_sip-13.8.0}/pyproject.toml +0 -0
@@ -0,0 +1,22 @@
1
+ Copyright 2024 Phil Thompson <phil@riverbankcomputing.com>
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this
7
+ list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,3 +1,2 @@
1
1
  include *.h
2
- include sip_bool.cpp
3
2
  include pyproject.toml
@@ -1,23 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQt6_sip
3
- Version: 13.5.2
3
+ Version: 13.8.0
4
4
  Summary: The sip module support for PyQt6
5
- Home-page: https://www.riverbankcomputing.com/software/sip/
6
- Author: Riverbank Computing Limited
7
- Author-email: info@riverbankcomputing.com
5
+ Home-page: https://github.com/Python-SIP/sip
6
+ Author: Phil Thompson
7
+ Author-email: phil@riverbankcomputing.com
8
8
  License: SIP
9
9
  Platform: X11
10
10
  Platform: macOS
11
11
  Platform: Windows
12
- Requires-Python: >=3.7
12
+ Requires-Python: >=3.8
13
13
  License-File: LICENSE
14
- License-File: LICENSE-GPL3
15
- License-File: LICENSE-GPL2
16
14
 
17
15
  sip Extension Module
18
16
  ====================
19
17
 
20
18
  The sip extension module provides support for the PyQt6
21
19
  package.
22
-
23
-
@@ -1,23 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQt6-sip
3
- Version: 13.5.2
3
+ Version: 13.8.0
4
4
  Summary: The sip module support for PyQt6
5
- Home-page: https://www.riverbankcomputing.com/software/sip/
6
- Author: Riverbank Computing Limited
7
- Author-email: info@riverbankcomputing.com
5
+ Home-page: https://github.com/Python-SIP/sip
6
+ Author: Phil Thompson
7
+ Author-email: phil@riverbankcomputing.com
8
8
  License: SIP
9
9
  Platform: X11
10
10
  Platform: macOS
11
11
  Platform: Windows
12
- Requires-Python: >=3.7
12
+ Requires-Python: >=3.8
13
13
  License-File: LICENSE
14
- License-File: LICENSE-GPL3
15
- License-File: LICENSE-GPL2
16
14
 
17
15
  sip Extension Module
18
16
  ====================
19
17
 
20
18
  The sip extension module provides support for the PyQt6
21
19
  package.
22
-
23
-
@@ -1,6 +1,4 @@
1
1
  LICENSE
2
- LICENSE-GPL2
3
- LICENSE-GPL3
4
2
  MANIFEST.in
5
3
  README
6
4
  pyproject.toml
@@ -9,7 +7,6 @@ setup.py
9
7
  sip.h
10
8
  sip_array.c
11
9
  sip_array.h
12
- sip_bool.cpp
13
10
  sip_core.c
14
11
  sip_core.h
15
12
  sip_descriptors.c
@@ -1,9 +1,9 @@
1
1
  [metadata]
2
2
  description = The sip module support for PyQt6
3
3
  long_description = file: README
4
- author = Riverbank Computing Limited
5
- author_email = info@riverbankcomputing.com
6
- url = https://www.riverbankcomputing.com/software/sip/
4
+ author = Phil Thompson
5
+ author_email = phil@riverbankcomputing.com
6
+ url = https://github.com/Python-SIP/sip
7
7
  platforms = X11, macOS, Windows
8
8
 
9
9
  [egg_info]
@@ -0,0 +1,23 @@
1
+ # SPDX-License-Identifier: BSD-2-Clause
2
+
3
+ # Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
4
+
5
+
6
+ import glob
7
+
8
+ from setuptools import Extension, setup
9
+
10
+
11
+ # Build the extension module.
12
+ module_src = sorted(glob.glob('*.c'))
13
+
14
+ module = Extension('PyQt6.sip', module_src)
15
+
16
+ # Do the setup.
17
+ setup(
18
+ name='PyQt6_sip',
19
+ version='13.8.0',
20
+ license='SIP',
21
+ python_requires='>=3.8',
22
+ ext_modules=[module]
23
+ )
@@ -1,19 +1,9 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * The SIP module interface.
3
5
  *
4
- * Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
@@ -24,8 +14,8 @@
24
14
  #include <Python.h>
25
15
 
26
16
  /* Sanity check on the Python version. */
27
- #if PY_VERSION_HEX < 0x03070000
28
- #error "This version of PyQt6.sip requires Python v3.7 or later"
17
+ #if PY_VERSION_HEX < 0x03080000
18
+ #error "This version of PyQt6.sip requires Python v3.8 or later"
29
19
  #endif
30
20
 
31
21
 
@@ -45,13 +35,26 @@ extern "C" {
45
35
 
46
36
  /* The version of the ABI. */
47
37
  #define SIP_ABI_MAJOR_VERSION 13
48
- #define SIP_ABI_MINOR_VERSION 5
49
- #define SIP_MODULE_PATCH_VERSION 2
38
+ #define SIP_ABI_MINOR_VERSION 8
39
+ #define SIP_MODULE_PATCH_VERSION 0
50
40
 
51
41
 
52
42
  /*
53
43
  * The change history of the ABI.
54
44
  *
45
+ * v13.8
46
+ * - Added the 'I' conversion character to the argument and result parsers.
47
+ *
48
+ * v13.7
49
+ * - Added support for Python v3.13.
50
+ * - Python v3.8 or later is required.
51
+ * - C99 support is assumed.
52
+ *
53
+ * v13.6
54
+ * - Added support for Python v3.12.
55
+ * - Added sipPyTypeDictRef().
56
+ * - Deprecated sipPyTypeDict().
57
+ *
55
58
  * v13.5
56
59
  * - Added the '#' conversion character to the argument parsers.
57
60
  *
@@ -74,8 +77,8 @@ extern "C" {
74
77
 
75
78
 
76
79
  /* The version of the code generator. */
77
- #define SIP_VERSION 0x6070a
78
- #define SIP_VERSION_STR "6.7.10"
80
+ #define SIP_VERSION 0x60806
81
+ #define SIP_VERSION_STR "6.8.6"
79
82
 
80
83
  /* These are all dependent on the user-specified name of the sip module. */
81
84
  #define _SIP_MODULE_FQ_NAME "PyQt6.sip"
@@ -1353,7 +1356,7 @@ typedef struct _sipAPIDef {
1353
1356
  void (*api_visit_wrappers)(sipWrapperVisitorFunc visitor, void *closure);
1354
1357
  int (*api_register_exit_notifier)(PyMethodDef *md);
1355
1358
  int (*api_is_enum_flag)(PyObject *o);
1356
- void (*unused_public_1)(void);
1359
+ PyObject *(*api_py_type_dict_ref)(PyTypeObject *);
1357
1360
  void (*unused_public_2)(void);
1358
1361
  void (*unused_public_3)(void);
1359
1362
  void (*unused_public_4)(void);
@@ -1,22 +1,13 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * This file implements the API for the array type.
3
5
  *
4
- * Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
10
+ /* Remove when Python v3.12 is no longer supported. */
20
11
  #define PY_SSIZE_T_CLEAN
21
12
  #include <Python.h>
22
13
 
@@ -320,7 +311,8 @@ static int sipArray_getbuffer(PyObject *self, Py_buffer *view, int flags)
320
311
 
321
312
  view->format = NULL;
322
313
  if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT)
323
- view->format = format;
314
+ /* Note that the need for a cast is probably a Python bug. */
315
+ view->format = (char *)format;
324
316
 
325
317
  view->ndim = 1;
326
318
 
@@ -384,7 +376,11 @@ static PyObject *sipArray_repr(PyObject *self)
384
376
  */
385
377
  static PyObject *sipArray_new(PyTypeObject *cls, PyObject *args, PyObject *kw)
386
378
  {
379
+ #if PY_VERSION_HEX >= 0x030d0000
380
+ static char * const kwlist[] = {"", "", NULL};
381
+ #else
387
382
  static char *kwlist[] = {"", "", NULL};
383
+ #endif
388
384
 
389
385
  Py_ssize_t length;
390
386
  PyObject *array, *type;
@@ -483,9 +479,7 @@ PyTypeObject sipArray_Type = {
483
479
  0, /* tp_del */
484
480
  0, /* tp_version_tag */
485
481
  0, /* tp_finalize */
486
- #if PY_VERSION_HEX >= 0x03080000
487
482
  0, /* tp_vectorcall */
488
- #endif
489
483
  };
490
484
 
491
485
 
@@ -1,19 +1,9 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * This file defines the API for the array type.
3
5
  *
4
- * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
@@ -21,6 +11,7 @@
21
11
  #define _SIP_ARRAY_H
22
12
 
23
13
 
14
+ /* Remove when Python v3.12 is no longer supported. */
24
15
  #define PY_SSIZE_T_CLEAN
25
16
  #include <Python.h>
26
17
 
@@ -1,22 +1,13 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * The core sip module code.
3
5
  *
4
- * Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
10
+ /* Remove when Python v3.12 is no longer supported. */
20
11
  #define PY_SSIZE_T_CLEAN
21
12
  #include <Python.h>
22
13
  #include <datetime.h>
@@ -34,12 +25,6 @@
34
25
  #include "sip_core.h"
35
26
 
36
27
 
37
- /* There doesn't seem to be a standard way of checking for C99 support. */
38
- #if !defined(va_copy)
39
- #define va_copy(d, s) ((d) = (s))
40
- #endif
41
-
42
-
43
28
  /*
44
29
  * The Python metatype for a C++ wrapper type. We inherit everything from the
45
30
  * standard Python metatype except the init and getattro methods and the size
@@ -103,9 +88,7 @@ PyTypeObject sipWrapperType_Type = {
103
88
  0, /* tp_del */
104
89
  0, /* tp_version_tag */
105
90
  0, /* tp_finalize */
106
- #if PY_VERSION_HEX >= 0x03080000
107
91
  0, /* tp_vectorcall */
108
- #endif
109
92
  };
110
93
 
111
94
 
@@ -171,9 +154,7 @@ static sipWrapperType sipWrapper_Type = {
171
154
  0, /* tp_del */
172
155
  0, /* tp_version_tag */
173
156
  0, /* tp_finalize */
174
- #if PY_VERSION_HEX >= 0x03080000
175
157
  0, /* tp_vectorcall */
176
- #endif
177
158
  },
178
159
  {
179
160
  0, /* am_await */
@@ -376,6 +357,7 @@ static PyInterpreterState *sip_api_get_interpreter(void);
376
357
  static void sip_api_set_type_user_data(sipWrapperType *wt, void *data);
377
358
  static void *sip_api_get_type_user_data(const sipWrapperType *wt);
378
359
  static PyObject *sip_api_py_type_dict(const PyTypeObject *py_type);
360
+ static PyObject *sip_api_py_type_dict_ref(PyTypeObject *py_type);
379
361
  static const char *sip_api_py_type_name(const PyTypeObject *py_type);
380
362
  static int sip_api_get_method(PyObject *obj, sipMethodDef *method);
381
363
  static PyObject *sip_api_from_method(const sipMethodDef *method);
@@ -517,7 +499,7 @@ static const sipAPIDef sip_api = {
517
499
  sip_api_visit_wrappers,
518
500
  sip_api_register_exit_notifier,
519
501
  sip_api_is_enum_flag,
520
- NULL,
502
+ sip_api_py_type_dict_ref,
521
503
  NULL,
522
504
  NULL,
523
505
  NULL,
@@ -892,10 +874,6 @@ const sipAPIDef *sip_init_library(PyObject *mod_dict)
892
874
  PyObject *obj;
893
875
  PyMethodDef *md;
894
876
 
895
- #if PY_VERSION_HEX < 0x03070000 && defined(WITH_THREAD)
896
- PyEval_InitThreads();
897
- #endif
898
-
899
877
  if (sip_enum_init() < 0)
900
878
  return NULL;
901
879
 
@@ -2320,7 +2298,7 @@ static PyObject *buildObject(PyObject *obj, const char *fmt, va_list va)
2320
2298
  break;
2321
2299
 
2322
2300
  case '=':
2323
- el = PyLong_FromUnsignedLong(va_arg(va, size_t));
2301
+ el = PyLong_FromSize_t(va_arg(va, size_t));
2324
2302
  break;
2325
2303
 
2326
2304
  case 'N':
@@ -2694,6 +2672,19 @@ static int parseResult(PyObject *method, PyObject *res,
2694
2672
 
2695
2673
  break;
2696
2674
 
2675
+ case 'I':
2676
+ {
2677
+ char *p = va_arg(va, char *);
2678
+ char v = sip_api_long_as_char(arg);
2679
+
2680
+ if (PyErr_Occurred())
2681
+ invalid = TRUE;
2682
+ else if (p != NULL)
2683
+ *p = v;
2684
+ }
2685
+
2686
+ break;
2687
+
2697
2688
  case 'L':
2698
2689
  {
2699
2690
  signed char *p = va_arg(va, signed char *);
@@ -4321,9 +4312,28 @@ static int parsePass1(PyObject **parseErrp, PyObject **selfp, int *selfargp,
4321
4312
  break;
4322
4313
  }
4323
4314
 
4315
+ case 'I':
4316
+ {
4317
+ /* Char as an integer. */
4318
+
4319
+ char *p = va_arg(va, char *);
4320
+
4321
+ if (arg != NULL)
4322
+ {
4323
+ char v = sip_api_long_as_char(arg);
4324
+
4325
+ if (PyErr_Occurred())
4326
+ handle_failed_int_conversion(&failure, arg);
4327
+ else
4328
+ *p = v;
4329
+ }
4330
+
4331
+ break;
4332
+ }
4333
+
4324
4334
  case 'L':
4325
4335
  {
4326
- /* Signed char. */
4336
+ /* Signed char as an integer. */
4327
4337
 
4328
4338
  signed char *p = va_arg(va, signed char *);
4329
4339
 
@@ -4342,7 +4352,7 @@ static int parsePass1(PyObject **parseErrp, PyObject **selfp, int *selfargp,
4342
4352
 
4343
4353
  case 'M':
4344
4354
  {
4345
- /* Unsigned char. */
4355
+ /* Unsigned char as an integer. */
4346
4356
 
4347
4357
  unsigned char *p = va_arg(va, unsigned char *);
4348
4358
 
@@ -4942,6 +4952,8 @@ static int parsePass2(PyObject *self, int selfarg, PyObject *sipArgs,
4942
4952
 
4943
4953
  if (flags & FMT_AP_TRANSFER_THIS)
4944
4954
  owner = va_arg(va, PyObject **);
4955
+ else
4956
+ owner = NULL;
4945
4957
 
4946
4958
  if (flags & FMT_AP_NO_CONVERTORS)
4947
4959
  {
@@ -4968,7 +4980,7 @@ static int parsePass2(PyObject *self, int selfarg, PyObject *sipArgs,
4968
4980
  if (iserr)
4969
4981
  return FALSE;
4970
4982
 
4971
- if (flags & FMT_AP_TRANSFER_THIS && *p != NULL)
4983
+ if (owner != NULL && *p != NULL)
4972
4984
  *owner = arg;
4973
4985
  }
4974
4986
 
@@ -9502,6 +9514,10 @@ static PyObject *slot_richcompare(PyObject *self, PyObject *arg, int op)
9502
9514
  case Py_GE:
9503
9515
  st = ge_slot;
9504
9516
  break;
9517
+
9518
+ default:
9519
+ /* Suppress a compiler warning. */
9520
+ st = -1;
9505
9521
  }
9506
9522
 
9507
9523
  /* It might not exist if not all the above have been implemented. */
@@ -9631,9 +9647,7 @@ sipWrapperType sipSimpleWrapper_Type = {
9631
9647
  0, /* tp_del */
9632
9648
  0, /* tp_version_tag */
9633
9649
  0, /* tp_finalize */
9634
- #if PY_VERSION_HEX >= 0x03080000
9635
9650
  0, /* tp_vectorcall */
9636
- #endif
9637
9651
  },
9638
9652
  {
9639
9653
  0, /* am_await */
@@ -11125,14 +11139,33 @@ static void *sip_api_get_type_user_data(const sipWrapperType *wt)
11125
11139
 
11126
11140
 
11127
11141
  /*
11128
- * Get the dict of a Python type (on behalf of the limited API).
11142
+ * Get a borrowed reference to the dict of a Python type (on behalf of the
11143
+ * limited API). This is deprecated in ABI v13.6 and must not be used with
11144
+ * Python v3.12 and later.
11129
11145
  */
11130
11146
  static PyObject *sip_api_py_type_dict(const PyTypeObject *py_type)
11147
+ {
11148
+ PyErr_WarnEx(PyExc_DeprecationWarning,
11149
+ "sipPyTypeDict() is deprecated, the extension module should use "
11150
+ "sipPyTypeDictRef() instead",
11151
+ 1);
11152
+
11153
+ return py_type->tp_dict;
11154
+ }
11155
+
11156
+
11157
+ /*
11158
+ * Get a new reference to the dict of a Python type (on behalf of the limited
11159
+ * API).
11160
+ */
11161
+ static PyObject *sip_api_py_type_dict_ref(PyTypeObject *py_type)
11131
11162
  {
11132
11163
  #if PY_VERSION_HEX >= 0x030c0000
11133
11164
  return PyType_GetDict(py_type);
11134
11165
  #else
11135
- return py_type->tp_dict;
11166
+ PyObject *ref = py_type->tp_dict;
11167
+ Py_XINCREF(ref);
11168
+ return ref;
11136
11169
  #endif
11137
11170
  }
11138
11171
 
@@ -11803,22 +11836,18 @@ PyObject *sip_get_qualname(const sipTypeDef *td, PyObject *name)
11803
11836
 
11804
11837
 
11805
11838
  /*
11806
- * Implement PySlice_GetIndicesEx() (or its subsequent replacement).
11839
+ * Unpack a slice object.
11807
11840
  */
11808
11841
  int sip_api_convert_from_slice_object(PyObject *slice, Py_ssize_t length,
11809
11842
  Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
11810
11843
  Py_ssize_t *slicelength)
11811
11844
  {
11812
- #if PY_VERSION_HEX >= 0x03070000
11813
11845
  if (PySlice_Unpack(slice, start, stop, step) < 0)
11814
11846
  return -1;
11815
11847
 
11816
11848
  *slicelength = PySlice_AdjustIndices(length, start, stop, *step);
11817
11849
 
11818
11850
  return 0;
11819
- #else
11820
- return PySlice_GetIndicesEx(slice, length, start, stop, step, slicelength);
11821
- #endif
11822
11851
  }
11823
11852
 
11824
11853
 
@@ -1,19 +1,9 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * This file defines the core sip module internal interfaces.
3
5
  *
4
- * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
@@ -21,9 +11,13 @@
21
11
  #define _SIP_CORE_H
22
12
 
23
13
 
14
+ /* Remove when Python v3.12 is no longer supported. */
24
15
  #define PY_SSIZE_T_CLEAN
25
16
  #include <Python.h>
26
17
 
18
+ #include <stdbool.h>
19
+ #include <stdint.h>
20
+
27
21
  #include "sip.h"
28
22
 
29
23
 
@@ -55,9 +49,9 @@ typedef struct
55
49
  typedef struct
56
50
  {
57
51
  int primeIdx; /* Index into table sizes. */
58
- unsigned long size; /* Size of hash table. */
59
- unsigned long unused; /* Nr. unused in hash table. */
60
- unsigned long stale; /* Nr. stale in hash table. */
52
+ uintptr_t size; /* Size of hash table. */
53
+ uintptr_t unused; /* Nr. unused in hash table. */
54
+ uintptr_t stale; /* Nr. stale in hash table. */
61
55
  sipHashEntry *hash_array; /* Current hash table. */
62
56
  } sipObjectMap;
63
57
 
@@ -153,9 +147,7 @@ sipSimpleWrapper *sipOMFindObject(sipObjectMap *om, void *key,
153
147
  void sipOMAddObject(sipObjectMap *om, sipSimpleWrapper *val);
154
148
  int sipOMRemoveObject(sipObjectMap *om, sipSimpleWrapper *val);
155
149
 
156
- #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
157
150
  #define sip_set_bool(p, v) (*(_Bool *)(p) = (v))
158
- #endif
159
151
 
160
152
 
161
153
  #ifdef __cplusplus
@@ -1,22 +1,13 @@
1
+ /* SPDX-License-Identifier: BSD-2-Clause */
2
+
1
3
  /*
2
4
  * The implementation of the different descriptors.
3
5
  *
4
- * Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
5
- *
6
- * This file is part of SIP.
7
- *
8
- * This copy of SIP is licensed for use under the terms of the SIP License
9
- * Agreement. See the file LICENSE for more details.
10
- *
11
- * This copy of SIP may also used under the terms of the GNU General Public
12
- * License v2 or v3 as published by the Free Software Foundation which can be
13
- * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14
- *
15
- * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
+ * Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
17
7
  */
18
8
 
19
9
 
10
+ /* Remove when Python v3.12 is no longer supported. */
20
11
  #define PY_SSIZE_T_CLEAN
21
12
  #include <Python.h>
22
13
 
@@ -105,9 +96,7 @@ PyTypeObject sipMethodDescr_Type = {
105
96
  0, /* tp_del */
106
97
  0, /* tp_version_tag */
107
98
  0, /* tp_finalize */
108
- #if PY_VERSION_HEX >= 0x03080000
109
99
  0, /* tp_vectorcall */
110
- #endif
111
100
  };
112
101
 
113
102
 
@@ -325,9 +314,7 @@ PyTypeObject sipVariableDescr_Type = {
325
314
  0, /* tp_del */
326
315
  0, /* tp_version_tag */
327
316
  0, /* tp_finalize */
328
- #if PY_VERSION_HEX >= 0x03080000
329
317
  0, /* tp_vectorcall */
330
- #endif
331
318
  };
332
319
 
333
320