Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Aug 2, 2023
1 parent c04dc0c commit 592a3c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ def __init__(
self.analyzed = analyzed
# Short names of methods defined in the body of the current class
self.method_names: set[str] = set()
self.current_class: str | None = None

def visit_mypy_file(self, o: MypyFile) -> None:
self.module_name = o.fullname # Current module being processed
Expand Down Expand Up @@ -565,12 +564,12 @@ def visit_func_def(self, o: FuncDef) -> None:
if init_code:
self.add(init_code)

if self.current_class is not None:
if self._current_class is not None:
if len(o.arguments):
self_var = o.arguments[0].variable.name
else:
self_var = "self"
class_info = ClassInfo(self.current_class, self_var)
class_info = ClassInfo(self._current_class.name, self_var)
else:
class_info = None

Expand Down Expand Up @@ -703,7 +702,6 @@ def visit_class_def(self, o: ClassDef) -> None:
self._state = EMPTY_CLASS
else:
self._state = CLASS
self.current_class = None
self.method_names = set()
self._current_class = None

Expand Down

0 comments on commit 592a3c0

Please sign in to comment.