Skip to content

Commit 82d0765

Browse files
authored
Merge pull request ipython#12715 from chronitis/pyqt5-sip
qt: sip changes for PyQt5 >= 5.11
2 parents 0a92f5e + 0f6185a commit 82d0765

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

IPython/external/qt_loaders.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ def qtapi_version():
155155
try:
156156
import sip
157157
except ImportError:
158-
return
158+
# as of PyQt5 5.11, sip is no longer available as a top-level
159+
# module and needs to be imported from the PyQt5 namespace
160+
try:
161+
from PyQt5 import sip
162+
except ImportError:
163+
return
159164
try:
160165
return sip.getapi('QString')
161166
except ValueError:

0 commit comments

Comments
 (0)