Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
e25c8a27
Commit
e25c8a27
authored
9 years ago
by
Arno Schoenmakers
Browse files
Options
Downloads
Patches
Plain Diff
Task #8571: Added python 2.6 compatibility for nested with-statement
parent
be27ed52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/Messaging/python/messaging/test/t_RPC.py
+3
-1
3 additions, 1 deletion
LCS/Messaging/python/messaging/test/t_RPC.py
with
3 additions
and
1 deletion
LCS/Messaging/python/messaging/test/t_RPC.py
+
3
−
1
View file @
e25c8a27
...
@@ -6,6 +6,8 @@ that the functions are OK. Next the same tests are done with the RPC and
...
@@ -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.
Service classes in between. This should give the same results.
"""
"""
import
sys
import
sys
from
contextlib
import
nested
from
lofar.messaging
import
Service
,
RPC
from
lofar.messaging
import
Service
,
RPC
class
UserException
(
Exception
):
class
UserException
(
Exception
):
...
@@ -117,7 +119,7 @@ if __name__ == '__main__':
...
@@ -117,7 +119,7 @@ if __name__ == '__main__':
serv5
=
Service
(
busname
,
"
DictService
"
,
DictFunc
,
numthreads
=
1
)
serv5
=
Service
(
busname
,
"
DictService
"
,
DictFunc
,
numthreads
=
1
)
# 'with' sets up the connection context and defines the scope of the service.
# '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
# Start listening in the background. This will start as many threads as defined by the instance
serv1
.
StartListening
()
serv1
.
StartListening
()
serv2
.
StartListening
()
serv2
.
StartListening
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment