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

More py3k fixes

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