modernize
modernize copied to clipboard
Add support for the --output-dir and --add-suffix options from 2to3
These options were added to 2to3 in Python 2.7 and 3.2. This commit adds the options always, with descriptive errors if the user attempts to use them with a version of Python that is too old.
Most of the code here was shamelessly stolen from lib2to3's source.
I note that Python 2.6 and 3.0<=Python<=3.3 are no longer supported by the project (according to the travis config), so the code may be simplified by just assuming the newer versions.
Another alternative I considered was to only add the options where they can be handled. I decided against it in the interest of discoverability, but if the decision is to keep some support for older Pythons, that is also a valid way to go.
Yep, I think it's OK to simplify it and assume it's run by a moderately recent Python version.
@shaib there were some changes with code style, and we now use fissix and py>=3.6 and so we can be sure these flags always exist
Should this PR be updated for fissix or closed?
FWIW I no longer have interest in this PR.