diff options
author | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-10-04 21:08:36 (GMT) |
---|---|---|
committer | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-10-04 21:08:36 (GMT) |
commit | 977c707b425ee753d54f3e9010f07ec77ef61274 (patch) | |
tree | 580e12fd41103a684b4c24b53d43569eb69bc6a8 /Lib/smtpd.py | |
parent | 4c94c5363091350ed56bfbdbc6cc00e1048b456c (diff) | |
download | cpython-977c707b425ee753d54f3e9010f07ec77ef61274.zip cpython-977c707b425ee753d54f3e9010f07ec77ef61274.tar.gz cpython-977c707b425ee753d54f3e9010f07ec77ef61274.tar.bz2 |
Fix issue 6706: adds new handle_accepted() method to asyncore.dispatcher
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-x | Lib/smtpd.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py index 179a1b9..23787fd 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -421,21 +421,7 @@ class SMTPServer(asyncore.dispatcher): self.__class__.__name__, time.ctime(time.time()), localaddr, remoteaddr), file=DEBUGSTREAM) - def handle_accept(self): - try: - conn, addr = self.accept() - except TypeError: - # sometimes accept() might return None - return - except socket.error as err: - # ECONNABORTED might be thrown - if err.args[0] != errno.ECONNABORTED: - raise - return - else: - # sometimes addr == None instead of (ip, port) - if addr == None: - return + def handle_accepted(self, conn, addr): print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM) channel = self.channel_class(self, conn, addr) |