mirror of
https://github.com/python/cpython.git
synced 2025-08-18 07:41:05 +00:00
Merged revisions 82404 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r82404 | giampaolo.rodola | 2010-06-30 19:38:28 +0200 (mer, 30 giu 2010) | 1 line fix issue #6589: cleanup asyncore.socket_map if smtpd.SMTPServer constructor raises an exception ........
This commit is contained in:
parent
9f11f39758
commit
1daf7aa2b2
2 changed files with 18 additions and 9 deletions
|
@ -274,11 +274,17 @@ class SMTPServer(asyncore.dispatcher):
|
||||||
self._localaddr = localaddr
|
self._localaddr = localaddr
|
||||||
self._remoteaddr = remoteaddr
|
self._remoteaddr = remoteaddr
|
||||||
asyncore.dispatcher.__init__(self)
|
asyncore.dispatcher.__init__(self)
|
||||||
|
try:
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
# try to re-use a server port if possible
|
# try to re-use a server port if possible
|
||||||
self.set_reuse_addr()
|
self.set_reuse_addr()
|
||||||
self.bind(localaddr)
|
self.bind(localaddr)
|
||||||
self.listen(5)
|
self.listen(5)
|
||||||
|
except:
|
||||||
|
# cleanup asyncore.socket_map before raising
|
||||||
|
self.close()
|
||||||
|
raise
|
||||||
|
else:
|
||||||
print >> DEBUGSTREAM, \
|
print >> DEBUGSTREAM, \
|
||||||
'%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
|
'%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
|
||||||
self.__class__.__name__, time.ctime(time.time()),
|
self.__class__.__name__, time.ctime(time.time()),
|
||||||
|
|
|
@ -73,6 +73,9 @@ C-API
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
|
||||||
|
raises an exception.
|
||||||
|
|
||||||
- Issue #9125: Add recognition of 'except ... as ...' syntax to parser module.
|
- Issue #9125: Add recognition of 'except ... as ...' syntax to parser module.
|
||||||
|
|
||||||
- Issue #9085: email package version number bumped to its correct
|
- Issue #9085: email package version number bumped to its correct
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue