about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-31 06:24:22 +0200
committerhut <hut@lavabit.com>2010-03-31 06:24:22 +0200
commitecd0d38655bc2029679cbca030c2e0118ea35f4c (patch)
treec2f7e2ff29be5e5d661ae6337b6528020e51a08e
parent2b6374131b0b9a4bbadc377c256815ca2e2d7f89 (diff)
downloadranger-ecd0d38655bc2029679cbca030c2e0118ea35f4c.tar.gz
core.environment: stop enter_dir if os.chdir fails
-rw-r--r--ranger/core/environment.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
index cdca9782..89088c45 100644
--- a/ranger/core/environment.py
+++ b/ranger/core/environment.py
@@ -165,9 +165,12 @@ class Environment(SettingsAware):
 		except NoDirectoryGiven:
 			return False
 
+		try:
+			os.chdir(path)
+		except:
+			return True
 		self.path = path
 		self.cwd = new_cwd
-		os.chdir(path)
 
 		self.cwd.load_content_if_outdated()