Skip to content

Commit d29bcf6

Browse files
authored
Add regression test (#5339)
1 parent 2904ae0 commit d29bcf6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Regression test for a crash reported in https://github.com/PyCQA/pylint/issues/4982"""
2+
# pylint: disable=too-few-public-methods
3+
4+
class Base:
5+
"""A class"""
6+
@classmethod
7+
def get_first_subclass(cls):
8+
"""Return the first subclass of this class"""
9+
for subklass in cls.__subclasses__():
10+
return subklass
11+
return object
12+
13+
14+
subclass = Base.get_first_subclass()
15+
16+
17+
class Another(subclass):
18+
"""Create a class from the __subclasses__ attribute of another class"""

0 commit comments

Comments
 (0)