Message219376
| Author |
tholzer |
| Recipients |
flox, gregory.p.smith, meishao, neologix, pitrou, tholzer, vstinner |
| Date |
2014年05月30日.01:37:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1401413866.74.0.422427254484.issue20611@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
And a test case for smtplib:
import threading
import signal
import os
import smtplib
def go():
running = True
pid = os.getpid()
def killer():
while running:
os.kill(pid, signal.SIGINT)
signal.signal(signal.SIGINT, lambda x,y: None)
thread = threading.Thread(target=killer)
thread.start()
while 1:
try:
smtplib.SMTP('localhost')
except Exception, ex:
running = False
raise
if __name__ == '__main__':
go()
Fails with:
socket.error: [Errno 4] Interrupted system call |
|