diff options
-rwxr-xr-x | ranger.py | 10 | ||||
-rw-r--r-- | ranger/__main__.py | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ranger.py b/ranger.py index c2e067a2..3d0f4525 100755 --- a/ranger.py +++ b/ranger.py @@ -33,6 +33,16 @@ fi return 1 """ +import sys + +# When using the --clean option, not even bytecode should be written. +# Need to find out if --clean is used as soon as possible. +try: + argv = sys.argv[0:sys.argv.index('--')] +except: + argv = sys.argv +sys.dont_write_bytecode = '-c' in argv or '--clean' in argv + # Set the actual docstring __doc__ = """Ranger - file browser for the unix terminal""" diff --git a/ranger/__main__.py b/ranger/__main__.py index 4cdf1488..2efec4df 100644 --- a/ranger/__main__.py +++ b/ranger/__main__.py @@ -167,10 +167,7 @@ def main(): os.environ['SHELL'] = 'bash' arg = parse_arguments() - if arg.clean: - sys.dont_write_bytecode = True - # Need to decide whether to write bytecode or not before importing. import ranger from ranger.ext import curses_interrupt_handler from ranger.core.runner import Runner |