summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-12-04 23:52:02 +0100
committerhut <hut@lavabit.com>2012-12-04 23:52:02 +0100
commitf08a597557eeae1ce94e2a28565b5a0f08cb93eb (patch)
treeb6cf4576ed46f287e55aad143f9fd115cb67329c
parent08cb47c2ec3d83690e61dedf5129fd07e30402e1 (diff)
downloadranger-f08a597557eeae1ce94e2a28565b5a0f08cb93eb.tar.gz
core.main: only import own commands if commands.py exists
-rw-r--r--ranger/core/main.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index dd07bff8..4af9495e 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -245,11 +245,12 @@ def load_settings(fm, clean):
 		allow_access_to_confdir(ranger.arg.confdir, True)
 
 		# Load custom commands
-		try:
-			import commands
-			fm.commands.load_commands_from_module(commands)
-		except ImportError:
-			pass
+		if os.path.exists(fm.confpath('commands.py')):
+			try:
+				import commands
+				fm.commands.load_commands_from_module(commands)
+			except ImportError:
+				pass
 
 		# Load rc.conf
 		custom_conf = fm.confpath('rc.conf')