From fb154171c4ace44dec817a3e52a0b83bbbb0f4f5 Mon Sep 17 00:00:00 2001
From: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Date: Tue, 24 Aug 2004 09:36:23 +0000
Subject: Fixed bug in DatagramHandler.send()

---
 Lib/logging/handlers.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 2cb1fb0..559404f 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -450,6 +450,8 @@ class DatagramHandler(SocketHandler):
         when the network is busy - UDP does not guarantee delivery and
         can deliver packets out of sequence.
         """
+        if self.sock is None:
+            self.createSocket()
         self.sock.sendto(s, (self.host, self.port))
 
 class SysLogHandler(logging.Handler):
-- 
cgit v0.12

