From e769829421473e3325eb3d8752e7e4397ab3bd39 2014-06-18 23:02:29 From: MinRK Date: 2014-06-18 23:02:29 Subject: [PATCH] fix nicer ImportError message on Python 3 Exception.message is not defined on Python 3 --- diff --git a/IPython/nbformat/validator.py b/IPython/nbformat/validator.py index d69ca79..e0d486a 100644 --- a/IPython/nbformat/validator.py +++ b/IPython/nbformat/validator.py @@ -12,7 +12,7 @@ except ImportError as e: Please install it first. """ - raise ImportError(e.message + verbose_msg) + raise ImportError(str(e) + verbose_msg) try: import jsonpointer as jsonpointer @@ -23,7 +23,7 @@ except ImportError as e: Please install it first. """ - raise ImportError(e.message + verbose_msg) + raise ImportError(str(e) + verbose_msg) from IPython.utils.py3compat import iteritems