about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-01 19:21:32 +0200
committerhut <hut@lavabit.com>2011-10-01 19:21:32 +0200
commit488245cb940a029ca751ea06748c881c11a32d2d (patch)
tree11ab32b8f2fa651ef60f7ab0b2ce30370a22179d
parent6110c8cc1bb26eaf8564976e796c301ce4ef4861 (diff)
downloadranger-488245cb940a029ca751ea06748c881c11a32d2d.tar.gz
ext.keybindings: Fix unicode keybindings in python3
-rw-r--r--ranger/ext/keybindings.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/ext/keybindings.py b/ranger/ext/keybindings.py
index dd831836..133da83b 100644
--- a/ranger/ext/keybindings.py
+++ b/ranger/ext/keybindings.py
@@ -15,6 +15,9 @@
 
 from ranger.ext.keybinding_parser import (parse_keybinding,
 	ANYKEY, PASSIVE_ACTION, QUANT_KEY)
+import sys
+
+PY3 = sys.version > '3'
 
 digits = set(range(ord('0'), ord('9')+1))
 
@@ -29,6 +32,8 @@ class KeyMaps(dict):
 			pointer = self[context]
 		except:
 			self[context] = pointer = dict()
+		if PY3:
+			keys = keys.encode('utf-8').decode('latin-1')
 		keys = list(parse_keybinding(keys))
 		if not keys:
 			return