summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-09-20 14:50:56 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2010-09-20 14:50:56 +0200
commitcc9b8ba30bb4cda175710e6eb3a80ddbb3fcdacd (patch)
tree91f0511f7beffe0215e43119af1b03142dc48404
parente4ca34a808e5f1ced28089f1564104623f0f2018 (diff)
downloadlogilab-common-cc9b8ba30bb4cda175710e6eb3a80ddbb3fcdacd.tar.gz
[py3k] umessage: not so trivial if we want to stay 2.4 compat
-rw-r--r--umessage.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/umessage.py b/umessage.py
index ac36029..ef92ba4 100644
--- a/umessage.py
+++ b/umessage.py
@@ -25,8 +25,14 @@ __docformat__ = "restructuredtext en"
import email
from encodings import search_function
-from email.utils import parseaddr, parsedate
-from email.header import decode_header
+import sys
+if sys.version_info >= (2, 5):
+ from email.utils import parseaddr, parsedate
+ from email.header import decode_header
+else:
+ from email.Utils import parseaddr, parsedate
+ from email.Header import decode_header
+
from datetime import datetime
try: