X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fcmd%2Fftp-cmd.py;fp=lib%2Fcmd%2Fftp-cmd.py;h=02a6fecef014609806e827c0c3a0b7aa222a6c1e;hb=5ac3821c0f1fbd6a1b1742e91ffd556cd1116041;hp=8e05fa831d232d3021dd8a4143e8f52567c8cccf;hpb=2040b6890af45318eb512b4c7f5398e040b1ffe5;p=bup.git diff --git a/lib/cmd/ftp-cmd.py b/lib/cmd/ftp-cmd.py index 8e05fa8..02a6fec 100755 --- a/lib/cmd/ftp-cmd.py +++ b/lib/cmd/ftp-cmd.py @@ -55,11 +55,20 @@ def write_to_file(inf, outf): def inputiter(): if os.isatty(stdin.fileno()): while 1: - try: - yield _helpers.readline(b'bup> ') - except EOFError: - print() # Clear the line for the terminal's next prompt - break + if hasattr(_helpers, 'readline'): + try: + yield _helpers.readline(b'bup> ') + except EOFError: + print() # Clear the line for the terminal's next prompt + break + else: + out.write(b'bup> ') + out.flush() + read_line = stdin.readline() + if not read_line: + print('') + break + yield read_line else: for line in stdin: yield line