Code

python2.3 compatibility fixes
[roundup.git] / roundup / anypy / email_.py
1 try:
2     # Python 2.5+
3     from email.parser import FeedParser
4 except ImportError:
5     # Python 2.4
6     try :
7         from email.Parser import FeedParser
8     except ImportError:
9         from email.Parser import Parser
10         class FeedParser:
11             def __init__(self):
12                 self.content = []
14             def feed(self, s):
15                 self.content.append(s)
17             def close(self):
18                 p = Parser()
19                 return p.parsestr(''.join(self.content))