]> arthur.barton.de Git - bup.git/blobdiff - main.py
main: fix problem when redirecting to newliner on MacOS X.
[bup.git] / main.py
diff --git a/main.py b/main.py
index 34871e20ef8e71679037a106875ea0374ffd8aec..4d8ea1f3547260dd293590de64ae4317eadff301 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -99,12 +99,12 @@ if fix_stdout or fix_stderr:
     n = subprocess.Popen([subpath('newliner')],
                          stdin=subprocess.PIPE, stdout=os.dup(realf),
                          close_fds=True, preexec_fn=force_tty)
-    outf = fix_stdout and n.stdin.fileno() or 1
-    errf = fix_stderr and n.stdin.fileno() or 2
+    outf = fix_stdout and n.stdin.fileno() or None
+    errf = fix_stderr and n.stdin.fileno() or None
 else:
     n = None
-    outf = 1
-    errf = 2
+    outf = None
+    errf = None
 
 
 class SigException(Exception):
@@ -116,6 +116,7 @@ signal.signal(signal.SIGTERM, handler)
 signal.signal(signal.SIGINT, handler)
 
 ret = 95
+p = None
 try:
     try:
         p = subprocess.Popen([subpath(subcmd)] + argv[2:],