summaryrefslogtreecommitdiff
path: root/python/test/Ice/exceptions/Server.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/exceptions/Server.py')
-rwxr-xr-xpython/test/Ice/exceptions/Server.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/python/test/Ice/exceptions/Server.py b/python/test/Ice/exceptions/Server.py
index 3cb70a97161..018adf04c93 100755
--- a/python/test/Ice/exceptions/Server.py
+++ b/python/test/Ice/exceptions/Server.py
@@ -44,13 +44,10 @@ try:
initData.properties.setProperty("TestAdapter2.MessageSizeMax", "0")
initData.properties.setProperty("TestAdapter3.Endpoints", "default -p 12012")
initData.properties.setProperty("TestAdapter3.MessageSizeMax", "1")
- communicator = Ice.initialize(sys.argv, initData)
- status = run(sys.argv, communicator)
+ with Ice.initialize(sys.argv, initData) as communicator:
+ status = run(sys.argv, communicator)
except:
traceback.print_exc()
status = False
-if communicator:
- communicator.destroy()
-
sys.exit(not status)