[Python-checkins] cpython (2.7): revert unintended changes
benjamin.peterson
python-checkins at python.org
Sun Mar 27 00:17:01 CET 2011
http://hg.python.org/cpython/rev/4f07cacb2c3b
changeset: 68996:4f07cacb2c3b
branch: 2.7
parent: 68994:206129719e7c
user: Benjamin Peterson <benjamin at python.org>
date: Sat Mar 26 18:11:54 2011 -0500
summary:
revert unintended changes
files:
Lib/lib2to3/refactor.py | 2 +-
Lib/lib2to3/tests/test_refactor.py | 17 -----------------
2 files changed, 1 insertions(+), 18 deletions(-)
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
@@ -500,7 +500,7 @@
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
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/lib2to3/tests/test_refactor.py
@@ -231,23 +231,6 @@
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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list