Compare against None rather than basing off anything that evaluates true

This commit is contained in:
Kaithar 2015-02-05 17:28:45 +00:00
parent be9e00f316
commit 529f4f6ae2

View File

@ -408,7 +408,7 @@ class Merger(object):
crd[ret[nk]] = []
crd[ret[nk]].append(ret[self.num_fields-1])
else:
if not self.ignore_null or ret[self.num_fields-1]:
if not self.ignore_null or ret[self.num_fields-1] is not None:
crd[ret[nk]] = ret[self.num_fields-1]
else:
# Otherwise, the field name is the key but we have a spare.
@ -442,7 +442,7 @@ class Merger(object):
else:
crd[nk] = [crd[nk], ret[i]]
else:
if not self.ignore_null or ret[i]:
if not self.ignore_null or ret[i] is not None:
crd[nk] = ret[i]
# Get key list and work backwards. This is inner-out processing
ks = list(listify_dicts.keys())