From fb3060d9463c7f45995f370acf3bed145ed11de8 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim <2090236+pllim@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:17:12 -0400 Subject: [PATCH] MNT: Code clean-up. Removed PY2 compat and unused imports in setup.cfg and autodoc_enhancements.py. --- setup.cfg | 1 - sphinx_automodapi/autodoc_enhancements.py | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/setup.cfg b/setup.cfg index db20980..27fbca2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,6 @@ classifiers = Development Status :: 3 - Alpha Intended Audience :: Developers Programming Language :: Python - Programming Language :: Python :: 2 Programming Language :: Python :: 3 Operating System :: OS Independent License :: OSI Approved :: BSD License diff --git a/sphinx_automodapi/autodoc_enhancements.py b/sphinx_automodapi/autodoc_enhancements.py index e32f00a..7721043 100644 --- a/sphinx_automodapi/autodoc_enhancements.py +++ b/sphinx_automodapi/autodoc_enhancements.py @@ -1,21 +1,11 @@ """ Miscellaneous enhancements to help autodoc along. """ - -import inspect -import sys -import types - -from sphinx.ext.autodoc import AttributeDocumenter, ModuleDocumenter -from sphinx.util.inspect import isdescriptor +from sphinx.ext.autodoc import AttributeDocumenter __all__ = [] -if sys.version_info[0] == 3: - class_types = (type,) -else: - class_types = (type, types.ClassType) - +class_types = (type,) MethodDescriptorType = type(type.__subclasses__)