We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2674d56 commit c08ea28Copy full SHA for c08ea28
pytest_localserver/smtp.py
@@ -166,18 +166,13 @@ def main():
166
print("Type <Ctrl-C> to stop")
167
168
try:
169
-
170
- try:
171
- while True:
172
- time.sleep(1)
173
- finally:
174
- print("\rstopping...")
175
- server.stop()
176
+ while True:
+ time.sleep(1)
177
except KeyboardInterrupt:
178
- # support for Python 2.4 dictates that try ... finally is not used
179
- # together with any except statements
180
pass
+ finally:
+ print("\rstopping...")
+ server.stop()
181
182
183
if __name__ == "__main__": # pragma: no cover
0 commit comments