[Python-checkins] cpython (merge 3.3 -> default): Closes #16168: Merged SysLogHandler update from 3.3.

vinay.sajip python-checkins at python.org
Tue Oct 9 09:23:26 CEST 2012


http://hg.python.org/cpython/rev/d7d3e1a03fe0
changeset:   79610:d7d3e1a03fe0
parent:      79606:46889b772442
parent:      79609:e4212f81d633
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Tue Oct 09 08:23:06 2012 +0100
summary:
  Closes #16168: Merged SysLogHandler update from 3.3.

files:
  Lib/logging/handlers.py |  10 ++--------
  1 files changed, 2 insertions(+), 8 deletions(-)


diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -790,18 +790,12 @@
         self.formatter = None
 
     def _connect_unixsocket(self, address):
-        self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
-        # syslog may require either DGRAM or STREAM sockets
+        self.socket = socket.socket(socket.AF_UNIX, self.socktype)
         try:
             self.socket.connect(address)
         except socket.error:
             self.socket.close()
-            self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-            try:
-                self.socket.connect(address)
-            except socket.error:
-                self.socket.close()
-                raise
+            raise
 
     def encodePriority(self, facility, priority):
         """

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list