"""
Self built extension to remove the "Members" section of enums from the autodoc output.
"""

def setup(app):
    app.connect('autodoc-process-docstring', filter_autodoc_members)

def filter_autodoc_members(app, what, name, obj, options, lines):
    new_lines = []
    for line in lines:
        if "Members:" in line:
            break
        else:
            new_lines.append(line)
    lines[:] = new_lines