Use bool(x) instead of 1 if x else 0.

This commit is contained in:
Ethan Dalool 2020-03-23 19:54:41 -07:00
parent 580b82c353
commit d7980400cb

View file

@ -517,7 +517,7 @@ class Mega:
'total' : the maximum space allowed with current plan 'total' : the maximum space allowed with current plan
All storage space are in bytes unless asked differently. All storage space are in bytes unless asked differently.
""" """
if sum(1 if x else 0 for x in (kilo, mega, giga)) > 1: if sum(bool(x) for x in (kilo, mega, giga)) > 1:
raise ValueError("Only one unit prefix can be specified") raise ValueError("Only one unit prefix can be specified")
unit_coef = 1 unit_coef = 1
if kilo: if kilo: