mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge pull request #3732 from bryevdv/bryevdv/3731_protect_isenumclass
Protect isenumclass predicate against non-class arguments
This commit is contained in:
@@ -104,7 +104,7 @@ def isenumclass(x):
|
||||
"""Check if the object is subclass of enum."""
|
||||
if enum is None:
|
||||
return False
|
||||
return issubclass(x, enum.Enum)
|
||||
return inspect.isclass(x) and issubclass(x, enum.Enum)
|
||||
|
||||
|
||||
def isenumattribute(x):
|
||||
|
||||
Reference in New Issue
Block a user