From da7a0b3e3f2c154acb111fd9c26862e945d0ddf0 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Thu, 27 Jun 2024 08:31:12 -0700 Subject: [PATCH] [XLA:Python] Remove code to support Python 3.9. JAX has dropped support for Python 3.9. PiperOrigin-RevId: 647327674 --- xla/python/pmap_lib.cc | 2 -- xla/python/traceback.cc | 4 ---- 2 files changed, 6 deletions(-) diff --git a/xla/python/pmap_lib.cc b/xla/python/pmap_lib.cc index bb966a2b88389..acd6d548dfe26 100644 --- a/xla/python/pmap_lib.cc +++ b/xla/python/pmap_lib.cc @@ -795,10 +795,8 @@ void JaxPmapFunction_tp_dealloc(PyObject* self) { int JaxPmapFunction_tp_traverse(PyObject* self, visitproc visit, void* arg) { JaxPmapFunctionObject* o = reinterpret_cast(self); -#if PY_VERSION_HEX >= 0x03090000 // https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_traverse Py_VISIT(Py_TYPE(self)); -#endif Py_VISIT(o->dict); Py_VISIT(o->fun.fun().ptr()); Py_VISIT(o->fun.cache_miss().ptr()); diff --git a/xla/python/traceback.cc b/xla/python/traceback.cc index 6f50d6715b5d2..2bed40ec33056 100644 --- a/xla/python/traceback.cc +++ b/xla/python/traceback.cc @@ -54,11 +54,7 @@ Traceback::Traceback() { // The representation of frame->f_lasti changed from bytes to words in Python // 3.10, see https://docs.python.org/3/whatsnew/3.10.html#changes-in-the-c-api // This should match sizeof(_Py_CODEUNIT) which is unfortunately private. -#if PY_VERSION_HEX < 0x030a0000 - constexpr int kLastiWordBytes = 1; -#else // PY_VERSION_HEX < 0x030a0000 constexpr int kLastiWordBytes = 2; -#endif // PY_VERSION_HEX < 0x030a0000 for (PyFrameObject* py_frame = thread_state->frame; py_frame != nullptr; py_frame = py_frame->f_back) {