Skip to content

Conversation

isbadawi
Copy link
Collaborator

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 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 79d2025 -- 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.

@arokem
Copy link
Owner

arokem commented Aug 14, 2014

I think that this URLError is actually a remnant from the previous webserver model of pymatbridge. I am currently trying things out, to see what we should replace this with.

@arokem
Copy link
Owner

arokem commented Aug 18, 2014

OK - I couldn't get that error to be raised, no matter what I tried. Let's go with deprecating it, unless we start running into it again. Other than that - looks good! Thanks for doing this

arokem added a commit that referenced this pull request Aug 18, 2014
Make codebase python3 compatible.
@arokem arokem merged commit 6e5a211 into arokem:master Aug 18, 2014
@isbadawi isbadawi deleted the python3 branch August 18, 2014 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants