Skip to content

Commit

Permalink
Model patch for bug pylint__pylint7738057978676344711
Browse files Browse the repository at this point in the history
  • Loading branch information
Caroline Choi committed Dec 10, 2024
1 parent b61f206 commit b7740a2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions pylint/config/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ class UnrecognizedArgumentAction(Exception):
action is not recognized.
"""


class _UnrecognizedOptionError(Exception):
"""Raised if an ArgumentManager instance tries to parse an option that is
unknown.
"""

def __init__(self, options: list[str], *args: object) -> None:
self.options = options
super().__init__(*args)


class ArgumentPreprocessingError(Exception):
"""Raised if an error occurs during argument pre-processing."""
def __init__(self, message: str) -> None:
self.message = message
super().__init__(message)
2 changes: 1 addition & 1 deletion pylint/extensions/redefined_variable_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def leave_classdef(self, _: nodes.ClassDef) -> None:
leave_functiondef = leave_asyncfunctiondef = leave_module = leave_classdef

def visit_module(self, _: nodes.Module) -> None:
self._assigns: list[dict[str, list[tuple[nodes.Assign, str]]]] = [{}]
self._assigns: "list[dict[str, list[tuple[nodes.Assign, str]]]]" = [{}]

def _check_and_add_messages(self) -> None:
assigns = self._assigns.pop()
Expand Down
1 change: 0 additions & 1 deletion tests/functional/s/symlink/_binding/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions tests/functional/s/symlink/_binding/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Example taken from issue #1470"""

from symlinked_module import func
1 change: 0 additions & 1 deletion tests/functional/s/symlink/_binding/symlink_module.py

This file was deleted.

6 changes: 6 additions & 0 deletions tests/functional/s/symlink/_binding/symlink_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Example taken from issue #1470"""


def func():
"""Both module should be parsed without problem"""
return 1

0 comments on commit b7740a2

Please sign in to comment.