diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-09-28 14:37:55 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-09-28 14:37:55 (GMT) |
commit | d8b509b192a67f0f217ae52ed81fc91bc27a1818 (patch) | |
tree | adab8922723e179e67d546100d19d06d444d7599 /Lib/lib2to3 | |
parent | a6e50f589fa328a77b70cde0747f70210c650f49 (diff) | |
download | cpython-d8b509b192a67f0f217ae52ed81fc91bc27a1818.zip cpython-d8b509b192a67f0f217ae52ed81fc91bc27a1818.tar.gz cpython-d8b509b192a67f0f217ae52ed81fc91bc27a1818.tar.bz2 |
#13012: use splitlines(keepends=True/False) instead of splitlines(0/1).
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r-- | Lib/lib2to3/refactor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py index ae5e40f..3c06405 100644 --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -560,7 +560,7 @@ class RefactoringTool(object): block_lineno = None indent = None lineno = 0 - for line in input.splitlines(True): + for line in input.splitlines(keepends=True): lineno += 1 if line.lstrip().startswith(self.PS1): if block is not None: @@ -604,7 +604,7 @@ class RefactoringTool(object): filename, lineno, err.__class__.__name__, err) return block if self.refactor_tree(tree, filename): - new = str(tree).splitlines(True) + new = str(tree).splitlines(keepends=True) # Undo the adjustment of the line numbers in wrap_toks() below. clipped, new = new[:lineno-1], new[lineno-1:] assert clipped == ["\n"] * (lineno-1), clipped |