Commit fa2cffe2 authored by Luke Macken's avatar Luke Macken

ipc: Catch exceptions when trying to close the sockets

parent dd1f927a
......@@ -24,6 +24,7 @@ import stat
import socket
import struct
import tempfile
import traceback
import subprocess
import platform
......@@ -205,10 +206,13 @@ class PyrasiteIPC(object):
return data
def close(self):
if self.sock:
self.sock.close()
if getattr(self, 'server_sock', None):
self.server_sock.close()
try:
if self.sock:
self.sock.close()
if getattr(self, 'server_sock', None):
self.server_sock.close()
except:
traceback.print_exc()
def __repr__(self):
return "<%s %s>" % (self.__class__.__name__, self.pid)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment