Hi, I would run the scripts through the 2to3 tool (https://docs.python.org/3.8/library/2to3.html) and then do a diff to see what it changes. I haven't looked at the scripts but if they stick to mostly standard library modules it should definitely be possible to make them compatible with both Python 2 and 3. It'll depend on what they do of course but for example you can do something like this to work around different module imports:
try # maybe Python 3 module is available? import _foo as foo except ImportError: # must be Python 2 import foo Just something to consider. Regards, Alex Barbur On Tue, Jun 30, 2020, at 6:40 AM, Jiri Svoboda wrote: > Hi, > > I upgraded to Fedora 32, which has Python 3 as the system default python. > tools/ew.py stopped working because module thread does not exist in Python 3 > (was renamed to _thread). I don't know if it's possible to make it work both > with Python 2 and Python 3. All our python scripts run system default Python > (whether it is 2 or 3). > > Anybody knows what is the right approach to solving this? Somehow make the > script work with both versions (how?). Request Python 2 explicitly? Change it > to work with Python 3 and request Python3 explicitly? > > Any suggestions from somebody more knowledgeable in our Python scripts? > > Thanks, > Jiri > _______________________________________________ > HelenOS-devel mailing list > [email protected] > http://lists.modry.cz/listinfo/helenos-devel >
_______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
