arokem/python-matlab-bridge — pull request #79 by isbadawi (2014-08-11 15:58:29+00:00)
Title: Make codebase python3 compatible.

This should address #51.

These are the changes:

* Replaced `print` statements with calls to `print` function.
* For pyzmq, call `send_string` instead of `send`. More info here: http://zeromq.github.io/pyzmq/unicode.html
* Instead of referring to `unicode` and `unichr`, add a `compat.py` module that defines them appropriately based on python version. Could use [six](https://pythonhosted.org/six/) here, but since it was just these two things I didn't think it was worth the extra dependency.
* Finally, in one place there was an exception handler for `urllib2.URLError`, which doesn't exist in python3. I couldn't figure out the code path that throws this exception -- I tried running code on a non-started `Matlab` instance, and also starting a `Matlab` instance and killing the process manually, but neither triggered it. It was added in 79d2025a4ff173639acff3f02e634abc0b860ba4 -- maybe you remember what causes it? In the meantime I've replaced it with a bare `except`, which is not great.

I ran the tests with python 2.7.8 and python 3.4.1 and they all passed in both cases. Let me know if this looks fine.