From 429d39d1dc8691067bf08a10c935c8100efec1ba Mon Sep 17 00:00:00 2001 From: Yun Mao Date: Tue, 7 Aug 2012 10:34:45 -0400 Subject: [PATCH] Remove deprecated use Exception.message This usage is deprecated since Python 2.6. Use the recommended style instead. str is also replaced with unicode. Change-Id: I2adfd7fdfdf47b70ef170a2daa28926764cf0337 --- nova/tests/test_libvirt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index db00334e..c43512c1 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -1928,9 +1928,9 @@ class LibvirtConnTestCase(test.TestCase): conn.spawn(self.context, instance, None, network_info) except Exception, e: # assert that no exception is raised due to sha1 receiving an int - self.assertEqual(-1, str(e.message).find('must be string or buffer' - ', not int')) - count = (0 <= str(e.message).find('Unexpected method call')) + self.assertEqual(-1, unicode(e).find('must be string or buffer' + ', not int')) + count = (0 <= unicode(e).find('Unexpected method call')) path = os.path.join(FLAGS.instances_path, instance.name) if os.path.isdir(path):