]> granicus.if.org Git - python/commitdiff
revert unintended changes
authorBenjamin Peterson <benjamin@python.org>
Sat, 26 Mar 2011 23:11:54 +0000 (18:11 -0500)
committerBenjamin Peterson <benjamin@python.org>
Sat, 26 Mar 2011 23:11:54 +0000 (18:11 -0500)
Lib/lib2to3/refactor.py
Lib/lib2to3/tests/test_refactor.py

index 30aea631b95b3bb67a4e6c9ffcf3ee74e271adb7..7d00d12f9d8054654da9214e7aba5a7a4f0b696c 100644 (file)
@@ -500,7 +500,7 @@ class RefactoringTool(object):
                         node = new
 
     def processed_file(self, new_text, filename, old_text=None, write=False,
-                       encoding=None, newlines=None):
+                       encoding=None):
         """
         Called when a file has been refactored, and there are changes.
         """
index ed759551394615e4015f4400780352821b16876d..3eecde8cfb667a3963f6973d2c0bac63a6bf0ec9 100644 (file)
@@ -231,23 +231,6 @@ from __future__ import print_function"""
                 os.path.join("a_dir", "stuff.py")]
         check(tree, tree)
 
-    def test_preserve_file_newlines(self):
-        rt = self.rt(fixers=_2TO3_FIXERS)
-        for nl in ("\r\n", "\n"):
-            data = "print y%s%syes%sok%s" % ((nl,) * 4)
-            handle, tmp = tempfile.mkstemp()
-            os.close(handle)
-            try:
-                with open(tmp, "w") as fp:
-                    fp.write(data)
-                rt.refactor_file(tmp)
-                with open(tmp, "r") as fp:
-                    contents = fp.read()
-            finally:
-                os.unlink(tmp)
-            for line in contents.splitlines(True):
-                self.assertTrue(line.endswith(nl))
-
     def test_file_encoding(self):
         fn = os.path.join(TEST_DATA_DIR, "different_encoding.py")
         self.check_file_refactoring(fn)