Bug 776016 - Avoid Preprocessor.py warning when no commands are processed, but filters are. r=ted

This commit is contained in:
Mike Hommey 2012-07-25 07:44:08 +02:00
parent ea929b1b13
commit 2e928fd4c2
2 changed files with 10 additions and 6 deletions

View File

@ -126,11 +126,13 @@ class Preprocessor:
'file': self.context['FILE'],
'le': self.LE})
self.writtenLines = ln
aLine = self.applyFilters(aLine)
filteredLine = self.applyFilters(aLine)
if filteredLine != aLine:
self.actionLevel = 2
# ensure our line ending. Only need to handle \n, as we're reading
# with universal line ending support, at least for files.
aLine = re.sub('\n', self.LE, aLine)
self.out.write(aLine)
filteredLine = re.sub('\n', self.LE, filteredLine)
self.out.write(filteredLine)
def handleCommandLine(self, args, defaultToStdin = False):
"""

View File

@ -126,11 +126,13 @@ class Preprocessor:
'file': self.context['FILE'],
'le': self.LE})
self.writtenLines = ln
aLine = self.applyFilters(aLine)
filteredLine = self.applyFilters(aLine)
if filteredLine != aLine:
self.actionLevel = 2
# ensure our line ending. Only need to handle \n, as we're reading
# with universal line ending support, at least for files.
aLine = re.sub('\n', self.LE, aLine)
self.out.write(aLine)
filteredLine = re.sub('\n', self.LE, filteredLine)
self.out.write(filteredLine)
def handleCommandLine(self, args, defaultToStdin = False):
"""