From 0f6185a3e0d5b5d21c0989f5256d442ff01eee35 2020-12-01 14:29:23 From: Gordon Ball Date: 2020-12-01 14:29:23 Subject: [PATCH] qt: sip changes for PyQt5 >= 5.11 The former top-level module sip becomes PyQt5.sip, as per https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html This adds a fallback to the logic for checking the Qt string API --- diff --git a/IPython/external/qt_loaders.py b/IPython/external/qt_loaders.py index 46cd9c3..ca7483e 100644 --- a/IPython/external/qt_loaders.py +++ b/IPython/external/qt_loaders.py @@ -155,7 +155,12 @@ def qtapi_version(): try: import sip except ImportError: - return + # as of PyQt5 5.11, sip is no longer available as a top-level + # module and needs to be imported from the PyQt5 namespace + try: + from PyQt5 import sip + except ImportError: + return try: return sip.getapi('QString') except ValueError: