t485.trans 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Module(body=[TryExcept(body=[Assert(test=Compare(left=Num(n=1),
  2. ops=[Gt()],
  3. comparators=[Num(n=10)]),
  4. msg=None)],
  5. handlers=[ExceptHandler(type=Name(id='AssertionError',
  6. ctx=Load()),
  7. name=None,
  8. body=[Print(dest=None,
  9. values=[Str(s='Caught AssertionError')],
  10. nl=True)]),
  11. ExceptHandler(type=None,
  12. name=None,
  13. body=[Print(dest=None,
  14. values=[Str(s='Did not catch AssertionError')],
  15. nl=True)])],
  16. orelse=[]),
  17. TryExcept(body=[Print(dest=None,
  18. values=[Attribute(value=Name(id='None',
  19. ctx=Load()),
  20. attr='notAnAttribute',
  21. ctx=Load())],
  22. nl=True)],
  23. handlers=[ExceptHandler(type=Name(id='AttributeError',
  24. ctx=Load()),
  25. name=None,
  26. body=[Print(dest=None,
  27. values=[Str(s='Caught AttributeError')],
  28. nl=True)]),
  29. ExceptHandler(type=None,
  30. name=None,
  31. body=[Print(dest=None,
  32. values=[Str(s='Did not catch AttributeError')],
  33. nl=True)])],
  34. orelse=[]),
  35. TryExcept(body=[Import(names=[alias(name='notAModule',
  36. asname=None)])],
  37. handlers=[ExceptHandler(type=Name(id='ImportError',
  38. ctx=Load()),
  39. name=None,
  40. body=[Print(dest=None,
  41. values=[Str(s='Caught ImportError')],
  42. nl=True)]),
  43. ExceptHandler(type=None,
  44. name=None,
  45. body=[Print(dest=None,
  46. values=[Str(s='Did not catch ImportError')],
  47. nl=True)])],
  48. orelse=[]),
  49. TryExcept(body=[Print(dest=None,
  50. values=[Subscript(value=List(elts=[Num(n=0),
  51. Num(n=1),
  52. Num(n=2),
  53. Num(n=3),
  54. Num(n=4)],
  55. ctx=Load()),
  56. slice=Index(value=Num(n=5)),
  57. ctx=Load())],
  58. nl=True)],
  59. handlers=[ExceptHandler(type=Name(id='IndexError',
  60. ctx=Load()),
  61. name=None,
  62. body=[Print(dest=None,
  63. values=[Str(s='Caught IndexError')],
  64. nl=True)]),
  65. ExceptHandler(type=None,
  66. name=None,
  67. body=[Print(dest=None,
  68. values=[Str(s='Did not catch IndexError')],
  69. nl=True)])],
  70. orelse=[]),
  71. TryExcept(body=[Print(dest=None,
  72. values=[Subscript(value=Dict(keys=[Num(n=1),
  73. Num(n=3)],
  74. values=[Num(n=2),
  75. Num(n=4)]),
  76. slice=Index(value=Num(n=5)),
  77. ctx=Load())],
  78. nl=True)],
  79. handlers=[ExceptHandler(type=Name(id='KeyError',
  80. ctx=Load()),
  81. name=None,
  82. body=[Print(dest=None,
  83. values=[Str(s='Caught KeyError')],
  84. nl=True)]),
  85. ExceptHandler(type=None,
  86. name=None,
  87. body=[Print(dest=None,
  88. values=[Str(s='Did not catch KeyError')],
  89. nl=True)])],
  90. orelse=[]),
  91. TryExcept(body=[Print(dest=None,
  92. values=[Name(id='x',
  93. ctx=Load())],
  94. nl=True)],
  95. handlers=[ExceptHandler(type=Name(id='NameError',
  96. ctx=Load()),
  97. name=None,
  98. body=[Print(dest=None,
  99. values=[Str(s='Caught NameError')],
  100. nl=True)]),
  101. ExceptHandler(type=None,
  102. name=None,
  103. body=[Print(dest=None,
  104. values=[Str(s='Did not catch NameError')],
  105. nl=True)])],
  106. orelse=[]),
  107. TryExcept(body=[Print(dest=None,
  108. values=[BinOp(left=Num(n=1e-64),
  109. op=Pow(),
  110. right=Num(n=-30))],
  111. nl=True)],
  112. handlers=[ExceptHandler(type=Name(id='OverflowError',
  113. ctx=Load()),
  114. name=None,
  115. body=[Print(dest=None,
  116. values=[Str(s='Caught OverflowError')],
  117. nl=True)]),
  118. ExceptHandler(type=None,
  119. name=None,
  120. body=[Print(dest=None,
  121. values=[Str(s='Did not catch OverflowError')],
  122. nl=True)])],
  123. orelse=[]),
  124. TryExcept(body=[Expr(value=BinOp(left=Str(s='10'),
  125. op=Div(),
  126. right=Str(s='1')))],
  127. handlers=[ExceptHandler(type=Name(id='TypeError',
  128. ctx=Load()),
  129. name=None,
  130. body=[Print(dest=None,
  131. values=[Str(s='Caught TypeError')],
  132. nl=True)]),
  133. ExceptHandler(type=None,
  134. name=None,
  135. body=[Print(dest=None,
  136. values=[Str(s='Did not catch TypeError')],
  137. nl=True)])],
  138. orelse=[]),
  139. TryExcept(body=[Print(dest=None,
  140. values=[Call(func=Attribute(value=Str(s='hello'),
  141. attr='index',
  142. ctx=Load()),
  143. args=[Str(s='S')],
  144. keywords=[],
  145. starargs=None,
  146. kwargs=None)],
  147. nl=True)],
  148. handlers=[ExceptHandler(type=Name(id='ValueError',
  149. ctx=Load()),
  150. name=None,
  151. body=[Print(dest=None,
  152. values=[Str(s='Caught ValueError')],
  153. nl=True)]),
  154. ExceptHandler(type=None,
  155. name=None,
  156. body=[Print(dest=None,
  157. values=[Str(s='Did not catch ValueError')],
  158. nl=True)])],
  159. orelse=[]),
  160. TryExcept(body=[Print(dest=None,
  161. values=[BinOp(left=Num(n=1),
  162. op=Div(),
  163. right=Num(n=0))],
  164. nl=True)],
  165. handlers=[ExceptHandler(type=Name(id='ZeroDivisionError',
  166. ctx=Load()),
  167. name=None,
  168. body=[Print(dest=None,
  169. values=[Str(s='Caught ZeroDivisionError')],
  170. nl=True)]),
  171. ExceptHandler(type=None,
  172. name=None,
  173. body=[Print(dest=None,
  174. values=[Str(s='Did not catch ZeroDivisionError')],
  175. nl=True)])],
  176. orelse=[])])