From d03061aa56bf8f62db6c4fd31fc0e3a0a9b82cda Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 13 Apr 2014 11:49:56 +0200 Subject: [PATCH] Test fileob and strob against None in RFC822Parser.__init__ rather than testing their truth value, to avoid a misleading error in the case of a file with no LSB headers --- initdutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initdutils.py b/initdutils.py index fb8c340..300ddb0 100644 --- a/initdutils.py +++ b/initdutils.py @@ -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 = {} -- 2.30.2