Test fileob and strob against None in RFC822Parser.__init__ rather than testing their...
authorColin Watson <cjwatson@ubuntu.com>
Sun, 13 Apr 2014 09:49:56 +0000 (11:49 +0200)
committerDidier Raboud <odyx@debian.org>
Sun, 13 Apr 2014 09:49:56 +0000 (11:49 +0200)
initdutils.py

index fb8c340e7cf651a501ca10a7cfd40f1ba1e1ee28..300ddb0deb8f347dcbb0d72ddd1db3865a205865 100644 (file)
@@ -11,7 +11,7 @@ class RFC822Parser(dict):
     __linere = re.compile(r'([^:]+):\s*(.*)$')
     
     def __init__(self, fileob=None, strob=None, startcol=0, basedict=None):
-        if not fileob and not strob:
+        if fileob is None and strob is None:
             raise ValueError('need a file or string')
         if not basedict:
             basedict = {}