aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-03-26 18:11:54 -0500
committerBenjamin Peterson <benjamin@python.org>2011-03-26 18:11:54 -0500
commitc01ffdf61e33b87c3e5e91a722e27c888ed607ad (patch)
treed9a97fcac2184cabb89361754146d02346677989 /Lib
parentalways check return value of PyObject_IsInstance for error (diff)
downloadcpython-c01ffdf61e33b87c3e5e91a722e27c888ed607ad.tar.gz
cpython-c01ffdf61e33b87c3e5e91a722e27c888ed607ad.tar.bz2
cpython-c01ffdf61e33b87c3e5e91a722e27c888ed607ad.zip
revert unintended changes
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib2to3/refactor.py2
-rw-r--r--Lib/lib2to3/tests/test_refactor.py17
2 files changed, 1 insertions, 18 deletions
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
index ca07be6b5b1..ae5e40f0d26 100644
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
@@ -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.
"""
diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py
index b6d5b576267..73122d87b45 100644
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/lib2to3/tests/test_refactor.py
@@ -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)