diff --git a/275e88f44b.patch b/275e88f44b.patch deleted file mode 100644 index 67dd886..0000000 --- a/275e88f44b.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 275e88f44beba579174e07980cc3a887bfd1ef3d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Fri, 24 Nov 2023 13:47:03 +0100 -Subject: [PATCH] time.clock_gettime and clock_gettime_ns are METH_O in Python - 3.13.0a2+ - -See https://github.com/python/cpython/commit/4fe22c73770 - -Fixes https://github.com/adamchainz/time-machine/issues/408 ---- - src/_time_machine.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/src/_time_machine.c b/src/_time_machine.c -index d55ac54..5646a6c 100644 ---- a/src/_time_machine.c -+++ b/src/_time_machine.c -@@ -108,7 +108,11 @@ _time_machine_clock_gettime(PyObject *self, PyObject *args) - PyObject *time_machine_module = PyImport_ImportModule("time_machine"); - PyObject *time_machine_clock_gettime = PyObject_GetAttrString(time_machine_module, "clock_gettime"); - -+#if PY_VERSION_HEX >= 0x030d00a2 -+ PyObject* result = PyObject_CallOneArg(time_machine_clock_gettime, args); -+#else - PyObject* result = PyObject_CallObject(time_machine_clock_gettime, args); -+#endif - - Py_DECREF(time_machine_clock_gettime); - Py_DECREF(time_machine_module); -@@ -142,7 +146,11 @@ _time_machine_clock_gettime_ns(PyObject *self, PyObject *args) - PyObject *time_machine_module = PyImport_ImportModule("time_machine"); - PyObject *time_machine_clock_gettime_ns = PyObject_GetAttrString(time_machine_module, "clock_gettime_ns"); - -+#if PY_VERSION_HEX >= 0x030d00a2 -+ PyObject* result = PyObject_CallOneArg(time_machine_clock_gettime_ns, args); -+#else - PyObject* result = PyObject_CallObject(time_machine_clock_gettime_ns, args); -+#endif - - Py_DECREF(time_machine_clock_gettime_ns); - Py_DECREF(time_machine_module); -@@ -478,8 +486,13 @@ PyDoc_STRVAR(module_doc, "_time_machine module"); - static PyMethodDef module_functions[] = { - {"original_now", (PyCFunction)_time_machine_original_now, METH_FASTCALL|METH_KEYWORDS, original_now_doc}, - {"original_utcnow", (PyCFunction)_time_machine_original_utcnow, METH_NOARGS, original_utcnow_doc}, -+#if PY_VERSION_HEX >= 0x030d00a2 -+ {"original_clock_gettime", (PyCFunction)_time_machine_original_clock_gettime, METH_O, original_clock_gettime_doc}, -+ {"original_clock_gettime_ns", (PyCFunction)_time_machine_original_clock_gettime_ns, METH_O, original_clock_gettime_ns_doc}, -+#else - {"original_clock_gettime", (PyCFunction)_time_machine_original_clock_gettime, METH_VARARGS, original_clock_gettime_doc}, - {"original_clock_gettime_ns", (PyCFunction)_time_machine_original_clock_gettime_ns, METH_VARARGS, original_clock_gettime_ns_doc}, -+#endif - {"original_gmtime", (PyCFunction)_time_machine_original_gmtime, METH_VARARGS, original_gmtime_doc}, - {"original_localtime", (PyCFunction)_time_machine_original_localtime, METH_VARARGS, original_localtime_doc}, - {"original_monotonic", (PyCFunction)_time_machine_original_monotonic, METH_NOARGS, original_monotonic_doc}, diff --git a/python-time-machine.spec b/python-time-machine.spec index 4d4bf73..73db590 100644 --- a/python-time-machine.spec +++ b/python-time-machine.spec @@ -1,15 +1,11 @@ Name: python-time-machine -Version: 2.13.0 +Version: 2.14.1 Release: %autorelease Summary: Travel through time in your Python tests License: MIT URL: https://github.com/adamchainz/time-machine Source: %{url}/archive/%{version}/time-machine-%{version}.tar.gz -# time.clock_gettime and clock_gettime_ns are METH_O in Python 3.13.0a2+ -# From https://github.com/adamchainz/time-machine/pull/409 -Patch: %{url}/commit/275e88f44b.patch - BuildRequires: gcc BuildRequires: python3-devel diff --git a/sources b/sources index ff9bb09..ce8af48 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (time-machine-2.13.0.tar.gz) = 26a852d93633e037585ec8fcd563c86af8d977a87633dbeb66cf23c9ca49ca0ae536bdcdcdf809ee2ab423c197610c630d506bc3bf4f13c373d806cee2d8c598 +SHA512 (time-machine-2.14.1.tar.gz) = 42a127e2dc5a86e33896010e6d141fc9248fe685d3477ec71ec8a72315914cea99ae4a4d6623a59fd69505d935d2feadcfd831a7fff5617c3f98a93d48652ecf