1 class A: 2 pass 3 4 def f(x): 5 try: 6 try: 7 y = x.attr 8 except AttributeError, e: 9 f = e 10 except Exception, e: 11 f = e 12 return f 13 14 x = A() 15 f(x)