diff options
Diffstat (limited to 'doc/exts/pylint_extensions.py')
-rwxr-xr-x | doc/exts/pylint_extensions.py | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py index 406d2d39d..cadcbdcba 100755 --- a/doc/exts/pylint_extensions.py +++ b/doc/exts/pylint_extensions.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt +# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt """Script used to generate the extensions file before building the actual documentation.""" @@ -11,8 +11,7 @@ from __future__ import annotations import os import re import sys -import warnings -from typing import Any +from typing import Any, TypedDict import sphinx from sphinx.application import Sphinx @@ -23,11 +22,6 @@ from pylint.lint import PyLinter from pylint.typing import MessageDefinitionTuple, OptionDict, ReportsCallable from pylint.utils import get_rst_title -if sys.version_info >= (3, 8): - from typing import TypedDict -else: - from typing_extensions import TypedDict - class _CheckerInfo(TypedDict): """Represents data about a checker.""" @@ -134,24 +128,20 @@ def get_plugins_info( doc = f.read() try: by_checker[checker]["checker"] = checker - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - by_checker[checker]["options"] += checker.options_and_values() + by_checker[checker]["options"] += checker._options_and_values() by_checker[checker]["msgs"].update(checker.msgs) by_checker[checker]["reports"] += checker.reports by_checker[checker]["doc"] += doc by_checker[checker]["module"] += module except KeyError: - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - by_checker[checker] = _CheckerInfo( - checker=checker, - options=list(checker.options_and_values()), - msgs=dict(checker.msgs), - reports=list(checker.reports), - doc=doc, - module=module, - ) + by_checker[checker] = _CheckerInfo( + checker=checker, + options=list(checker._options_and_values()), + msgs=dict(checker.msgs), + reports=list(checker.reports), + doc=doc, + module=module, + ) return by_checker |