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.
This commit is contained in:
Éric Araujo 2011-09-03 00:42:04 +02:00
parent 32e2915da5
commit cfbd630a27
3 changed files with 34 additions and 2 deletions

View file

@ -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))