diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-02-17 09:47:25 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-02-17 09:47:25 (GMT) |
commit | a30337aa3bc7c5fcd1ede713068de1bc30a32ccb (patch) | |
tree | 19afaac65c416184ac9068f1673ffed7fcd64e35 /Lib/distutils/command | |
parent | 33dbf46544ebdb30b80b5321c7e393b1e0ccfeb2 (diff) | |
download | cpython-a30337aa3bc7c5fcd1ede713068de1bc30a32ccb.zip cpython-a30337aa3bc7c5fcd1ede713068de1bc30a32ccb.tar.gz cpython-a30337aa3bc7c5fcd1ede713068de1bc30a32ccb.tar.bz2 |
Merged revisions 69710 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69710 | tarek.ziade | 2009-02-17 10:42:44 +0100 (Tue, 17 Feb 2009) | 1 line
#2279 added the plain path case for data_files
........
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/sdist.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index c057b66..9bb2ae0 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -15,7 +15,7 @@ from distutils.text_file import TextFile from distutils.errors import * from distutils.filelist import FileList from distutils import log - +from distutils.util import convert_path def show_formats (): """Print all possible values for the 'formats' option (used by @@ -303,9 +303,17 @@ class sdist (Command): # getting distribution.data_files if self.distribution.has_data_files(): - for dirname, filenames in self.distribution.data_files: - for filename in filenames: - self.filelist.append(os.path.join(dirname, filename)) + for item in self.distribution.data_files: + if isinstance(item, str): # plain file + item = convert_path(item) + if os.path.isfile(item): + self.filelist.append(item) + else: # a (dirname, filenames) tuple + dirname, filenames = item + for f in filenames: + f = convert_path(os.path.join(dirname, f)) + if os.path.isfile(f): + self.filelist.append(f) if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') |