diff options
Diffstat (limited to 'python/test/Ice/operations/TestI.py')
-rw-r--r-- | python/test/Ice/operations/TestI.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/python/test/Ice/operations/TestI.py b/python/test/Ice/operations/TestI.py index 2901b2796ae..87b1e0b21bc 100644 --- a/python/test/Ice/operations/TestI.py +++ b/python/test/Ice/operations/TestI.py @@ -294,15 +294,13 @@ class MyDerivedClassI(Test.MyDerivedClass): return [-x for x in s] def opByteSOneway(self, s, current=None): - self.lock.acquire() - self.opByteSOnewayCount += 1 - self.lock.release() + with self.lock: + self.opByteSOnewayCount += 1 def opByteSOnewayCallCount(self, current=None): - self.lock.acquire() - count = self.opByteSOnewayCount - self.opByteSOnewayCount = 0 - self.lock.release() + with self.lock: + count = self.opByteSOnewayCount + self.opByteSOnewayCount = 0 return count def opContext(self, current=None): |