From d96d21e86e4b3dc7ac6eb777e4e38530d4964a21 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Thu, 16 Jun 2022 10:20:49 +0200 Subject: [PATCH] Deprecate import of pyqt{Signal,Slot,Property} --- AnyQt/QtCore.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AnyQt/QtCore.py b/AnyQt/QtCore.py index e3567b1..c675f58 100644 --- a/AnyQt/QtCore.py +++ b/AnyQt/QtCore.py @@ -1,3 +1,5 @@ +import warnings + from . import _api # List names imported from Qt4's QtCore module @@ -466,3 +468,13 @@ def isdeleted(obj): QT_VERSION_INFO = tuple(map(int, qVersion().split(".")[:3])) _api.apply_global_fixes(globals()) + + +def __getattr__(name): + if name in ("pyqtSignal", "pyqtSlot", "pyqtProperty"): + warnings.warn( + f"{name} is deprecated", DeprecationWarning, + stacklevel=2, + ) + return globals()[name] + raise AttributeError(f"module {__name__} has no attribute {name}")