Skip to content
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

Autodoc __getattribute__ fix #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jrhe
Copy link

@jrhe jrhe commented Jul 24, 2024

Autodoc calls mro on the target class triggering __getattribute__(). This could throw an exception breaking the build of documentation, such as when building the documentation for transformers on Mac OS: transformers/issues/32203.

This PR fixes this issue by using mro cached in __mro__ instead of mro(). This shouldn't be a breaking change from what I understand of mro() and __mro__ but I'm not 100% confident.

@stevhliu
Copy link
Member

Thanks, pinging @mishig25 for a review 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants