From 6b24dffd13155ccd8ff33a4ad788452c16953574 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Sun, 30 Jul 2000 01:47:16 +0000 Subject: [PATCH] Catch syntax errors from processing template lines and turn them into mere warnings. Call 'findall()' on our FileList object before we start using it seriously. --- Lib/distutils/command/sdist.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 4c2acf678fd..4765d7fa139 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -14,7 +14,7 @@ create_tree, remove_tree, newer, write_file, \ check_archive_formats from distutils.text_file import TextFile -from distutils.errors import DistutilsExecError, DistutilsOptionError +from distutils.errors import * from distutils.filelist import FileList @@ -227,6 +227,8 @@ def get_file_list (self): "(using default file list)") % self.template) + self.filelist.findall() + # Add default file set to 'files' if self.use_defaults: self.add_defaults() @@ -335,7 +337,12 @@ def read_template (self): if line is None: # end of file break - self.filelist.process_template_line(line) + try: + self.filelist.process_template_line(line) + except DistutilsTemplateError, msg: + self.warn("%s, line %d: %s" % (template.filename, + template.current_line, + msg)) # read_template ()