소스 검색

Update 28_exception.py

blueloveTH 6 달 전
부모
커밋
6e9dd9516b
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      tests/28_exception.py

+ 11 - 0
tests/28_exception.py

@@ -190,6 +190,17 @@ except KeyError:
     x = 5
 assert x == 5
 
+a = []
+for i in range(6):
+    try:
+        [][1]
+    except IndexError:
+        if i == 2:
+            continue
+        else:
+            a.append(i)
+assert a == [0, 1, 3, 4, 5]
+
 """
 # finally, only
 def finally_only():