|
17 | 17 | #include "atof.h" |
18 | 18 |
|
19 | 19 | /* Python version checks */ |
20 | | -#define PY310_PLUS (PY_VERSION_HEX >= 0x030a0000) |
21 | 20 | #define PY311_PLUS (PY_VERSION_HEX >= 0x030b0000) |
22 | 21 | #define PY312_PLUS (PY_VERSION_HEX >= 0x030c0000) |
23 | 22 | #define PY313_PLUS (PY_VERSION_HEX >= 0x030d0000) |
@@ -511,9 +510,7 @@ typedef struct { |
511 | 510 | PyObject *get_typeddict_info; |
512 | 511 | PyObject *get_dataclass_info; |
513 | 512 | PyObject *rebuild; |
514 | | -#if PY310_PLUS |
515 | 513 | PyObject *types_uniontype; |
516 | | -#endif |
517 | 514 | #if PY312_PLUS |
518 | 515 | PyObject *typing_typealiastype; |
519 | 516 | #endif |
@@ -4899,15 +4896,13 @@ typenode_origin_args_metadata( |
4899 | 4896 | } |
4900 | 4897 | } |
4901 | 4898 |
|
4902 | | - #if PY310_PLUS |
4903 | 4899 | if (Py_TYPE(t) == (PyTypeObject *)(state->mod->types_uniontype)) { |
4904 | 4900 | /* Handle types.UnionType unions (`int | float | ...`) */ |
4905 | 4901 | args = PyObject_GetAttr(t, state->mod->str___args__); |
4906 | 4902 | if (args == NULL) goto error; |
4907 | 4903 | origin = state->mod->typing_union; |
4908 | 4904 | Py_INCREF(origin); |
4909 | 4905 | } |
4910 | | - #endif |
4911 | 4906 |
|
4912 | 4907 | *out_origin = origin; |
4913 | 4908 | *out_args = args; |
@@ -10500,15 +10495,8 @@ ms_encode_err_type_unsupported(PyTypeObject *type) { |
10500 | 10495 | *************************************************************************/ |
10501 | 10496 |
|
10502 | 10497 | #define MS_HAS_TZINFO(o) (((_PyDateTime_BaseTZInfo *)(o))->hastzinfo) |
10503 | | -#if PY310_PLUS |
10504 | 10498 | #define MS_DATE_GET_TZINFO(o) PyDateTime_DATE_GET_TZINFO(o) |
10505 | 10499 | #define MS_TIME_GET_TZINFO(o) PyDateTime_TIME_GET_TZINFO(o) |
10506 | | -#else |
10507 | | -#define MS_DATE_GET_TZINFO(o) (MS_HAS_TZINFO(o) ? \ |
10508 | | - ((PyDateTime_DateTime *)(o))->tzinfo : Py_None) |
10509 | | -#define MS_TIME_GET_TZINFO(o) (MS_HAS_TZINFO(o) ? \ |
10510 | | - ((PyDateTime_Time *)(o))->tzinfo : Py_None) |
10511 | | -#endif |
10512 | 10500 |
|
10513 | 10501 | #ifndef Py_GIL_DISABLED |
10514 | 10502 | #ifndef TIMEZONE_CACHE_SIZE |
@@ -22298,9 +22286,7 @@ msgspec_clear(PyObject *m) |
22298 | 22286 | Py_CLEAR(st->get_typeddict_info); |
22299 | 22287 | Py_CLEAR(st->get_dataclass_info); |
22300 | 22288 | Py_CLEAR(st->rebuild); |
22301 | | -#if PY310_PLUS |
22302 | 22289 | Py_CLEAR(st->types_uniontype); |
22303 | | -#endif |
22304 | 22290 | #if PY312_PLUS |
22305 | 22291 | Py_CLEAR(st->typing_typealiastype); |
22306 | 22292 | #endif |
@@ -22372,9 +22358,7 @@ msgspec_traverse(PyObject *m, visitproc visit, void *arg) |
22372 | 22358 | Py_VISIT(st->get_typeddict_info); |
22373 | 22359 | Py_VISIT(st->get_dataclass_info); |
22374 | 22360 | Py_VISIT(st->rebuild); |
22375 | | -#if PY310_PLUS |
22376 | 22361 | Py_VISIT(st->types_uniontype); |
22377 | | -#endif |
22378 | 22362 | #if PY312_PLUS |
22379 | 22363 | Py_VISIT(st->typing_typealiastype); |
22380 | 22364 | #endif |
@@ -22594,12 +22578,10 @@ PyInit__core(void) |
22594 | 22578 | SET_REF(rebuild, "rebuild"); |
22595 | 22579 | Py_DECREF(temp_module); |
22596 | 22580 |
|
22597 | | -#if PY310_PLUS |
22598 | 22581 | temp_module = PyImport_ImportModule("types"); |
22599 | 22582 | if (temp_module == NULL) return NULL; |
22600 | 22583 | SET_REF(types_uniontype, "UnionType"); |
22601 | 22584 | Py_DECREF(temp_module); |
22602 | | -#endif |
22603 | 22585 |
|
22604 | 22586 | /* Get the EnumMeta type */ |
22605 | 22587 | temp_module = PyImport_ImportModule("enum"); |
|
0 commit comments