summaryrefslogtreecommitdiff
path: root/Lib/lib2to3/fixer_util.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-12-28 23:50:41 +0000
committerBenjamin Peterson <benjamin@python.org>2009-12-28 23:50:41 +0000
commitabb42744997bd9ea3e6891259d056e4ea89e409c (patch)
tree2b8703d9a632bd757f139ab138e97582bd35d9cc /Lib/lib2to3/fixer_util.py
parent0d19eaf1eb1d4c110d4ec6826a5b30343b63e7e6 (diff)
downloadcpython-git-abb42744997bd9ea3e6891259d056e4ea89e409c.tar.gz
Merged revisions 76871-76872,77093-77095,77097-77101 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r76871 | benjamin.peterson | 2009-12-17 20:49:21 -0600 (Thu, 17 Dec 2009) | 1 line handle unencodable diffs gracefully #5093 ........ r76872 | benjamin.peterson | 2009-12-17 20:51:37 -0600 (Thu, 17 Dec 2009) | 1 line fix emacs header ........ r77093 | benjamin.peterson | 2009-12-28 14:43:32 -0600 (Mon, 28 Dec 2009) | 7 lines replace callable(x) with isinstance(x, collections.Callable) #7006 This is a more accurate translation than hasattr(x, '__call__') which failed in the case that somebody had put __call__ in the instance dictionary. Patch mostly by Joe Amenta. ........ r77094 | benjamin.peterson | 2009-12-28 14:45:13 -0600 (Mon, 28 Dec 2009) | 2 lines deuglify imports ........ r77095 | benjamin.peterson | 2009-12-28 14:49:23 -0600 (Mon, 28 Dec 2009) | 1 line remove unused flag ........ r77097 | benjamin.peterson | 2009-12-28 16:12:13 -0600 (Mon, 28 Dec 2009) | 2 lines clean up imports and whitespace ........ r77098 | benjamin.peterson | 2009-12-28 16:43:35 -0600 (Mon, 28 Dec 2009) | 1 line *** empty log message *** ........ r77099 | benjamin.peterson | 2009-12-28 16:45:10 -0600 (Mon, 28 Dec 2009) | 1 line revert unintended change ........ r77100 | benjamin.peterson | 2009-12-28 16:53:21 -0600 (Mon, 28 Dec 2009) | 1 line revert unintended changes ........ r77101 | benjamin.peterson | 2009-12-28 17:46:02 -0600 (Mon, 28 Dec 2009) | 1 line normalize whitespace ........
Diffstat (limited to 'Lib/lib2to3/fixer_util.py')
-rw-r--r--Lib/lib2to3/fixer_util.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/Lib/lib2to3/fixer_util.py b/Lib/lib2to3/fixer_util.py
index 0d9327811d..3b136694a6 100644
--- a/Lib/lib2to3/fixer_util.py
+++ b/Lib/lib2to3/fixer_util.py
@@ -291,8 +291,6 @@ def touch_import(package, name, node):
if does_tree_import(package, name, root):
return
- add_newline_before = False
-
# figure out where to insert the new import. First try to find
# the first import and then skip to the last one.
insert_pos = offset = 0
@@ -312,7 +310,6 @@ def touch_import(package, name, node):
if node.type == syms.simple_stmt and node.children and \
node.children[0].type == token.STRING:
insert_pos = idx + 1
- add_newline_before
break
if package is None:
@@ -324,8 +321,6 @@ def touch_import(package, name, node):
import_ = FromImport(package, [Leaf(token.NAME, name, prefix=u' ')])
children = [import_, Newline()]
- if add_newline_before:
- children.insert(0, Newline())
root.insert_child(insert_pos, Node(syms.simple_stmt, children))