Skip to content

Commit

Permalink
Deprecate import of pyqt{Signal,Slot,Property}
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed May 17, 2024
1 parent 284d817 commit d96d21e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions AnyQt/QtCore.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

from . import _api

# List names imported from Qt4's QtCore module
Expand Down Expand Up @@ -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}")

0 comments on commit d96d21e

Please sign in to comment.