summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorHouzéfa Abbasbhay <houzefa.abba@xcg-consulting.fr>2014-12-02 15:31:04 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2015-02-12 18:21:12 (GMT)
commitefc5429cfc8f8ee1ecc95ef9bf757b4168661bc8 (patch)
tree16011178d84fb0ce2f745dbbcba8fd4585dcb909 /bindings
parente325164c8a4171627841559a566029d2d9507d38 (diff)
downloadlasso-efc5429cfc8f8ee1ecc95ef9bf757b4168661bc8.zip
lasso-efc5429cfc8f8ee1ecc95ef9bf757b4168661bc8.tar.gz
lasso-efc5429cfc8f8ee1ecc95ef9bf757b4168661bc8.tar.bz2
Python 3: Fix a string conversion helper
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/lang.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bindings/python/lang.py b/bindings/python/lang.py
index 8f5ea59..7fa168e 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