diff --git a/bindings/python/lang.py b/bindings/python/lang.py index 8f5ea594..7fa168ed 100644 --- a/bindings/python/lang.py +++ b/bindings/python/lang.py @@ -124,7 +124,8 @@ def cptrToPy(cptr): return o def str2lasso(s): - if isinstance(s, unicode): + if s is not None and not isinstance(s, str): + # Assume this is a Python 2 unicode string. return s.encode('utf-8') return s