Skip to content


Browse files Browse the repository at this point in the history
more informative error message
  • 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/
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.