Use expandtabs instead of expanding by hand.

This commit is contained in:
Jeremy Fincher 2004-02-14 01:32:39 +00:00
parent 4a086e67e4
commit d94b3f799e

View File

@ -53,7 +53,7 @@ class Reader(object):
if not line.strip(): if not line.strip():
continue continue
line = line.rstrip('\r\n') line = line.rstrip('\r\n')
line = line.replace('\t', ' '*8) line = line.expandtabs()
s = line.lstrip(' ') s = line.lstrip(' ')
indent = len(line) - len(s) indent = len(line) - len(s)
if indent != self.indent: if indent != self.indent:
@ -63,7 +63,6 @@ class Reader(object):
self.creator = self.Creator(*self.args, **self.kwargs) self.creator = self.Creator(*self.args, **self.kwargs)
self.modifiedCreator = False self.modifiedCreator = False
self.indent = indent self.indent = indent
(command, rest) = s.split(None, 1)
command = self.normalizeCommand(command) command = self.normalizeCommand(command)
self.modifiedCreator = True self.modifiedCreator = True
if hasattr(self.creator, command): if hasattr(self.creator, command):