Skip to content

Conversation

@srinivasreddy
Copy link
Contributor

@srinivasreddy srinivasreddy commented Feb 3, 2025

@srinivasreddy srinivasreddy marked this pull request as ready for review February 3, 2025 13:53
@srinivasreddy srinivasreddy changed the title Fix crashing pyrepl when NameError occurres in __getattr__ method gh-129605: Fix crashing pyrepl when NameError occurres in __getattr__ method Feb 3, 2025
Lib/traceback.py Outdated
self = frame.f_locals['self']
if hasattr(self, wrong_name):
return f"self.{wrong_name}"
if frame.f_code.co_name != '__getattr__':
Copy link
Member

Choose a reason for hiding this comment

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

This also happens with __getattribute__.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed 05a9858

Copy link
Contributor

@skirpichev skirpichev left a comment

Choose a reason for hiding this comment

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

LGTM

But see the issue thread, maybe there should be a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants