fixed basestring check for 2/3 compatibility

This commit is contained in:
bharnden 2019-06-02 19:23:49 -07:00
parent ecc63f4abb
commit 3de37f0f5e
5 changed files with 10 additions and 6 deletions

View file

@ -3,6 +3,7 @@ Utilities for working with python struct data.
"""
import logging
from past.builtins import basestring
def pack_values(clazz, packers):
@ -29,7 +30,7 @@ def pack_values(clazz, packers):
# 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):
if value is None or (isinstance(value, basestring) and not value):
continue
# transform values as needed