diff options
| author | hda (Tiny) <hda@tinyerp.com> | 2009-12-08 15:42:46 +0530 |
|---|---|---|
| committer | hda (Tiny) <hda@tinyerp.com> | 2009-12-08 15:42:46 +0530 |
| commit | 24cd74becf6df66c71cdafc9f8a41ffdde903aec (patch) | |
| tree | cf195d12fdbdbeadd6de930c93e54b01fa959a23 /bin/netsvc.py | |
| parent | a481bfb190667cd2fcb6335adf533afe6e1c8e2d (diff) | |
| parent | 474af4cd6e6f00759589c4bee9cebf9d7d26b0d8 (diff) | |
Merge
bzr revid: hda@tinyerp.com-20091208101246-5ave2zzgzsjqf0m8
Diffstat (limited to 'bin/netsvc.py')
| -rw-r--r-- | bin/netsvc.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/netsvc.py b/bin/netsvc.py index 66c4d9e3dea..c94317bce9a 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -331,7 +331,19 @@ class HttpDaemon(threading.Thread): def stop(self): self.running = False if os.name != 'nt': - self.server.socket.shutdown( hasattr(socket, 'SHUT_RDWR') and socket.SHUT_RDWR or 2 ) + try: + self.server.socket.shutdown( + hasattr(socket, 'SHUT_RDWR') and socket.SHUT_RDWR or 2) + except socket.error, e: + if e.errno != 57: raise + # OSX, socket shutdowns both sides if any side closes it + # causing an error 57 'Socket is not connected' on shutdown + # of the other side (or something), see + # http://bugs.python.org/issue4397 + Logger().notifyChannel( + 'server', LOG_DEBUG, + '"%s" when shutting down server socket, ' + 'this is normal under OS X'%e) self.server.socket.close() def run(self): |
