Commits

Joe Amenta committed 21d5839

Testing a few cases where a one-line funcdef is turned into a suite.
Also fixing the detection for whether or not a fix is needed to exclude (..., *args, **kwargs)

Comments (0)

Files changed (2)

lib3to2/fixes/fix_kwargs.py

     found_kwargs = False
     needs_fix = False
 
-    for t in raw_params:
+    for t in raw_params[2:]:
         if t.type == token.COMMA:
             # Commas are irrelevant at this stage.
             continue

lib3to2/tests/test_kwargs.py

 
     def test_basic_unchanged(self):
         s = """
-        def spam(ham, eggs):
-            funky()"""
+        def spam(ham, eggs): funky()"""
         self.unchanged(s)
 
 
     def test_args_kwargs_unchanged(self):
         s = """
-        def spam(ham, *args, **kwargs):
-            funky()"""
+        def spam(ham, *args, **kwargs): funky()"""
         self.unchanged(s)
 
 
     def test_args_named_pos(self):
         b = """
-        def spam(ham, *args, eggs, monkeys):
-            funky()"""
+        def spam(ham, *args, eggs, monkeys): funky()"""
         a = """
         def spam(ham, *args, **_3to2kwargs):
             monkeys = _3to2kwargs['monkeys']; del _3to2kwargs['monkeys']
 
     def test_args_named_pos_catchall(self):
         b = """
-        def spam(ham, *args, eggs, monkeys, **stuff):
-            funky()"""
+        def spam(ham, *args, eggs, monkeys, **stuff): funky()"""
         a = """
         def spam(ham, *args, **stuff):
             monkeys = stuff['monkeys']; del stuff['monkeys']