X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=main.py;h=19675cd109e897e31fd718452ce21e3dc1e9daab;hb=9ab8ad0b239de1cb788a069ff00c2ec94dd05490;hp=edb3ed88fa4196cafa26e81be957d08c634684fd;hpb=c40b3dd5fd74e72024fbaad3daf5a958aefa1c54;p=bup.git diff --git a/main.py b/main.py index edb3ed8..19675cd 100755 --- a/main.py +++ b/main.py @@ -8,10 +8,9 @@ exec "$bup_python" "$0" ${1+"$@"} from __future__ import absolute_import import errno, re, sys, os, subprocess, signal, getopt -from fcntl import F_GETFL, F_SETFL from subprocess import PIPE from sys import stderr, stdout -import fcntl, select +import select argv = sys.argv exe = os.path.realpath(argv[0]) @@ -170,7 +169,8 @@ def print_clean_line(dest, content, width, sep=None): os.write(dest, content) if len(content) < width: os.write(dest, ' ' * (width - len(content))) - os.write(dest, sep) + if sep: + os.write(dest, sep) def filter_output(src_out, src_err, dest_out, dest_err): """Transfer data from src_out to dest_out and src_err to dest_err via @@ -187,9 +187,6 @@ def filter_output(src_out, src_err, dest_out, dest_err): pending_ex = None try: fds = tuple([x for x in (src_out, src_err) if x is not None]) - for fd in fds: - flags = fcntl.fcntl(fd, F_GETFL) - assert fcntl.fcntl(fd, F_SETFL, flags | os.O_NONBLOCK) == 0 while fds: ready_fds, _, _ = select.select(fds, [], []) width = tty_width()