Use bool(x) instead of 1 if x else 0.
This commit is contained in:
parent
580b82c353
commit
d7980400cb
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue