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 {
27862786 PyOperationRef operation;
27872787};
27882788
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-
28082789constexpr size_t kMaxFrames = 512 ;
28092790
28102791MlirLocation tracebackToLocation (MlirContext ctx) {
28112792 size_t framesLimit =
28122793 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.
28152795 thread_local std::array<MlirLocation, kMaxFrames > frames;
28162796 size_t count = 0 ;
28172797
Original file line number Diff line number Diff line change 1313
1414#include " Globals.h"
1515#include " NanobindUtils.h"
16- #include " mlir-c/Bindings/Python/Interop.h" // This is expected after nanobind.
16+ #include " mlir-c/Bindings/Python/Interop.h"
1717#include " mlir-c/Support.h"
1818#include " mlir/Bindings/Python/Nanobind.h"
1919
Original file line number Diff line number Diff line change @@ -375,3 +375,6 @@ def have_host_jit_feature_support(feature_name):
375375
376376if config .arm_emulator_executable :
377377 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 11# RUN: %PYTHON %s | FileCheck %s
2-
2+ # REQUIRES: python-ge-311
33import gc
44from contextlib import contextmanager
55
Original file line number Diff line number Diff line change @@ -2,7 +2,3 @@ config.environment["ASAN_OPTIONS"] = "detect_leaks=0"
22if not config.enable_bindings_python:
33 config.unsupported = True
44config.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