Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-member with Qt signals using PySide2 #2585

Closed
DGalt opened this issue Nov 7, 2018 · 3 comments · Fixed by pylint-dev/astroid#700
Closed

no-member with Qt signals using PySide2 #2585

DGalt opened this issue Nov 7, 2018 · 3 comments · Fixed by pylint-dev/astroid#700
Labels
Bug 🪲 Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)

Comments

@DGalt
Copy link

DGalt commented Nov 7, 2018

Steps to reproduce

  1. Create signal_test.py containing:
from PySide2 import QtWidgets
app = QtWidgets.QApplication()
app.focusChanged.connect(lambda x: None)
  1. Run
    pylint .\signal_test.py --extension-pkg-whitelist=PySide2

Current behavior

signal_test.py:5:0: E1101: Instance of 'Signal' has no 'connect' member (no-member)

Expected behavior

No errors

pylint --version output

pylint 2.1.1
astroid 2.0.4
Python 3.7.0 | packaged by conda-forge | (default, Oct  9 2018, 13:13:14) [MSC v.1900 64 bit (AMD64)]

Note that this was addressed for PySide in #1633

@PCManticore
Copy link
Contributor

Thanks for reporting an issue!

@PCManticore PCManticore added Bug 🪲 Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade) labels Nov 23, 2018
@akai10tsuki
Copy link

This is more or less related to issue #1633

Until new version is release I patch brain_qt.py and the error is not raised.

--- brain/brain_qt.py	2019-01-01 12:08:36.921238400 -0500
+++ brain/brain_qt.1.py	2019-01-01 12:21:51.070181400 -0500
@@ -80,3 +80,8 @@
     transform_pyside_signal,
     lambda node: node.qname() == "PySide.QtCore.Signal",
 )
+MANAGER.register_transform(
+    nodes.ClassDef,
+    transform_pyside_signal,
+    lambda node: node.qname() == "PySide2.QtCore.Signal",
+)

@akai10tsuki
Copy link

This file is found on the astroid module of your python installation.

site-packages/astroid/brain/brain_qt.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Projects
None yet
3 participants