Commit d0ccb008 authored by Luke Macken's avatar Luke Macken

Make the unicodenazi happy

parent de4de5a9
......@@ -139,7 +139,7 @@ class PyrasiteIPC(object):
"""
Send a python command to exec in the process and return the output
"""
self.send(cmd + '\n')
self.send(cmd + u'\n')
return self.recv()
def send(self, data):
......
......@@ -158,8 +158,8 @@ class TestCodeInjection(unittest.TestCase):
stdout, stderr = p.communicate()
count = 0
for line in stdout.decode('utf-8').split('\n'):
if line.strip() == 'Hello World!':
for line in unicode(stdout, 'utf-8').split(u'\n'):
if line.strip() == u'Hello World!':
count += 1
os.unlink(program)
......
......@@ -57,13 +57,13 @@ class TestIPC(unittest.TestCase):
def test_cmd(self):
self.ipc.connect()
assert self.ipc.cmd('print("mu")') == 'mu\n'
assert self.ipc.cmd(u'print("mu")') == u'mu\n'
def test_unreliable(self):
self.ipc.reliable = False
self.ipc.connect()
out = self.ipc.cmd('print("mu")')
assert out == 'mu\n', out
out = self.ipc.cmd(u'print("mu")')
assert out == u'mu\n', out
def test_repr(self):
assert repr(self.ipc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment