From 25fed02adb3fd0d41da3f4dff027e59c424120bc Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 30 Jan 2017 15:13:27 +0100 Subject: Fixed ICE-7493 - Support for java try-with and Python with statements for the Ice.Communicator --- python/test/Ice/exceptions/ServerAMD.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'python/test/Ice/exceptions/ServerAMD.py') diff --git a/python/test/Ice/exceptions/ServerAMD.py b/python/test/Ice/exceptions/ServerAMD.py index 999a41115c8..04e28fdf8d0 100755 --- a/python/test/Ice/exceptions/ServerAMD.py +++ b/python/test/Ice/exceptions/ServerAMD.py @@ -175,13 +175,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) -- cgit v1.2.3