nmbug-status: Use email.utils instead of rfc822
authorW. Trevor King <wking@tremily.us>
Mon, 10 Feb 2014 18:40:23 +0000 (10:40 -0800)
committerDavid Bremner <david@tethera.net>
Tue, 11 Feb 2014 01:03:12 +0000 (21:03 -0400)
rfc822 has been deprecated since Python 2.3, and it's gone in
Python 3 [1].

[1]: http://docs.python.org/2/library/rfc822.html

devel/nmbug/nmbug-status

index b1feee9f32b412fdbd22314d6af05936634be9c4..6525176478d2155d274f63184d3c3057b8ace25e 100755 (executable)
@@ -9,7 +9,7 @@
 from __future__ import print_function
 
 import datetime
-import rfc822
+import email.utils
 import urllib
 import json
 import argparse
@@ -128,7 +128,7 @@ def print_view(title, query, comment):
                 val = str.join(' ', val.split(None)[1:4])
                 val = str(datetime.datetime.strptime(val, '%d %b %Y').date())
             elif header == 'from':
-                (val, addr) = rfc822.parseaddr(val)
+                (val, addr) = email.utils.parseaddr(val)
                 if val == '':
                     val = addr.split('@')[0]