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) {