Closed ravenexp closed 6 months ago
Out of curiosity - you say it is broken - is this observed empirically, or just assumed? I did test and develop this script in both python2 and python3 form initially, and as far as I remember, there hasn't been all that many bigger changes on top it since that. It'd be interesting to know at which point it did break. (Not that python2->3 transitional knowledge is all that valuable any longer...)
I have not tested it with python2
because that needs python2-six
and python2-simplejson
packages my distro no longer provides. My assumption was based on the observation that both six.print_("")
and print()
functions are being used, but only the former works in Python 2, since print
is a special statement in v2.
I have not tested it with
python2
because that needspython2-six
andpython2-simplejson
packages my distro no longer provides. My assumption was based on the observation that bothsix.print_("")
andprint()
functions are being used, but only the former works in Python 2, since
I think you're mistaken here. Yes, print
was one of the things that changed between Python 2 and 3, but in Python 2, you could do either print "foo"
or print("foo")
, while only the latter form works in Python 3. I don't remember offhand in which cases six.print()
was needed though, perhaps only for some more special cases.
I just tested on my local distro, where I had these python 2 packages still left around, and the script does seem to work just fine, like it did before.
So I don't mind the change in itself, but please edit the commit message, to not incorrectly label it as broken. But the Python 2 support is indeed untested/unmaintained going forward.
Oh, you are right! I have not written any Python 2 code myself, so it was all based on what I've read somewhere. I'll replace "broken" -> "unmaintained" everywhere.
Python 3 style print functions are already used throughout the codebase, and only a few places use six. Python 2 compatibility is not longer there.
Use the standard
json
module in place ofsimplejson
.