I'm looking for a way to convert obsolete %
string formatting operator to format()
function in python3 code.
ugly = 'Exception: the %s is over %+f' % (t, value)
good = 'Exception: the {} is over {:+f}'.format(e, value)
Sure, I use autopep8 on save (via PyDev), but it seems that there is no option for turning on desirable conversion. The closest is an W690
option:
W690 - Fix various deprecated code (via lib2to3).
But it does not work, as well as explicit run of lib2to3. Any solutions are welcome; better if the tool can be integrated into eclipse / pydev, like autopep8
.