summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2018-06-05 22:50:03 +0200
committerJonathan Slenders <jonathan@slenders.be>2018-06-05 22:50:03 +0200
commitdc2282d17a9d132e0049545f0ccc2c778b5c3143 (patch)
tree4bc1ad6100c5c0f8287a61d25d23b574492cf545
parenta54fc0bd7579b11e290ccd4d70037d68c92f7be3 (diff)
Python 2 bugfix. Handle string/unicode correctly in to_str.
-rw-r--r--prompt_toolkit/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/prompt_toolkit/utils.py b/prompt_toolkit/utils.py
index 062fc7b1..46a13fcc 100644
--- a/prompt_toolkit/utils.py
+++ b/prompt_toolkit/utils.py
@@ -7,7 +7,7 @@ import threading
import weakref
from functools import partial
-from six import PY2
+from six import PY2, text_type
from six.moves import range
from wcwidth import wcwidth
from .cache import memoized
@@ -304,7 +304,7 @@ def to_str(value):
if callable(value):
return to_str(value())
else:
- return str(value)
+ return text_type(value)
def to_int(value):