Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c01ffdf

Browse files
committed
revert unintended changes
1 parent 39530f8 commit c01ffdf

2 files changed

Lines changed: 1 addition & 18 deletions

File tree

Lib/lib2to3/refactor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def traverse_by(self, fixers, traversal):
500500
node = new
501501

502502
def processed_file(self, new_text, filename, old_text=None, write=False,
503-
encoding=None, newlines=None):
503+
encoding=None):
504504
"""
505505
Called when a file has been refactored, and there are changes.
506506
"""

Lib/lib2to3/tests/test_refactor.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,6 @@ def mock_refactor_file(self, f, *args):
231231
os.path.join("a_dir", "stuff.py")]
232232
check(tree, tree)
233233

234-
def test_preserve_file_newlines(self):
235-
rt = self.rt(fixers=_2TO3_FIXERS)
236-
for nl in ("\r\n", "\n"):
237-
data = "print y%s%syes%sok%s" % ((nl,) * 4)
238-
handle, tmp = tempfile.mkstemp()
239-
os.close(handle)
240-
try:
241-
with open(tmp, "w") as fp:
242-
fp.write(data)
243-
rt.refactor_file(tmp)
244-
with open(tmp, "r") as fp:
245-
contents = fp.read()
246-
finally:
247-
os.unlink(tmp)
248-
for line in contents.splitlines(True):
249-
self.assertTrue(line.endswith(nl))
250-
251234
def test_file_encoding(self):
252235
fn = os.path.join(TEST_DATA_DIR, "different_encoding.py")
253236
self.check_file_refactoring(fn)

0 commit comments

Comments
 (0)