Jason R. Coombs <jar...@jaraco.com> added the comment: I found a workaround by excluding the "import" fixer that seems to work.
For the example, > 2to3 -x import abs_imp_test The command still modifies main, but it only removes the __future__ directive and doesn't modify the imports. For my real-world package, which is using distutils, I added the following to get a build_py that will run 2to3: try: from distutils.command.build_py import build_py_2to3 as build_py # exclude some fixers that break already compatible code from lib2to3.refactor import get_fixers_from_package fixers = get_fixers_from_package('lib2to3.fixes') for skip_fixer in ['import']: fixers.remove('lib2to3.fixes.fix_' + skip_fixer) build_py.fixer_names = fixers except ImportError: from distutils.command.build_py import build_py This works because the entire package is already using absolute imports wherever they are relevant, so removing the import fixer is appropriate. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8358> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com