Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Even more descriptive error
  • Loading branch information
nyalldawson committed Jun 29, 2018
1 parent 96764be commit 36cfaac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/utils.py
Expand Up @@ -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)
Expand Down

0 comments on commit 36cfaac

Please sign in to comment.