summaryrefslogtreecommitdiff
path: root/mlir/lib/Bindings/Python/MainModule.cpp
diff options
context:
space:
mode:
authorAiden Grossman <aidengrossman@google.com>2025-09-12 01:05:48 +0000
committerAiden Grossman <aidengrossman@google.com>2025-09-12 01:05:48 +0000
commit88a52e1fc6d3e153132f0e0a86431762adf8c0c4 (patch)
treebae8c1b720736edc54705c325c5bfb95b459eda2 /mlir/lib/Bindings/Python/MainModule.cpp
parent1873dd7e8bb03319500a9f4b51e9e498a8fb70de (diff)
parent2740e4b73682eb7a6869c333991a608304938952 (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/boomanaiden154/main.clang-invoke-shell-script-with-bash
Created using spr 1.3.6 [skip ci]
Diffstat (limited to 'mlir/lib/Bindings/Python/MainModule.cpp')
-rw-r--r--mlir/lib/Bindings/Python/MainModule.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/mlir/lib/Bindings/Python/MainModule.cpp b/mlir/lib/Bindings/Python/MainModule.cpp
index d7282b3d6f71..a14f09f77d2c 100644
--- a/mlir/lib/Bindings/Python/MainModule.cpp
+++ b/mlir/lib/Bindings/Python/MainModule.cpp
@@ -52,9 +52,14 @@ NB_MODULE(_mlir, m) {
[](PyGlobals &self, bool enabled) {
self.getTracebackLoc().setLocTracebacksEnabled(enabled);
})
+ .def("loc_tracebacks_frame_limit",
+ [](PyGlobals &self) {
+ return self.getTracebackLoc().locTracebackFramesLimit();
+ })
.def("set_loc_tracebacks_frame_limit",
- [](PyGlobals &self, int n) {
- self.getTracebackLoc().setLocTracebackFramesLimit(n);
+ [](PyGlobals &self, std::optional<int> n) {
+ self.getTracebackLoc().setLocTracebackFramesLimit(
+ n.value_or(PyGlobals::TracebackLoc::kMaxFrames));
})
.def("register_traceback_file_inclusion",
[](PyGlobals &self, const std::string &filename) {