mstorsjo / msvc-wine

Scripts for setting up and running MSVC in Wine on Linux
Other
627 stars 80 forks source link

Drop unmaintained Python 2 support via six #117

Closed ravenexp closed 6 months ago

ravenexp commented 6 months ago

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 of simplejson.

ravenexp commented 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.

mstorsjo commented 6 months ago

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

ravenexp commented 6 months ago

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.