diff options
| author | Jakub Stasiak <jakub@stasiak.at> | 2014-10-11 19:46:51 +0100 |
|---|---|---|
| committer | Jakub Stasiak <jakub@stasiak.at> | 2014-10-12 11:46:41 +0100 |
| commit | 128305cde4722bd7f1105aa6b47e9017bf60dda2 (patch) | |
| tree | 4b8086bdb229cd51e55921a3914026be377a003f /tests/fork_test.py | |
| parent | b93d0b65e51e7ed6a1cf264512eefe1dccfeffe0 (diff) | |
| download | eventlet-python3-next.tar.gz | |
Python 3 compat: Improve subprocess, WSGI and testspython3-next
Diffstat (limited to 'tests/fork_test.py')
| -rw-r--r-- | tests/fork_test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/fork_test.py b/tests/fork_test.py index 5ef177c..f15883f 100644 --- a/tests/fork_test.py +++ b/tests/fork_test.py @@ -8,6 +8,7 @@ import eventlet import os import sys import signal +from eventlet.support import bytes_to_str, six mydir = %r signal_file = os.path.join(mydir, "output.txt") pid = os.fork() @@ -30,18 +31,18 @@ if (pid != 0): break except (IOError, IndexError): eventlet.sleep(0.1) - print('result {0}'.format(result)) + print('result {0}'.format(bytes_to_str(result))) finally: os.kill(pid, signal.SIGTERM) else: try: s = eventlet.listen(('', 0)) fd = open(signal_file, "wb") - fd.write(str(s.getsockname()[1])) - fd.write("\\n") + fd.write(six.b(str(s.getsockname()[1]))) + fd.write(b"\\n") fd.flush() s.accept() - fd.write("done") + fd.write(b"done") fd.flush() finally: fd.close() |
