From e25c8a2793e5f253bf0a64ebc9c75f607668a24f Mon Sep 17 00:00:00 2001 From: Arno Schoenmakers <schoenmakers@astron.nl> Date: Wed, 28 Oct 2015 12:29:28 +0000 Subject: [PATCH] Task #8571: Added python 2.6 compatibility for nested with-statement --- LCS/Messaging/python/messaging/test/t_RPC.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LCS/Messaging/python/messaging/test/t_RPC.py b/LCS/Messaging/python/messaging/test/t_RPC.py index a3703443793..35aec35ad63 100644 --- a/LCS/Messaging/python/messaging/test/t_RPC.py +++ b/LCS/Messaging/python/messaging/test/t_RPC.py @@ -6,6 +6,8 @@ that the functions are OK. Next the same tests are done with the RPC and Service classes in between. This should give the same results. """ import sys +from contextlib import nested + from lofar.messaging import Service, RPC class UserException(Exception): @@ -117,7 +119,7 @@ if __name__ == '__main__': serv5 = Service(busname, "DictService", DictFunc, numthreads=1) # 'with' sets up the connection context and defines the scope of the service. - with serv1, serv2, serv3, serv4, serv5: + with nested(serv1, serv2, serv3, serv4, serv5): # Start listening in the background. This will start as many threads as defined by the instance serv1.StartListening() serv2.StartListening() -- GitLab