From efc5429cfc8f8ee1ecc95ef9bf757b4168661bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Houz=C3=A9fa=20Abbasbhay?= Date: Tue, 2 Dec 2014 16:31:04 +0100 Subject: [PATCH] Python 3: Fix a string conversion helper --- bindings/python/lang.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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