Skip to content

Fix bug in super() with metaclasses #584

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
merged 1 commit into from
Nov 11, 2021
Merged

Fix bug in super() with metaclasses #584

merged 1 commit into from
Nov 11, 2021

Conversation

nuno-andre
Copy link
Contributor

Hi! First of all, thanks for this lib, it really makes dealing with legacy code much more bearable.

I got an error trying to call a metaclass with super() without arguments, and I've found it's searching the method's owner in the class' own mro. But the metaclass is not its superclass, so the owner is never found. This PR adds a fallback to search the owner in the metaclass mro and a test with the case at #267.

Regards,

@edschofield edschofield merged commit cfaf9c0 into PythonCharmers:master Nov 11, 2021
@edschofield
Copy link
Contributor

Thanks for your kind words and your patch, @nuno-andre !

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