X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fbup%2Fcmd%2Frandom.py;h=9ad64e4804e66d2a32c56408a446ab8a7e099f9a;hb=443ef13d118c8c213bf102b5fe36432df51886a3;hp=c4b234ee0933efc89114b7d416cdec9c61bd4425;hpb=6ec85ef2adec7437c6bf97d579eec122191bdbab;p=bup.git diff --git a/lib/bup/cmd/random.py b/lib/bup/cmd/random.py index c4b234e..9ad64e4 100755 --- a/lib/bup/cmd/random.py +++ b/lib/bup/cmd/random.py @@ -1,9 +1,9 @@ from __future__ import absolute_import -import os, sys +import sys from bup import options, _helpers -from bup.helpers import handle_ctrl_c, log, parse_num +from bup.helpers import handle_ctrl_c, log, parse_num, istty1 optspec = """ @@ -25,8 +25,7 @@ def main(argv): handle_ctrl_c() - if opt.force or (not os.isatty(1) and - not int(os.environ.get('BUP_FORCE_TTY', 0)) & 1): + if opt.force or not istty1: _helpers.write_random(sys.stdout.fileno(), total, opt.seed, opt.verbose and 1 or 0) else: