Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73237c5

Browse files
committed
Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.
1 parentd3d6f8f commit73237c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎Python/traceback.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ tb_printinternal(tb, f, limit)
243243
}
244244
while (tb!=NULL&& !PyOS_InterruptOccurred()) {
245245
if (depth <=limit) {
246-
tb->tb_lineno=PyCode_Addr2Line(tb->tb_frame->f_code,
247-
tb->tb_lasti);
246+
if (Py_OptimizeFlag)
247+
tb->tb_lineno=PyCode_Addr2Line(
248+
tb->tb_frame->f_code,tb->tb_lasti);
248249
tb_displayline(f,
249250
PyString_AsString(
250251
tb->tb_frame->f_code->co_filename),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp