-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
bpo-34441: Fix ABC.__subclasscheck__ crash on a class with invalid __subclasses__ #8835
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
Changes from 1 commit
377d01b
fa3bdae
a3cd050
432f6df
56b21e8
7df825e
dcf2e04
7d3c5ec
72cb031
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fix crash when an ``ABC``-derived class with non-callable ``__subclasses__`` is passed as the | ||
second argument to ``issubclass()``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ``issubclass()`` -> :func:`issubclass` There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add "Patch by Your Name." and wrap lines at 80 chars. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to add also tests for following cases:
__subclasses__
is a callable with wrong signature.__subclasses__
raises an exception explicitly.__subclasses__
returns not a list.__subclasses__
returns a list containing not a type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added those cases.