From 9bc5d95c8e9536cde4589f125857cb214523bbff Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 26 Jan 2010 19:17:58 +0100 Subject: ranger.py: improved handling of bad import --- ranger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger.py b/ranger.py index 00941750..6d07f608 100755 --- a/ranger.py +++ b/ranger.py @@ -55,7 +55,8 @@ try: from ranger import main except ImportError as errormessage: - if str(errormessage).endswith("main"): + import sys + if not set(sys.argv) & set(('--debug', '-d')): print("Can't import the main module.") print("To run an uninstalled copy of ranger,") print("launch ranger.py in the top directory.") -- cgit 1.4.1-2-gfad0