diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-02-07 13:06:51 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-02-07 13:06:51 (GMT) |
commit | 7ce5c831ccde730a201a9b7a95e5d54cd9b98285 (patch) | |
tree | 3a1af8f3017215d8580de2c63e9c9f4333d5e8b4 /Lib/logging/handlers.py | |
parent | 4dcba975900d21a84c14bf0cbc7c167839fcef9d (diff) | |
download | cpython-7ce5c831ccde730a201a9b7a95e5d54cd9b98285.zip cpython-7ce5c831ccde730a201a9b7a95e5d54cd9b98285.tar.gz cpython-7ce5c831ccde730a201a9b7a95e5d54cd9b98285.tar.bz2 |
logging: Removed some more 1.5.2 support code.
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 45b7cf6..8f890bc 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1,4 +1,4 @@ -# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -19,7 +19,7 @@ Additional handlers for the logging package for Python. The core package is based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. -Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved. To use, simply 'import logging.handlers' and log away! """ @@ -850,24 +850,6 @@ class SMTPHandler(logging.Handler): """ return self.subject - weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] - - monthname = [None, - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - - def date_time(self): - """ - Return the current date and time formatted for a MIME header. - Needed for Python 1.5.2 (no email package available) - """ - year, month, day, hh, mm, ss, wd, y, z = time.gmtime(time.time()) - s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( - self.weekdayname[wd], - day, self.monthname[month], year, - hh, mm, ss) - return s - def emit(self, record): """ Emit a record. @@ -876,10 +858,7 @@ class SMTPHandler(logging.Handler): """ try: import smtplib - try: - from email.utils import formatdate - except ImportError: - formatdate = self.date_time + from email.utils import formatdate port = self.mailport if not port: port = smtplib.SMTP_PORT |