Skip to content
Permalink
Browse files

Even more descriptive error

  • Loading branch information
nyalldawson committed Jun 28, 2018
1 parent 96764be commit 36cfaac8af5b04d31b76fab7568b73197cb5a134
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/utils.py
@@ -667,8 +667,8 @@ def _import(name, globals={}, locals={}, fromlist=[], level=None):
level = 0

if 'PyQt4' in name:
msg = 'Importing PyQt4 classes would cause a crash, ' \
'please use PyQt5 in "{}"'.format(name)
msg = 'PyQt4 classes cannot be imported in QGIS 3.x.\n' \
'Use {} or the version independent {} import instead.'.format(name.replace('PyQt4', 'PyQt5'), name.replace('PyQt4', 'qgis.PyQt'))
raise ImportError(msg)

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

0 comments on commit 36cfaac

Please sign in to comment.
You can’t perform that action at this time.