@@ -98,9 +98,9 @@ class MH:
9898
9999 def __init__ (self , path = None , profile = None ):
100100 """Constructor."""
101- if not profile : profile = MH_PROFILE
101+ if profile is None : profile = MH_PROFILE
102102 self .profile = os .path .expanduser (profile )
103- if not path : path = self .getprofile ('Path' )
103+ if path is None : path = self .getprofile ('Path' )
104104 if not path : path = PATH
105105 if not os .path .isabs (path ) and path [0 ] != '~' :
106106 path = os .path .join ('~' , path )
@@ -665,7 +665,7 @@ def __init__(self, f, n, fp = None):
665665 """Constructor."""
666666 self .folder = f
667667 self .number = n
668- if not fp :
668+ if fp is None :
669669 path = f .getmessagefilename (n )
670670 fp = open (path , 'r' )
671671 mimetools .Message .__init__ (self , fp )
@@ -679,7 +679,7 @@ def getheadertext(self, pred = None):
679679 argument is specified, it is used as a filter predicate to
680680 decide which headers to return (its argument is the header
681681 name converted to lower case)."""
682- if not pred :
682+ if pred is None :
683683 return '' .join (self .headers )
684684 headers = []
685685 hit = 0
@@ -791,7 +791,7 @@ def __init__(self, data = None, sep = ',', rng = '-'):
791791 self .pairs = []
792792 self .sep = sep
793793 self .rng = rng
794- if data : self .fromstring (data )
794+ if data is not None : self .fromstring (data )
795795
796796 def reset (self ):
797797 self .pairs = []
0 commit comments