diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-05-24 17:06:31 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-05-24 17:06:31 (GMT) |
commit | a7cdb0f218b991f7d8c8f45af0e4f975673ee351 (patch) | |
tree | 67ce8429c6d31d2c93c2bd7bfa98e4fff5bfc843 /Lib/socketserver.py | |
parent | 7b54e7562d44826947d2e5167dcfdc7b91a7f181 (diff) | |
download | cpython-a7cdb0f218b991f7d8c8f45af0e4f975673ee351.zip cpython-a7cdb0f218b991f7d8c8f45af0e4f975673ee351.tar.gz cpython-a7cdb0f218b991f7d8c8f45af0e4f975673ee351.tar.bz2 |
generally, sockets should be closed after they're used
Diffstat (limited to 'Lib/socketserver.py')
-rw-r--r-- | Lib/socketserver.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 76ac50a..c53ac29 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -532,13 +532,14 @@ class ForkingMixIn: else: # Child process. # This must never return, hence os._exit()! - self.socket.close() try: self.finish_request(request, client_address) + self.socket.close() os._exit(0) except: try: self.handle_error(request, client_address) + self.socket.close() finally: os._exit(1) |