Skip to content

Commit 96764be

Browse files
mbernasocchinyalldawson
authored andcommitted
more informative error message
1 parent dbac3b4 commit 96764be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ def _import(name, globals={}, locals={}, fromlist=[], level=None):
667667
level = 0
668668

669669
if 'PyQt4' in name:
670-
raise ImportError('Cannot import PyQt4 classes - this would cause a crash!')
670+
msg = 'Importing PyQt4 classes would cause a crash, ' \
671+
'please use PyQt5 in "{}"'.format(name)
672+
raise ImportError(msg)
671673

672674
mod = _builtin_import(name, globals, locals, fromlist, level)
673675

0 commit comments

Comments
 (0)