diff options
author | hut <hut@lavabit.com> | 2011-09-28 23:19:52 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-09-28 23:19:52 +0200 |
commit | 0da832e8c47261fed2e91463699f6505ba3269fa (patch) | |
tree | e115359fb27b7b5497fbc95995b02d85ea9c333f | |
parent | dc27af1255a285bc5387e00dc459f55043a4c092 (diff) | |
download | ranger-0da832e8c47261fed2e91463699f6505ba3269fa.tar.gz |
shortened ranger.py
-rwxr-xr-x | ranger.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ranger.py b/ranger.py index f4962093..0991b451 100755 --- a/ranger.py +++ b/ranger.py @@ -34,7 +34,7 @@ return 1 """ import sys -import os.path +from os.path import exists, normpath, abspath # Need to find out whether or not the flag --clean was used ASAP, # because --clean is supposed to disable bytecode compilation @@ -45,11 +45,8 @@ sys.dont_write_bytecode = '-c' in argv or '--clean' in argv __doc__ = """Ranger - file browser for the unix terminal""" # Don't import ./ranger when running an installed binary at /usr/bin/ranger -if os.path.exists('ranger') and '/' in os.path.normpath(__file__): - try: - sys.path.remove(os.path.abspath('.')) - except: - pass +if exists('ranger') and '/' in normpath(__file__) and abspath('.') in sys.path: + sys.path.remove(abspath('.')) # Start ranger import ranger |