mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Untokenize, bad assert: Merge with 3.3
This commit is contained in:
commit
8c8d77254f
2 changed files with 18 additions and 2 deletions
|
@ -229,7 +229,9 @@ class Untokenizer:
|
|||
|
||||
def add_whitespace(self, start):
|
||||
row, col = start
|
||||
assert row <= self.prev_row
|
||||
if row < self.prev_row or row == self.prev_row and col < self.prev_col:
|
||||
raise ValueError("start ({},{}) precedes previous end ({},{})"
|
||||
.format(row, col, self.prev_row, self.prev_col))
|
||||
col_offset = col - self.prev_col
|
||||
if col_offset:
|
||||
self.tokens.append(" " * col_offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue