diff options
Diffstat (limited to 'python/test/Slice/structure')
-rwxr-xr-x | python/test/Slice/structure/Client.py | 11 | ||||
-rwxr-xr-x | python/test/Slice/structure/run.py | 28 |
2 files changed, 2 insertions, 37 deletions
diff --git a/python/test/Slice/structure/Client.py b/python/test/Slice/structure/Client.py index b820506ec8b..2a9e23246db 100755 --- a/python/test/Slice/structure/Client.py +++ b/python/test/Slice/structure/Client.py @@ -195,17 +195,10 @@ def run(args, communicator): try: initData = Ice.InitializationData() initData.properties = Ice.createProperties(sys.argv) - 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: - try: - communicator.destroy() - except: - traceback.print_exc() - status = False - sys.exit(not status) diff --git a/python/test/Slice/structure/run.py b/python/test/Slice/structure/run.py deleted file mode 100755 index b7fe1b9ed2c..00000000000 --- a/python/test/Slice/structure/run.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -import os, sys - -path = [ ".", "..", "../..", "../../..", "../../../.." ] -head = os.path.dirname(sys.argv[0]) -if len(head) > 0: - path = [os.path.join(head, p) for p in path] -path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] -if len(path) == 0: - raise RuntimeError("can't find toplevel directory!") -sys.path.append(os.path.join(path[0], "scripts")) -import TestUtil - -sys.stdout.write("starting client... ") -sys.stdout.flush() -clientProc = TestUtil.startClient("Client.py", "--Ice.Default.Host=127.0.0.1", startReader = False) -print("ok") -clientProc.startReader() -clientProc.waitTestSuccess() |