Commit d0ccb008 authored by Luke Macken's avatar Luke Macken

Make the unicodenazi happy

parent de4de5a9
...@@ -139,7 +139,7 @@ class PyrasiteIPC(object): ...@@ -139,7 +139,7 @@ class PyrasiteIPC(object):
""" """
Send a python command to exec in the process and return the output 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() return self.recv()
def send(self, data): def send(self, data):
......
...@@ -158,8 +158,8 @@ class TestCodeInjection(unittest.TestCase): ...@@ -158,8 +158,8 @@ class TestCodeInjection(unittest.TestCase):
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
count = 0 count = 0
for line in stdout.decode('utf-8').split('\n'): for line in unicode(stdout, 'utf-8').split(u'\n'):
if line.strip() == 'Hello World!': if line.strip() == u'Hello World!':
count += 1 count += 1
os.unlink(program) os.unlink(program)
......
...@@ -57,13 +57,13 @@ class TestIPC(unittest.TestCase): ...@@ -57,13 +57,13 @@ class TestIPC(unittest.TestCase):
def test_cmd(self): def test_cmd(self):
self.ipc.connect() 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): def test_unreliable(self):
self.ipc.reliable = False self.ipc.reliable = False
self.ipc.connect() self.ipc.connect()
out = self.ipc.cmd('print("mu")') out = self.ipc.cmd(u'print("mu")')
assert out == 'mu\n', out assert out == u'mu\n', out
def test_repr(self): def test_repr(self):
assert repr(self.ipc) 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