diff options
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 83bf3e3..71ec9c3 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -365,12 +365,14 @@ class SocketHandler(logging.Handler): self.retryMax = 30.0 self.retryFactor = 2.0 - def makeSocket(self): + def makeSocket(self, timeout=1): """ A factory method which allows subclasses to define the precise type of socket they want. """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + if hasattr(s, 'settimeout'): + s.settimeout(timeout) s.connect((self.host, self.port)) return s |