Remove unnecessary enum existence guard (#5858)

The enum module is always available since Python 3.4.
This commit is contained in:
Jon Dufresne 2018-12-23 05:44:01 -08:00 committed by Takeshi KOMIYA
parent c9007fbfaa
commit 6356a622fc

View File

@ -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)