Skip to content

[Dy2St] Fix jupyter error message display errors #67893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Aug 31, 2024

PR Category

User Experience

PR Types

Bug fixes

Description

修复在 jupyter 下报错异常的问题

Copy link

paddle-bot bot commented Aug 31, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Aug 31, 2024
@@ -120,7 +120,9 @@ def __init__(self, location, function_name):
hint_msg = '~' * len(self.source_code[-1]) + ' <--- HERE'
self.source_code.append(hint_msg)
blank_count.append(blank_count[-1])
linecache.clearcache()
# Note: It is not possible to modify the contents of the file in the meantime, so there is no need to clear the cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Note: It is not possible to modify the contents of the file in the meantime, so there is no need to clear the cache
# NOTE(gouzil): It is not possible to modify the contents of the file in the meantime, so there is no need to clear the cache

这个 note,说明下 jupyter 下的问题吧,在 note 里说明不能用 linecache.clearcache 即可,下面的注释行删掉

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo SigureMo merged commit 80de9ed into PaddlePaddle:develop Sep 3, 2024
28 of 29 checks passed
@SigureMo
Copy link
Member

SigureMo commented Sep 3, 2024

@megemini 这个 PR 解决了之前说的 https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/paddle_v3_features/sot_cn.html#id2 报错不一样的问题,本质上是 ipython 的问题,jupyter 同样可以复现

@gouzil PR 描述应该写清楚些,不然其他人看不懂,后面其他人翻看 PR 也无法了解当初的动机和具体解决的问题

@gouzil gouzil deleted the sot/fix_error_TraceBackFrameRange branch November 22, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants