mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove unnecessary enum existence guard (#5858)
The enum module is always available since Python 3.4.
This commit is contained in:
parent
c9007fbfaa
commit
6356a622fc
@ -103,16 +103,12 @@ def getargspec(func):
|
||||
def isenumclass(x):
|
||||
# type: (Type) -> bool
|
||||
"""Check if the object is subclass of enum."""
|
||||
if enum is None:
|
||||
return False
|
||||
return inspect.isclass(x) and issubclass(x, enum.Enum)
|
||||
|
||||
|
||||
def isenumattribute(x):
|
||||
# type: (Any) -> bool
|
||||
"""Check if the object is attribute of enum."""
|
||||
if enum is None:
|
||||
return False
|
||||
return isinstance(x, enum.Enum)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user