mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
[mlir][python] fix PyThreadState_GetFrame (#153325)
`PyThreadState_GetFrame` wasn't added until 3.9 (fixes currently failing rocm builder)
This commit is contained in:
@@ -2786,6 +2786,14 @@ private:
|
||||
PyOperationRef operation;
|
||||
};
|
||||
|
||||
// bpo-40429 added PyThreadState_GetFrame() to Python 3.9.0b1
|
||||
#if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION)
|
||||
static inline PyFrameObject *PyThreadState_GetFrame(PyThreadState *tstate) {
|
||||
assert(tstate != _Py_NULL);
|
||||
return _Py_CAST(PyFrameObject *, Py_XNewRef(tstate->frame));
|
||||
}
|
||||
#endif
|
||||
|
||||
MlirLocation tracebackToLocation(MlirContext ctx) {
|
||||
size_t framesLimit =
|
||||
PyGlobals::get().getTracebackLoc().locTracebackFramesLimit();
|
||||
|
||||
Reference in New Issue
Block a user