Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 24, 2022
1 parent 9186f7e commit 34e4a62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions astroid/brain/brain_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
from astroid.manager import AstroidManager


def _looks_like_signal(node: nodes.FunctionDef, signal_name: str ="pyqtSignal") -> bool:
def _looks_like_signal(
node: nodes.FunctionDef, signal_name: str = "pyqtSignal"
) -> bool:
# Detect a PySide2 or PySide6 signal, the class changed locations as of QT 5ish
if node.qname().partition(".")[0] in {"PySide2", "PySide6"}:
return any(cls.qname() == "Signal" for cls in node.instance_attrs.get("__class__", []))
return any(
cls.qname() == "Signal" for cls in node.instance_attrs.get("__class__", [])
)

if "__class__" in node.instance_attrs:
try:
Expand Down

0 comments on commit 34e4a62

Please sign in to comment.