diff options
| author | Maxim Yurchuk <[email protected]> | 2024-10-20 00:06:50 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-20 00:06:50 +0300 |
| commit | e0b481c6710337ae655271bbb80afe6ac81a5614 (patch) | |
| tree | dba67dc017935800d0c3f8dc967e9522c5302bd2 /contrib/python/ipython/py3/IPython/external | |
| parent | 07f2e60d02d95eab14a86a4b9469db1af7795001 (diff) | |
| parent | f04ad7e5462f5910ef95f2efd15c509e539ae62d (diff) | |
Merge pull request #10642 from ydb-platform/mergelibs-241019-1758
Library import 241019-1758
Diffstat (limited to 'contrib/python/ipython/py3/IPython/external')
| -rw-r--r-- | contrib/python/ipython/py3/IPython/external/qt_loaders.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/python/ipython/py3/IPython/external/qt_loaders.py b/contrib/python/ipython/py3/IPython/external/qt_loaders.py index 1486cf9d773..6058ee5a9a8 100644 --- a/contrib/python/ipython/py3/IPython/external/qt_loaders.py +++ b/contrib/python/ipython/py3/IPython/external/qt_loaders.py @@ -302,13 +302,25 @@ def import_pyside6(): ImportErrors raised within this function are non-recoverable """ + + def get_attrs(module): + return { + name: getattr(module, name) + for name in dir(module) + if not name.startswith("_") + } + from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport # Join QtGui and QtWidgets for Qt4 compatibility. QtGuiCompat = types.ModuleType("QtGuiCompat") QtGuiCompat.__dict__.update(QtGui.__dict__) - QtGuiCompat.__dict__.update(QtWidgets.__dict__) - QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + if QtCore.__version_info__ < (6, 7): + QtGuiCompat.__dict__.update(QtWidgets.__dict__) + QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + else: + QtGuiCompat.__dict__.update(get_attrs(QtWidgets)) + QtGuiCompat.__dict__.update(get_attrs(QtPrintSupport)) return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6 |
