Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7d40606

Browse filesBrowse files
committed
Merge pull request #2325 from matthew-brett/deal-with-broken-qt4
BF: guard against broken PyQt import
2 parents 8eb36dc + 0ba0668 commit 7d40606
Copy full SHA for 7d40606

File tree

1 file changed

+10
-8
lines changed
Filter options

1 file changed

+10
-8
lines changed

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,14 +1657,16 @@ def check(self):
16571657
from PyQt4 import pyqtconfig
16581658
except ImportError:
16591659
raise CheckFailed("PyQt4 not found")
1660-
else:
1661-
1662-
BackendAgg.force = True
1663-
1664-
return ("Qt: %s, PyQt4: %s" %
1665-
(self.convert_qt_version(
1666-
pyqtconfig.Configuration().qt_version),
1667-
pyqtconfig.Configuration().pyqt_version_str))
1660+
# Import may still be broken for our python
1661+
try:
1662+
qtconfig = pyqtconfig.Configuration()
1663+
except AttributeError:
1664+
raise CheckFailed('PyQt4 not correctly imported')
1665+
BackendAgg.force = True
1666+
return ("Qt: %s, PyQt4: %s" %
1667+
(self.convert_qt_version(
1668+
qtconfig.qt_version),
1669+
qtconfig.pyqt_version_str))
16681670

16691671

16701672
class BackendPySide(OptionalBackendPackage):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.