Skip to content

Commit

Permalink
[XLA:Python] Remove code to support Python 3.9.
Browse files Browse the repository at this point in the history
JAX has dropped support for Python 3.9.

PiperOrigin-RevId: 647327674
  • Loading branch information
hawkinsp authored and copybara-github committed Jun 27, 2024
1 parent 6ed5402 commit da7a0b3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions xla/python/pmap_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,8 @@ void JaxPmapFunction_tp_dealloc(PyObject* self) {

int JaxPmapFunction_tp_traverse(PyObject* self, visitproc visit, void* arg) {
JaxPmapFunctionObject* o = reinterpret_cast<JaxPmapFunctionObject*>(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());
Expand Down
4 changes: 0 additions & 4 deletions xla/python/traceback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit da7a0b3

Please sign in to comment.