Commits

Anonymous committed e0df7ed

Added hook for 2to3

  • Participants
  • Parent commits 40c002d

Comments (0)

Files changed (1)

 __svnauthor__ = '$Author$'[9:-2]
 __date__ = '$Date$'[7:-2]
 
+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
+
 from setuptools import setup, find_packages
 
 try:
 		'nose>=0.10',
 	],
 	test_suite = "nose.collector",
+	cmdclass=dict(build_py=build_py),
 )