Don't omit False flag values from serialization

This commit is contained in:
Lonami Exo 2021-03-07 16:01:31 +01:00
parent 42cc9e61fb
commit 8724949b54

View File

@ -426,6 +426,9 @@ def _write_arg_to_bytes(builder, arg, args, name=None):
# should NOT be sent either!
builder.write("b'' if {0} is None or {0} is False "
"else b''.join((", name)
elif 'Bool' == arg.type:
# `False` is a valid value for this type, so only check for `None`.
builder.write("b'' if {0} is None else (", name)
else:
builder.write("b'' if {0} is None or {0} is False "
"else (", name)