File tree Expand file tree Collapse file tree 5 files changed +6
-27
lines changed Expand file tree Collapse file tree 5 files changed +6
-27
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
Original file line number Diff line number Diff line change @@ -375,3 +375,6 @@ def have_host_jit_feature_support(feature_name):
375
375
376
376
if config .arm_emulator_executable :
377
377
config .available_features .add ("arm-emulator" )
378
+
379
+ if sys .version_info >= (3 , 11 ):
380
+ config .available_features .add ("python-ge-311" )
Original file line number Diff line number Diff line change 1
1
# RUN: %PYTHON %s | FileCheck %s
2
-
2
+ # REQUIRES: python-ge-311
3
3
import gc
4
4
from contextlib import contextmanager
5
5
Original file line number Diff line number Diff line change @@ -2,7 +2,3 @@ config.environment["ASAN_OPTIONS"] = "detect_leaks=0"
2
2
if not config.enable_bindings_python:
3
3
config.unsupported = True
4
4
config.excludes.add(" python_test_ops.td" )
5
-
6
- import sys
7
- if sys.version_info >= (3, 11):
8
- config.available_features.add(" python-ge-311" )
You can’t perform that action at this time.
0 commit comments