scp-fs2open / wxLauncher

wxLauncher
Other
26 stars 12 forks source link

Python 3.x compatibility #127

Closed asarium closed 8 years ago

asarium commented 8 years ago

This shouldn't break python 2 compatibility but I would appreciate it if that could be tested.

MageKing17 commented 8 years ago

It won't break Py2 compatibility. If you wanted to do it "properly", you could always do from __future__ import print_function, but it's not strictly necessary when you're not actually using any of the functionality of the print function and just want to make sure the same code executes in Py2 and Py3.

IssMneur commented 8 years ago

Yeah, it seems to be fine, I just tried it on 2.7.11 and 2.6.6. However, I would rather we do it correctly with the import from future. I also would be shocked if the print function is the only thing preventing the python code in this project working correctly on python3.

MageKing17 commented 8 years ago

It's not that shocking; print function and outdated exception syntax are the most common incompatibilities, with renamed libraries following close behind (although that's from personal experience, not any kind of hard statistics); I assumed @asarium tested this with py3 before opening the PR in the first place, but if he didn't and it doesn't work, I should be able to fix it up to be properly polymorphic.

asarium commented 8 years ago

I tested it with py3 on Windows and that was the only thing that needed to be changed.

MageKing17 commented 8 years ago

In that case, LGTM.