summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-03-02 17:43:19 +0000
committerhut <hut@lavabit.com>2011-03-02 17:43:19 +0000
commitc0337e68c464956903f29d1f93a4d8c9e7433a16 (patch)
treed2b43b7255ee6c0722b0951b7bb7cb0559c20469
parent80b48cf5aedfd1329d1da01262278fdc5b0c8e90 (diff)
downloadranger-c0337e68c464956903f29d1f93a4d8c9e7433a16.tar.gz
cleanups
-rw-r--r--ranger/core/runner.py7
-rw-r--r--ranger/fsobject/file.py1
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
akspecs/ranger/blame/TODO?h=v1.8.1&id=cd603ff4d0573c407c82f40cba9a164f7373585d'>^
23236d0c ^
08f21ae5 ^
4b826595 ^

ab65b353 ^

4be8b401 ^



d955e3f0 ^
75013dc7 ^
67bb838c ^
a808a661 ^
bba8d293 ^
ab65b353 ^

6f43de0a ^




fca1fc4f ^
ab65b353 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45