From 57ca88bb6e69d1047caf53f57cdbc676263e9ccb Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 22 Apr 2013 03:42:48 +0200 Subject: [PATCH] Improve Python 3.x compatibility Mechanical translation of deprecated constructs to 3.x compatible variants. Change-Id: I4988d0ac656903e0d0320aaa8361d4eeb774a0f9 --- openstack/common/lockutils.py | 2 +- tests/unit/test_processutils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openstack/common/lockutils.py b/openstack/common/lockutils.py index ef42b9b..892d821 100644 --- a/openstack/common/lockutils.py +++ b/openstack/common/lockutils.py @@ -82,7 +82,7 @@ class _InterProcessLock(object): # to have a laughable 10 attempts "blocking" mechanism. self.trylock() return self - except IOError, e: + except IOError as e: if e.errno in (errno.EACCES, errno.EAGAIN): # external locks synchronise things like iptables # updates - give it some time to prevent busy spinning diff --git a/tests/unit/test_processutils.py b/tests/unit/test_processutils.py index 689bad0..f096cf7 100644 --- a/tests/unit/test_processutils.py +++ b/tests/unit/test_processutils.py @@ -72,7 +72,7 @@ class ProcessExecutionErrorTest(utils.BaseTestCase): the Wielder of Wonder, with world's renown. """.strip() err = processutils.ProcessExecutionError(stdout=stdout) - print err.message + print(err.message) self.assertTrue('people-kings' in err.message) def test_with_stderr(self):