summary refs log tree commit diff stats
path: root/ranger/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/command.py')
-rw-r--r--ranger/command.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ranger/command.py b/ranger/command.py
index c57edba0..bd11dd70 100644
--- a/ranger/command.py
+++ b/ranger/command.py
@@ -42,14 +42,17 @@ class CommandList():
 
 	def str_to_tuple(self, obj):
 		"""splits a string into a tuple of integers"""
-		if type(obj) == tuple:
+		if isinstance(obj, tuple):
 			return obj
-		elif type(obj) == str:
+		elif isinstance(obj, str):
 			return tuple(map(ord, list(obj)))
+		elif isinstance(obj, int):
+			return (obj, )
 		else:
 			raise TypeError('need a str or a tuple for str_to_tuple')
 	
 	def bind(self, fnc, *keys):
+		if len(keys) == 0: return
 		keys = tuple(map(self.str_to_tuple, keys))
 		cmd = Command(fnc, keys)
 		cmd.commandlist = self