diff options
author | hut <hut@lavabit.com> | 2011-03-02 17:43:19 +0000 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-03-02 17:43:19 +0000 |
commit | c0337e68c464956903f29d1f93a4d8c9e7433a16 (patch) | |
tree | d2b43b7255ee6c0722b0951b7bb7cb0559c20469 | |
parent | 80b48cf5aedfd1329d1da01262278fdc5b0c8e90 (diff) | |
download | ranger-c0337e68c464956903f29d1f93a4d8c9e7433a16.tar.gz |
cleanups
-rw-r--r-- | ranger/core/runner.py | 7 | ||||
-rw-r--r-- | ranger/fsobject/file.py | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/runner.py b/ranger/core/runner.py index 376fd43c..fe8a0c25 100644 --- a/ranger/core/runner.py +++ b/ranger/core/runner.py @@ -38,7 +38,6 @@ from ranger.ext.waitpid_no_intr import waitpid_no_intr ALLOWED_FLAGS = 'sdpwSDPW' -devnull = open(os.devnull, 'a') def press_enter(): @@ -156,6 +155,7 @@ class Runner(object): toggle_ui = True pipe_output = False wait_for_enter = False + devnull = None popen_kws['args'] = action if 'shell' not in popen_kws: @@ -193,14 +193,15 @@ class Runner(object): try: process = Popen(**popen_kws) except Exception as e: - self._log(e) -# self._log("Failed to run: " + str(action)) + self._log("Failed to run: " + str(action)) else: if context.wait: waitpid_no_intr(process.pid) if wait_for_enter: press_enter() finally: + if devnull: + devnull.close() if toggle_ui: self._activate_ui(True) if pipe_output and process: diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py index 9fce3255..c24b560f 100644 --- a/ranger/fsobject/file.py +++ b/ranger/fsobject/file.py @@ -16,7 +16,6 @@ import re from ranger.fsobject import FileSystemObject from subprocess import Popen, PIPE -from ranger.core.runner import devnull from ranger.core.loader import CommandLoader N_FIRST_BYTES = 256 |