summaryrefslogtreecommitdiff
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-09-03 00:42:04 +0200
committerÉric Araujo <merwok@netwok.org>2011-09-03 00:42:04 +0200
commitcfbd630a27c7ef31f6883dd21dbc4ece4d7b8bc4 (patch)
treed78b3484d054e5b277c98cdda60c83517d9ea3a7 /Lib/distutils/command/sdist.py
parent32e2915da5ab7c59e8cd0da68df9c8775ab4353c (diff)
downloadcpython-git-cfbd630a27c7ef31f6883dd21dbc4ece4d7b8bc4.tar.gz
Warn instead of crashing because of invalid path in MANIFEST.in (#8286).
sdist used to crash with a full traceback dump instead of printing a nice warning with the faulty line number.
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r--Lib/distutils/command/sdist.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 21ea61d96a..a9429a4296 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -306,7 +306,10 @@ class sdist(Command):
try:
self.filelist.process_template_line(line)
- except DistutilsTemplateError as msg:
+ # the call above can raise a DistutilsTemplateError for
+ # malformed lines, or a ValueError from the lower-level
+ # convert_path function
+ except (DistutilsTemplateError, ValueError) as msg:
self.warn("%s, line %d: %s" % (template.filename,
template.current_line,
msg))