summaryrefslogtreecommitdiff
path: root/setuptools/lib2to3_ex.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
commit66a6724da8eda3336643dee086da2a3495e6422a (patch)
tree64043e9782491bde3a3a9ae2314cc59451a6c9c0 /setuptools/lib2to3_ex.py
parentdf3905616933c90af95e99f705b800a2f5c1c921 (diff)
parent35ea365b50bd1a64375fdbcce187affab22af3b7 (diff)
downloadpython-setuptools-git-setuptools-scm.tar.gz
Merge with mastersetuptools-scm
Diffstat (limited to 'setuptools/lib2to3_ex.py')
-rw-r--r--setuptools/lib2to3_ex.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py
index feef591a..c8632bc5 100644
--- a/setuptools/lib2to3_ex.py
+++ b/setuptools/lib2to3_ex.py
@@ -10,9 +10,12 @@ This module raises an ImportError on Python 2.
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
+
import setuptools
+
class DistutilsRefactoringTool(RefactoringTool):
+
def log_error(self, msg, *args, **kw):
log.error(msg, *args)
@@ -22,15 +25,17 @@ class DistutilsRefactoringTool(RefactoringTool):
def log_debug(self, msg, *args):
log.debug(msg, *args)
+
class Mixin2to3(_Mixin2to3):
- def run_2to3(self, files, doctests = False):
+
+ def run_2to3(self, files, doctests=False):
# See of the distribution option has been set, otherwise check the
# setuptools default.
if self.distribution.use_2to3 is not True:
return
if not files:
return
- log.info("Fixing "+" ".join(files))
+ log.info("Fixing " + " ".join(files))
self.__build_fixer_names()
self.__exclude_fixers()
if doctests:
@@ -41,7 +46,8 @@ class Mixin2to3(_Mixin2to3):
_Mixin2to3.run_2to3(self, files)
def __build_fixer_names(self):
- if self.fixer_names: return
+ if self.fixer_names:
+ return
self.fixer_names = []
for p in setuptools.lib2to3_fixer_packages:
self.fixer_names.extend(get_fixers_from_package(p))