From 4e83cab061b88ca620c86e27374a73b33fc4ce0e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 26 Aug 2023 15:44:54 +0200 Subject: [PATCH] Proper Python stack trace in debugger for Python 3.10 --- src/pya/pya/pya.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 44f31d88a..2666e0e5f 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -109,13 +109,13 @@ public: { while (frame != NULL) { -#if PY_VERSION_HEX >= 0x030B0000 +#if PY_VERSION_HEX >= 0x030A0000 int line = PyFrame_GetLineNumber(frame); #else int line = frame->f_lineno; #endif std::string fn; -#if PY_VERSION_HEX >= 0x030B0000 +#if PY_VERSION_HEX >= 0x030A0000 if (test_type (PyFrame_GetCode(frame)->co_filename, true)) { fn = normalize_path (python2c (PyFrame_GetCode(frame)->co_filename)); #else @@ -125,7 +125,7 @@ public: } m_stack_trace.push_back (tl::BacktraceElement (fn, line)); -#if PY_VERSION_HEX >= 0x030B0000 +#if PY_VERSION_HEX >= 0x030A0000 frame = PyFrame_GetBack(frame); #else frame = frame->f_back;