Commits

Benjamin Peterson  committed 627fb41

revert unintended change

  • Participants
  • Parent commits a5123b3

Comments (0)

Files changed (2)

File lib2to3/fixer_util.py

     if does_tree_import(package, name, root):
         return
 
-    # 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
     for idx, node in enumerate(root.children):
         if not is_import_stmt(node):

File lib2to3/tests/test_fixers.py

 if isinstance(do_stuff, Callable):
     assert isinstance(do_stuff, collections.Callable)
     do_stuff(do_stuff)
+    if not isinstance(do_stuff, collections.Callable):
+        exit(1)
+    else:
+        assert isinstance(do_stuff, collections.Callable)
+else:
+    assert not isinstance(do_stuff, collections.Callable)"""[1:]
+        self.check(b, a)
+        
+    def test_callable_should_not_change(self):
+        a = """callable(*x)"""
+        self.unchanged(a)
+
+        a = """callable(x, y)"""
+        self.unchanged(a)
+
+        a = """callable(x, kw=y)"""
+        self.unchanged(a)
+
+        a = """callable()"""
+        self.unchanged(a)
+
+class Test_filter(FixerTestCase):
     fixer = "filter"
 
     def test_prefix_preservation(self):