From 6356a622fc8e937ce244449f30a419e64ac9fe4a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 23 Dec 2018 05:44:01 -0800 Subject: [PATCH] Remove unnecessary enum existence guard (#5858) The enum module is always available since Python 3.4. --- sphinx/util/inspect.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 7a0b8c5ba..4973111cf 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -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)