Skip to content

Commit

Permalink
[BUGFIX] Alter Checker.handleNodeLoad() signature to accomodate pyfla…
Browse files Browse the repository at this point in the history
…kes PR 745 (introduced a parent arg)
  • Loading branch information
lmmx committed Mar 23, 2023
1 parent 310f844 commit 4db71ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mvdef/core/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def unused_imports(self) -> list[UnusedImport]:
imps = [m for m in self.messages if isinstance(m, UnusedImport)]
return imps

def handleNodeLoad(self, node):
def handleNodeLoad(self, node, parent=None):
used_set = [] # Note: not used, but would help if re-assignment is an issue
# https://github.com/PyCQA/pyflakes/blob/
# 853cce91634cbddff01cc16313b5467be1e95c54/pyflakes/checker.py#L1073-L1094
Expand All @@ -134,7 +134,7 @@ def handleNodeLoad(self, node):
continue
binding = scope.get(name, None)
if isinstance(binding, Annotation) and not self._in_postponed_annotation:
scope[name].used = True
scope[name].used = (self.scope, node)
continue
if name == "print" and isinstance(binding, Builtin):
parent = self.getParent(node)
Expand Down

0 comments on commit 4db71ec

Please sign in to comment.