@@ -575,6 +575,10 @@ def f(*args, **kwargs):
575575 self .assertEqual (f (spam = 'fried' , ** {'eggs' :'scrambled' }),
576576 ((), {'eggs' :'scrambled' , 'spam' :'fried' }))
577577
578+ # Check ast errors in *args and *kwargs
579+ check_syntax_error (self , "f(*g(1=2))" )
580+ check_syntax_error (self , "f(**g(1=2))" )
581+
578582 # argument annotation tests
579583 def f (x ) -> list : pass
580584 self .assertEqual (f .__annotations__ , {'return' : list })
@@ -616,10 +620,6 @@ def f(x=1): return closure
616620 def f (* , k = 1 ): return closure
617621 def f () -> int : return closure
618622
619- # Check ast errors in *args and *kwargs
620- check_syntax_error (self , "f(*g(1=2))" )
621- check_syntax_error (self , "f(**g(1=2))" )
622-
623623 # Check trailing commas are permitted in funcdef argument list
624624 def f (a ,): pass
625625 def f (* args ,): pass
@@ -1091,7 +1091,6 @@ def test_try(self):
10911091 try : 1 / 0
10921092 except EOFError : pass
10931093 except TypeError as msg : pass
1094- except RuntimeError as msg : pass
10951094 except : pass
10961095 else : pass
10971096 try : 1 / 0
@@ -1200,7 +1199,7 @@ def test_selectors(self):
12001199 d [1 ,2 ] = 3
12011200 d [1 ,2 ,3 ] = 4
12021201 L = list (d )
1203- L .sort (key = lambda x : x if isinstance ( x , tuple ) else ( ))
1202+ L .sort (key = lambda x : ( type ( x ). __name__ , x ))
12041203 self .assertEqual (str (L ), '[1, (1,), (1, 2), (1, 2, 3)]' )
12051204
12061205 def test_atoms (self ):
0 commit comments