pythonpython-3.xpython-2to3

python 2to3: How to selectively enable fixers and only do one or two of them?


I am using 2to3 to update some python2 code. Unfortunately there is some fixers I do not like:

For Python 2to3, how do you disable all fixers and only do one or two fixers? For example if you just want to run print fixer"?


Solution

  • You just have to do:

    2to3 --fix print your_file.py