From c40b0bfd20b4f34e26e6ae68c56d8e1c79b99cf0 2013-09-23 19:14:21 From: Thomas Kluyver Date: 2013-09-23 19:14:21 Subject: [PATCH] Make check for pywin32 more portable. The attribute is message in Python 2, msg in Python 3. --- diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index d556783..3ad0548 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -374,7 +374,7 @@ def onlyif_cmds_exist(*commands): "is installed".format(cmd)) except ImportError as e: # is_cmd_found uses pywin32 on windows, which might not be available - if sys.platform == 'win32' and 'pywin32' in e.message: + if sys.platform == 'win32' and 'pywin32' in str(e): return skip("This test runs only if pywin32 and command '{0}' " "is installed".format(cmd)) raise e