Skip to content

Commit

Permalink
Merge pull request #54 from lmmx/handlenodeload-sig
Browse files Browse the repository at this point in the history
[BUGFIX] Alter Checker.handleNodeLoad() signature (fix CI in the process)
  • Loading branch information
lmmx committed Mar 23, 2023
2 parents 310f844 + 0b8d4bd commit 1761af8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -8,13 +8,13 @@ repos:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.9.2
rev: 5.11.5
hooks:
- id: isort
additional_dependencies: [toml]

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--max-line-length=88", "--extend-ignore=E203,E501"]
Expand Down
4 changes: 2 additions & 2 deletions src/mvdef/core/check.py
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 1761af8

Please sign in to comment.