Merge lp:~michihenning/unity/python3-daemon into lp:unity/phablet

Proposed by Michi Henning
Status: Merged
Approved by: Michał Sawicz
Approved revision: no longer in the source branch.
Merged at revision: 607
Proposed branch: lp:~michihenning/unity/python3-daemon
Merge into: lp:unity/phablet
Diff against target: 52 lines (+20/-21)
1 file modified
tests/gtest/unity/util/Daemon/daemon-tester.py (+20/-21)
To merge this branch: bzr merge lp:~michihenning/unity/python3-daemon
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Review via email: mp+159528@code.launchpad.net

Commit message

Changed script to Python 3 and removed unused variable.

Description of the change

Changed script to Python 3 and removed unused variable.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Jenkins fail, reapproving.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/gtest/unity/util/Daemon/daemon-tester.py'
2--- tests/gtest/unity/util/Daemon/daemon-tester.py 2013-04-05 10:45:02 +0000
3+++ tests/gtest/unity/util/Daemon/daemon-tester.py 2013-04-18 00:26:25 +0000
4@@ -1,4 +1,4 @@
5-#! /usr/bin/env python
6+#! /usr/bin/env python3
7
8 #
9 # Copyright (C) 2013 Canonical Ltd
10@@ -36,23 +36,22 @@
11 exit("cannot run " + path)
12 time.sleep(1) # Give process time to complete
13
14-#
15-# Main program.
16-#
17-
18-parser = argparse.ArgumentParser(description = 'Test driver for Daemon_test')
19-parser.add_argument('Daemon_test', nargs = 1, help = 'Full path to Daemon_test executable')
20-
21-args = parser.parse_args()
22-progname = parser.prog
23-
24-daemon = args.Daemon_test[0]
25-run_daemon(daemon)
26-
27-size = os.stat("Daemon_test.out").st_size
28-if size == 0:
29- exit(0)
30-
31-with open("Daemon_test.out", 'r') as file:
32- sys.stderr.write(file.read())
33- exit(1)
34+def run():
35+ parser = argparse.ArgumentParser(description = 'Test driver for Daemon_test')
36+ parser.add_argument('Daemon_test', nargs = 1, help = 'Full path to Daemon_test executable')
37+
38+ args = parser.parse_args()
39+
40+ daemon = args.Daemon_test[0]
41+ run_daemon(daemon)
42+
43+ size = os.stat("Daemon_test.out").st_size
44+ if size == 0:
45+ exit(0)
46+
47+ with open("Daemon_test.out", 'r') as file:
48+ sys.stderr.write(file.read())
49+ exit(1)
50+
51+if __name__ == '__main__':
52+ run()

Subscribers

People subscribed via source and target branches