Commit ab7aeda2 authored by André Anjos's avatar André Anjos 💬

More py3k fixes

parent 5cbaac6a
......@@ -317,7 +317,7 @@ def main(user_input=None):
message = [
status,
execution_process.job_id,
content
content.encode(),
]
elif 'error' in result:
logger.error(result['error'])
......@@ -327,7 +327,7 @@ def main(user_input=None):
execution_process.job_id,
]
message += result['details']
message += [k.encode() for k in result['details']]
else:
logger.error(result['system_error'])
......@@ -335,7 +335,7 @@ def main(user_input=None):
message = [
WorkerController.ERROR,
execution_process.job_id,
result['system_error']
result['system_error'].encode(),
]
send_multipart(socket, message)
......@@ -390,8 +390,12 @@ def main(user_input=None):
parts = [
WorkerController.ERROR,
b"Unknown job: %s" % job_id
<<<<<<< HEAD
]
send_multipart(socket, parts)
=======
])
>>>>>>> More py3k fixes
continue
# Kill the processing thread
......
......@@ -90,7 +90,7 @@ def test_plot_png():
#with open('test.png', 'wb') as f: f.write(fig)
def skip_plot_jpeg():
def test_plot_jpeg():
# disabled test: matplotlib on 'defaults' is not compiled against libjpeg
fig = do_plot('image/jpeg')
nose.tools.eq_(imghdr.what('test.jpg', fig), 'jpeg')
......
......@@ -365,7 +365,7 @@ class TestConnection(TestWorkerBase):
self.start_worker(WORKER1, 'tcp://127.0.0.1:50999')
message = controller.queue.get()
self.assertEqual(message, 'READY %s' % WORKER1)
self.assertEqual(message, 'READY ' + WORKER1.decode())
controller.queue.put('STOP')
......@@ -378,7 +378,7 @@ class TestConnection(TestWorkerBase):
self.assertEqual(message, 'STARTED')
message = controller.queue.get()
self.assertEqual(message, 'READY %s' % WORKER1)
self.assertEqual(message, 'READY ' + WORKER1.decode())
controller.queue.put('STOP')
......@@ -529,7 +529,7 @@ class TestOneWorker(TestWorkerBase):
self.assertEqual(worker, WORKER1)
self.assertEqual(status, WorkerController.ERROR)
self.assertTrue(job_id is None)
self.assertEqual(data[0], b"Unknown job: 1")
self.assertEqual(data[0].decode(), "Unknown job: 1")
#----------------------------------------------------------
......
......@@ -36,6 +36,7 @@ requirements:
- six
- beat.backend.python
- matplotlib
- pillow
test:
requires:
......
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