updates to support 2/3 along with not using vcmd c extension

This commit is contained in:
bharnden 2019-06-02 19:06:25 -07:00
parent 864c7b69a1
commit ecc63f4abb
22 changed files with 680 additions and 636 deletions

View file

@ -15,7 +15,8 @@ def pack_values(clazz, packers):
"""
# iterate through tuples of values to pack
data = ""
logging.debug("packing: %s", packers)
data = b""
for packer in packers:
# check if a transformer was provided for valid values
transformer = None
@ -26,10 +27,6 @@ def pack_values(clazz, packers):
else:
raise RuntimeError("packer had more than 3 arguments")
# convert unicode to normal str for packing
if isinstance(value, unicode):
value = str(value)
# only pack actual values and avoid packing empty strings
# protobuf defaults to empty strings and does no imply a value to set
if value is None or (isinstance(value, str) and not value):