Skip to content

Commit f25fda9

Browse files
committed
Update pylint codebase
1 parent 0e19fad commit f25fda9

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

pylint/checkers/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def predicate(obj: Any) -> bool:
3535

3636
def _annotated_unpack_infer(
3737
stmt: nodes.NodeNG, context: InferenceContext | None = None
38-
) -> Generator[tuple[nodes.NodeNG, SuccessfulInferenceResult], None, None]:
38+
) -> Generator[tuple[nodes.NodeNG, SuccessfulInferenceResult]]:
3939
"""Recursively generate nodes inferred by the given statement.
4040
4141
If the inferred value is a list or a tuple, recurse on the elements.

pylint/checkers/symilar.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def _get_similarity_report(
468468
# pylint: disable = too-many-locals
469469
def _find_common(
470470
self, lineset1: LineSet, lineset2: LineSet
471-
) -> Generator[Commonality, None, None]:
471+
) -> Generator[Commonality]:
472472
"""Find similarities in the two given linesets.
473473
474474
This the core of the algorithm. The idea is to compute the hashes of a
@@ -541,7 +541,7 @@ def _find_common(
541541
if eff_cmn_nb > self.namespace.min_similarity_lines:
542542
yield com
543543

544-
def _iter_sims(self) -> Generator[Commonality, None, None]:
544+
def _iter_sims(self) -> Generator[Commonality]:
545545
"""Iterate on similarities among all files, by making a Cartesian
546546
product.
547547
"""

pylint/checkers/variables.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ class C: ...
249249
return frame.lineno < defframe.lineno # type: ignore[no-any-return]
250250

251251

252-
def _infer_name_module(
253-
node: nodes.Import, name: str
254-
) -> Generator[InferenceResult, None, None]:
252+
def _infer_name_module(node: nodes.Import, name: str) -> Generator[InferenceResult]:
255253
context = astroid.context.InferenceContext()
256254
context.lookupname = name
257255
return node.infer(context, asname=False) # type: ignore[no-any-return]

pylint/pyreverse/diadefslib.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def add_class(self, node: nodes.ClassDef) -> None:
8484

8585
def get_ancestors(
8686
self, node: nodes.ClassDef, level: int
87-
) -> Generator[nodes.ClassDef, None, None]:
87+
) -> Generator[nodes.ClassDef]:
8888
"""Return ancestor nodes of a class node."""
8989
if level == 0:
9090
return
@@ -95,7 +95,7 @@ def get_ancestors(
9595

9696
def get_associated(
9797
self, klass_node: nodes.ClassDef, level: int
98-
) -> Generator[nodes.ClassDef, None, None]:
98+
) -> Generator[nodes.ClassDef]:
9999
"""Return associated nodes of a class node."""
100100
if level == 0:
101101
return

pylint/testutils/checker_test_case.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def assertNoMessages(self) -> Iterator[None]:
4040
@contextlib.contextmanager
4141
def assertAddsMessages(
4242
self, *messages: MessageTest, ignore_position: bool = False
43-
) -> Generator[None, None, None]:
43+
) -> Generator[None]:
4444
"""Assert that exactly the given method adds the given messages.
4545
4646
The list of messages must exactly match *all* the messages added by the

pylint/testutils/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _patch_streams(out: TextIO) -> Iterator[None]:
2727
@contextlib.contextmanager
2828
def _test_sys_path(
2929
replacement_sys_path: list[str] | None = None,
30-
) -> Generator[None, None, None]:
30+
) -> Generator[None]:
3131
original_path = sys.path
3232
try:
3333
if replacement_sys_path is not None:
@@ -40,7 +40,7 @@ def _test_sys_path(
4040
@contextlib.contextmanager
4141
def _test_cwd(
4242
current_working_directory: str | Path | None = None,
43-
) -> Generator[None, None, None]:
43+
) -> Generator[None]:
4444
original_dir = os.getcwd()
4545
try:
4646
if current_working_directory is not None:
@@ -53,7 +53,7 @@ def _test_cwd(
5353
@contextlib.contextmanager
5454
def _test_environ_pythonpath(
5555
new_pythonpath: str | None = None,
56-
) -> Generator[None, None, None]:
56+
) -> Generator[None]:
5757
original_pythonpath = os.environ.get("PYTHONPATH")
5858
if new_pythonpath:
5959
os.environ["PYTHONPATH"] = new_pythonpath

pylint/utils/pragma_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class InvalidPragmaError(PragmaParserError):
8686
"""Thrown in case the pragma is invalid."""
8787

8888

89-
def parse_pragma(pylint_pragma: str) -> Generator[PragmaRepresenter, None, None]:
89+
def parse_pragma(pylint_pragma: str) -> Generator[PragmaRepresenter]:
9090
action: str | None = None
9191
messages: list[str] = []
9292
assignment_required = False

0 commit comments

Comments
 (0)