Skip to content
Browse files
more informative error message
  • Loading branch information
mbernasocchi authored and nyalldawson committed Jun 29, 2018
1 parent dbac3b4 commit 96764beff2c9e6c2dcfcaeee1956a38708ee1743
Showing 1 changed file with 3 additions and 1 deletion.
@@ -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)

0 comments on commit 96764be

Please sign in to comment.