質問編集履歴
1
実行結果を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,6 +72,52 @@
|
|
72
72
|
|
73
73
|
|
74
74
|
|
75
|
+
実行結果
|
76
|
+
|
77
|
+
キーボードからCtl-Cを入力するとキャッチできたのですが,
|
78
|
+
|
79
|
+
test.pyからのKeyboardInterruptはキャッチされませんでした。
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
>python mian.py
|
86
|
+
|
87
|
+
start
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
Traceback (most recent call last):
|
92
|
+
|
93
|
+
File "test.py", line 6, in <module>
|
94
|
+
|
95
|
+
raise KeyboardInterrupt
|
96
|
+
|
97
|
+
KeyboardInterrupt # ←test.pyのKeyboardInterrupt
|
98
|
+
|
99
|
+
catch # ←キーボードからCtl-C
|
100
|
+
|
101
|
+
start # ←再生成
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
Traceback (most recent call last):
|
106
|
+
|
107
|
+
File "print.py", line 6, in <module>
|
108
|
+
|
109
|
+
raise KeyboardInterrupt
|
110
|
+
|
111
|
+
KeyboardInterrupt
|
112
|
+
|
113
|
+
```
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
75
121
|
ちなみにtest.pyはwebサーバのようなもので,
|
76
122
|
|
77
123
|
常にリクエストを待っている状態で,
|