summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-17 03:20:37 +0200
committerhut <hut@lavabit.com>2011-09-17 03:21:52 +0200
commita141cc469fef3ed23044b232be4bcd9417db6a69 (patch)
treee4b771c5c1963e6152842ac6a572404b2f92c847
parentd873a5604911659080acd7ba9788da6698641f4c (diff)
downloadranger-a141cc469fef3ed23044b232be4bcd9417db6a69.tar.gz
gui.widgets.console: fixed error canceling nonexistent command
Thanks to Joshua <veedrac> for pointing it out.
-rw-r--r--ranger/gui/widgets/console.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index a575405d..00d6828b 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -125,7 +125,7 @@ class Console(Widget):
 
 	def close(self, trigger_cancel_function=True):
 		if trigger_cancel_function:
-			cmd = self._get_cmd()
+			cmd = self._get_cmd(quiet=True)
 			if cmd:
 				try:
 					cmd.cancel()
@@ -324,11 +324,12 @@ class Console(Widget):
 		if self.allow_close:
 			self.close(trigger_cancel_function=False)
 
-	def _get_cmd(self):
+	def _get_cmd(self, quiet=False):
 		try:
 			command_class = self._get_cmd_class()
 		except KeyError:
-			self.fm.notify("Invalid command! Press ? for help.", bad=True)
+			if not quiet:
+				self.fm.notify("Invalid command! Press ? for help.", bad=True)
 		except:
 			return None
 		else: