Mercurial > cpython-lru_cache-weakref
diff Lib/distutils/command/sdist.py @ 51684:27268ef04708 legacy-trunk
#2279 added the plain path case for data_files
| author | Tarek Ziadé <ziade.tarek@gmail.com> |
|---|---|
| date | Tue, 17 Feb 2009 09:42:44 +0000 |
| parents | 982f9e2925a4 |
| children | 92e42b1b0a6e |
line wrap: on
line diff
--- a/Lib/distutils/command/sdist.py Tue Feb 17 08:33:01 2009 +0000 +++ b/Lib/distutils/command/sdist.py Tue Feb 17 09:42:44 2009 +0000 @@ -14,7 +14,7 @@ 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 @@ -311,9 +311,17 @@ # 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')
