summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-02-17 09:42:44 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-02-17 09:42:44 (GMT)
commitf68b5b804675326fb05e20b3f327bd774fa95d09 (patch)
treed6e95a2f8b5fae075bcc022914edc62193d52df6 /Lib/distutils/command/sdist.py
parentf746a1f1e4b84d0389cdc1c795171d2ad4944bac (diff)
downloadcpython-f68b5b804675326fb05e20b3f327bd774fa95d09.zip
cpython-f68b5b804675326fb05e20b3f327bd774fa95d09.tar.gz
cpython-f68b5b804675326fb05e20b3f327bd774fa95d09.tar.bz2
#2279 added the plain path case for data_files
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r--Lib/distutils/command/sdist.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 291e812..a1a0fb7 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -14,7 +14,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
@@ -311,9 +311,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')