[Python-checkins] r54726 - python/trunk/Lib/logging/handlers.py

vinay.sajip python-checkins at python.org
Mon Apr 9 18:16:14 CEST 2007


Author: vinay.sajip
Date: Mon Apr  9 18:16:10 2007
New Revision: 54726

Modified:
   python/trunk/Lib/logging/handlers.py
Log:
Added optional timeout to SocketHandler.makeSocket (SF #1695948)

Modified: python/trunk/Lib/logging/handlers.py
==============================================================================
--- python/trunk/Lib/logging/handlers.py	(original)
+++ python/trunk/Lib/logging/handlers.py	Mon Apr  9 18:16:10 2007
@@ -361,12 +361,14 @@
         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
 


More information about the Python-checkins mailing list