summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-18 16:22:59 +0200
committerhut <hut@lavabit.com>2010-06-18 16:22:59 +0200
commitb289f6796ef213a83595db77c06b7586cdbcb730 (patch)
tree38fe630ec436d1cf50917a75d85f9f90596b10a2 /ranger
parent26962ded19264ae1885386783c861d002d8fd1dc (diff)
downloadranger-b289f6796ef213a83595db77c06b7586cdbcb730.tar.gz
main: catch SystemExit and return the exit value
Diffstat (limited to 'ranger')
-rw-r--r--ranger/__main__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index a03509cf..a3e0ef1c 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -212,6 +212,8 @@ def main():
 	except Exception:
 		import traceback
 		crash_traceback = traceback.format_exc()
+	except SystemExit as error:
+		return error.args[0]
 	finally:
 		try:
 			fm.ui.destroy()
@@ -222,6 +224,8 @@ def main():
 			print("Ranger crashed.  " \
 					"Please report this (including the traceback) at:")
 			print("http://savannah.nongnu.org/bugs/?group=ranger&func=additem")
+			return 1
+		return 0
 
 
 if __name__ == '__main__':