summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2018-05-20 23:20:36 +0200
committerJonathan Slenders <jonathan@slenders.be>2018-05-20 23:20:36 +0200
commit86afd7ad7b0373028c2e99a85f4719ca42757c02 (patch)
tree96eae9cf901f22976e4171f8ed6c7ab707641ec3
parent89bb836ab0e48e1a47746d65a9bd0919550ea50e (diff)
Python 2 bugfix in switch-between-vi-emacs example.
-rwxr-xr-xexamples/prompts/switch-between-vi-emacs.py1
-rw-r--r--prompt_toolkit/key_binding/key_bindings.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/prompts/switch-between-vi-emacs.py b/examples/prompts/switch-between-vi-emacs.py
index 533c92fc..dc0edd8d 100755
--- a/examples/prompts/switch-between-vi-emacs.py
+++ b/examples/prompts/switch-between-vi-emacs.py
@@ -3,6 +3,7 @@
Example that displays how to switch between Emacs and Vi input mode.
"""
+from __future__ import unicode_literals
from prompt_toolkit import prompt
from prompt_toolkit.application.current import get_app
from prompt_toolkit.enums import EditingMode
diff --git a/prompt_toolkit/key_binding/key_bindings.py b/prompt_toolkit/key_binding/key_bindings.py
index 0941ab20..e3af537a 100644
--- a/prompt_toolkit/key_binding/key_bindings.py
+++ b/prompt_toolkit/key_binding/key_bindings.py
@@ -331,7 +331,7 @@ def _check_and_expand_key(key):
key = ' '
# Final validation.
- assert isinstance(key, text_type)
+ assert isinstance(key, text_type), 'Got %r' % (key, )
if len(key) != 1 and key not in ALL_KEYS:
raise ValueError('Invalid key: %s' % (key, ))