diff options
-rw-r--r-- | setuptools/command/build_py.py | 9 | ||||
-rw-r--r-- | setuptools/dist.py | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py index dd99b9d6..2413b420 100644 --- a/setuptools/command/build_py.py +++ b/setuptools/command/build_py.py @@ -23,6 +23,9 @@ try: def run_2to3(self, files, doctests = False): if not setuptools.run_2to3: return + if not files: + return + log.info("Fixing "+" ".join(files)) if not self.fixer_names: self.fixer_names = [] for p in setuptools.lib2to3_fixer_packages: @@ -126,8 +129,10 @@ class build_py(_build_py, Mixin2to3): for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) - outf, copied = self.copy_file(os.path.join(src_dir, filename), target) - if copied and filename in setuptools.convert_doctests_2to3: + srcfile = os.path.join(src_dir, filename) + outf, copied = self.copy_file(srcfile, target) + srcfile = os.path.abspath(srcfile) + if copied and srcfile in self.distribution.convert_doctests_2to3: self.__doctests_2to3.append(outf) diff --git a/setuptools/dist.py b/setuptools/dist.py index c2e57f4b..f295ca4e 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -255,6 +255,11 @@ class Distribution(_Distribution): if value is not None: ep.require(installer=self.fetch_build_egg) ep.load()(self, ep.name, value) + if self.convert_doctests_2to3: + # XXX may convert to set here when we can rely on set being builtin + self.convert_doctests_2to3 = [os.path.abspath(p) for p in self.convert_doctests_2to3] + else: + self.convert_doctests_2to3 = [] def fetch_build_egg(self, req): """Fetch an egg needed for building""" |