summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>1999-01-18 17:08:16 (GMT)
committerGreg Ward <gward@python.net>1999-01-18 17:08:16 (GMT)
commitf6cdcd509df1681b2f27e8a4f9130159c8e13723 (patch)
treedbba39d895129348f20c6e35377dd1371eb97492 /Lib
parent7eca8e5017d1c940e83901f02af3b683e42c731c (diff)
downloadcpython-f6cdcd509df1681b2f27e8a4f9130159c8e13723.zip
cpython-f6cdcd509df1681b2f27e8a4f9130159c8e13723.tar.gz
cpython-f6cdcd509df1681b2f27e8a4f9130159c8e13723.tar.bz2
Added 'warn' method.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/text_file.py11
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 = ''