Merge lp:~thomir-deactivatedaccount/txfixtures/trunk-py3 into lp:~canonical-launchpad-branches/txfixtures/trunk

Proposed by Thomi Richards
Status: Work in progress
Proposed branch: lp:~thomir-deactivatedaccount/txfixtures/trunk-py3
Merge into: lp:~canonical-launchpad-branches/txfixtures/trunk
Diff against target: 70 lines (+7/-7)
3 files modified
txfixtures/osutils.py (+5/-5)
txfixtures/tachandler.py (+1/-1)
txfixtures/tests/test_tachandler.py (+1/-1)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/txfixtures/trunk-py3
Reviewer Review Type Date Requested Status
Thomi Richards (community) Disapprove
Launchpad code reviewers Pending
Review via email: mp+284377@code.launchpad.net

Commit message

Add python3 support.

Description of the change

Add python3 support.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Turns out there's some pretty serious twisted / py3 issues. Until those are sorted out, this will have to wait.

review: Disapprove

Unmerged revisions

14. By Thomi Richards

Add python3 compatibility.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'txfixtures/osutils.py'
--- txfixtures/osutils.py 2011-12-01 21:09:30 +0000
+++ txfixtures/osutils.py 2016-01-29 01:44:03 +0000
@@ -20,7 +20,7 @@
20 """Kill a pid accepting that it may not exist."""20 """Kill a pid accepting that it may not exist."""
21 try:21 try:
22 os.kill(pid, signal_number)22 os.kill(pid, signal_number)
23 except OSError, e:23 except OSError as e:
24 if e.errno in (errno.ESRCH, errno.ECHILD):24 if e.errno in (errno.ESRCH, errno.ECHILD):
25 # Process has already been killed.25 # Process has already been killed.
26 return26 return
@@ -62,7 +62,7 @@
62 if new_pid:62 if new_pid:
63 return result63 return result
64 time.sleep(poll_interval)64 time.sleep(poll_interval)
65 except OSError, e:65 except OSError as e:
66 if e.errno in (errno.ESRCH, errno.ECHILD):66 if e.errno in (errno.ESRCH, errno.ECHILD):
67 # Raised if the process is gone by the time we try to get the67 # Raised if the process is gone by the time we try to get the
68 # return value.68 # return value.
@@ -90,7 +90,7 @@
90 """Remove the given file if it exists."""90 """Remove the given file if it exists."""
91 try:91 try:
92 os.remove(path)92 os.remove(path)
93 except OSError, e:93 except OSError as e:
94 if e.errno != errno.ENOENT:94 if e.errno != errno.ENOENT:
95 raise95 raise
9696
@@ -109,11 +109,11 @@
109 for i in range(retries):109 for i in range(retries):
110 try:110 try:
111 return function(*args, **kwargs)111 return function(*args, **kwargs)
112 except (IOError, OSError), e:112 except (IOError, OSError) as e:
113 if e.errno == errno.EINTR:113 if e.errno == errno.EINTR:
114 continue114 continue
115 raise115 raise
116 except socket.error, e:116 except socket.error as e:
117 # In Python 2.6 we can use IOError instead. It also has117 # In Python 2.6 we can use IOError instead. It also has
118 # reason.errno but we might be using 2.5 here so use the118 # reason.errno but we might be using 2.5 here so use the
119 # index hack.119 # index hack.
120120
=== modified file 'txfixtures/tachandler.py'
--- txfixtures/tachandler.py 2011-12-01 21:38:07 +0000
+++ txfixtures/tachandler.py 2016-01-29 01:44:03 +0000
@@ -135,7 +135,7 @@
135 s.connect((host, port))135 s.connect((host, port))
136 s.close()136 s.close()
137 return True137 return True
138 except socket.error, e:138 except socket.error as e:
139 if e.errno == errno.ECONNREFUSED:139 if e.errno == errno.ECONNREFUSED:
140 return False140 return False
141 else:141 else:
142142
=== modified file 'txfixtures/tests/test_tachandler.py'
--- txfixtures/tests/test_tachandler.py 2011-11-04 07:53:26 +0000
+++ txfixtures/tests/test_tachandler.py 2016-01-29 01:44:03 +0000
@@ -126,7 +126,7 @@
126126
127 # Put the (now bogus) pid in the pid file.127 # Put the (now bogus) pid in the pid file.
128 with open(fixture.pidfile, "wb") as pidfile:128 with open(fixture.pidfile, "wb") as pidfile:
129 pidfile.write(str(process.pid))129 pidfile.write(str(process.pid).encode())
130130
131 # Fire up the fixture, capturing warnings.131 # Fire up the fixture, capturing warnings.
132 with warnings.catch_warnings(record=True) as warnings_log:132 with warnings.catch_warnings(record=True) as warnings_log:

Subscribers

No one subscribed via source and target branches