work around python 2/3 difference by using str(exception)

This commit is contained in:
Ronny Pfannschmidt 2016-01-24 00:40:27 +01:00
parent d028fe1e66
commit cd9e30b221
1 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,8 @@ def resolve(name):
try:
__import__(used)
except ImportError as ex:
expected = ex.message.split()[-1]
# str is used for py2 vs py3
expected = str(ex).split()[-1]
if expected == used:
raise
else: