t274.trans 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Module(body=[ClassDef(name='X',
  2. bases=[],
  3. body=[Pass()],
  4. decorator_list=[]),
  5. Assign(targets=[Name(id='x',
  6. ctx=Store())],
  7. value=Call(func=Name(id='X',
  8. ctx=Load()),
  9. args=[],
  10. keywords=[],
  11. starargs=None,
  12. kwargs=None)),
  13. Assign(targets=[Name(id='methodName',
  14. ctx=Store())],
  15. value=Str(s='wee')),
  16. TryExcept(body=[Assign(targets=[Name(id='stuff',
  17. ctx=Store())],
  18. value=Call(func=Name(id='getattr',
  19. ctx=Load()),
  20. args=[Name(id='x',
  21. ctx=Load()),
  22. Name(id='methodName',
  23. ctx=Load())],
  24. keywords=[],
  25. starargs=None,
  26. kwargs=None))],
  27. handlers=[ExceptHandler(type=Name(id='AttributeError',
  28. ctx=Load()),
  29. name=None,
  30. body=[Raise(type=Name(id='ValueError',
  31. ctx=Load()),
  32. inst=BinOp(left=Str(s='no such method in %s: %s'),
  33. op=Mod(),
  34. right=Tuple(elts=[Attribute(value=Name(id='x',
  35. ctx=Load()),
  36. attr='__class__',
  37. ctx=Load()),
  38. Name(id='methodName',
  39. ctx=Load())],
  40. ctx=Load())),
  41. tback=None)])],
  42. orelse=[])])