From: Jeremy Hylton Date: Wed, 23 Aug 2006 21:26:46 +0000 (+0000) Subject: Replace dead code with an assert. X-Git-Tag: v2.6a1~2749 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39c532c0b639b72384a5f5137d3fd5f7d127d814;p=thirdparty%2FPython%2Fcpython.git Replace dead code with an assert. Now that COMMENT tokens are reliably followed by NL or NEWLINE, there is never a need to add extra newlines in untokenize. --- diff --git a/Lib/tokenize.py b/Lib/tokenize.py index ec9f63c6b673..ca4dbf0f3e35 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -168,10 +168,7 @@ class Untokenizer: def add_whitespace(self, start): row, col = start - while row > self.prev_row: - print row, "<", self.prev_row - self.tokens.append("\n") - self.prev_row += 1 + assert row <= self.prev_row col_offset = col - self.prev_col if col_offset: self.tokens.append(" " * col_offset)