Skip to content

Commit

Permalink
more informative error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernasocchi authored and nyalldawson committed Jun 29, 2018
1 parent dbac3b4 commit 96764be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ def _import(name, globals={}, locals={}, fromlist=[], level=None):
level = 0

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

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

Expand Down

0 comments on commit 96764be

Please sign in to comment.