From: Colin Watson Date: Sun, 13 Apr 2014 09:49:56 +0000 (+0200) Subject: Test fileob and strob against None in RFC822Parser.__init__ rather than testing their... X-Git-Tag: archive/raspbian/10.2018112800+rpi1^2~62 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d03061aa56bf8f62db6c4fd31fc0e3a0a9b82cda;p=lsb.git 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 --- 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 = {}