diff options
-rw-r--r-- | Lib/distutils/text_file.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/distutils/text_file.py b/Lib/distutils/text_file.py index 9fff941..9e1a73b 100644 --- a/Lib/distutils/text_file.py +++ b/Lib/distutils/text_file.py @@ -9,7 +9,7 @@ lines, and joining lines with backslashes.""" __revision__ = "$Id$" from types import * -import os, string, re +import sys, os, string, re class TextFile: @@ -67,6 +67,15 @@ class TextFile: self.current_line = None + def warn (self, msg): + sys.stderr.write (self.filename + ", ") + if type (self.current_line) is ListType: + sys.stderr.write ("lines %d-%d: " % tuple (self.current_line)) + else: + sys.stderr.write ("line %d: " % self.current_line) + sys.stderr.write (msg + "\n") + + def readline (self): buildup_line = '' |