File tree Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -2786,32 +2786,12 @@ class PyOpAttributeMap {
2786
2786
PyOperationRef operation;
2787
2787
};
2788
2788
2789
- // copied/borrow from
2790
- // https://github.com/python/pythoncapi-compat/blob/b541b98df1e3e5aabb5def27422a75c876f5a88a/pythoncapi_compat.h#L222
2791
- // bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1
2792
- #if PY_VERSION_HEX < 0x030b00b1 && !defined(PYPY_VERSION)
2793
- int PyFrame_GetLasti (PyFrameObject *frame) {
2794
- #if PY_VERSION_HEX >= 0x030a00a7
2795
- // bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset,
2796
- // not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes)
2797
- // instructions.
2798
- if (frame->f_lasti < 0 ) {
2799
- return -1 ;
2800
- }
2801
- return frame->f_lasti * 2 ;
2802
- #else
2803
- return frame->f_lasti ;
2804
- #endif
2805
- }
2806
- #endif
2807
-
2808
2789
constexpr size_t kMaxFrames = 512 ;
2809
2790
2810
2791
MlirLocation tracebackToLocation (MlirContext ctx) {
2811
2792
size_t framesLimit =
2812
2793
PyGlobals::get ().getTracebackLoc ().locTracebackFramesLimit ();
2813
- // We use a thread_local here mostly to avoid requiring a large amount of
2814
- // space.
2794
+ // Use a thread_local here to avoid requiring a large amount of space.
2815
2795
thread_local std::array<MlirLocation, kMaxFrames > frames;
2816
2796
size_t count = 0 ;
2817
2797
Original file line number Diff line number Diff line change 13
13
14
14
#include " Globals.h"
15
15
#include " NanobindUtils.h"
16
- #include " mlir-c/Bindings/Python/Interop.h" // This is expected after nanobind.
16
+ #include " mlir-c/Bindings/Python/Interop.h"
17
17
#include " mlir-c/Support.h"
18
18
#include " mlir/Bindings/Python/Nanobind.h"
19
19
You can’t perform that action at this time.
0 commit comments