FIX py3ing some print statements#3821
Conversation
|
buf.write(empty)i'm not sure if |
|
also there are quite a few of these try:
lotz_of_teh_codez
except Exception, e:
moar_codezwhich is a syntax error in py3, but somehow they never trigger errors... |
|
I think p to. 3 conversion changes these around so they work |
|
but for some reason the |
|
You'd think it would kick up a fuss immediately on looking at the file, rather than complain when it hits that line... weird. I'll replace those two lines with |
|
@hayd can u throw a context manager in there if there isn't one :) |
|
@cpcloud If you really want to make everything python 3 compatible, try running 2to3 with the |
|
there's so much annoying crap surrounding the python 2/3 issue. there's also so much extra kludge just to keep things compatible with both versions. and then you have to deal with cases in which the 2to3 tool doesn't work. i wish everyone would just move to python 3 and stop talking about it so that folks could solve real problems. of course most of science python people use 2.7 so that i unrealistic at the moment. i think probably using function |
|
@cpcloud updated with buf.write should be good to merge... |
|
Aaargh the buf.write doesn't work in py3, think I should just drop that, it's clearly being tested anyway (so not needed) - will remove this last commit. |
|
what doesn't work? |
|
but the good news is this was working in python 3 before anyhow (since changing it made previously passing tests fail). |
I just grepped where there was python 2 print statement. There are still some in vbench/scripts/ez_setup and sphinxext/src (as well as in the rst docs), but these are all all from the main codebase.
I don't know how to deal with the
print >>buf, emptyetc. (or whether we need to,I've only labelledthere's only the two of these).... ?I found one by trying to use py3 before building, where I got a
print esyntax error.