X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fbup%2Fcmd%2Fprune_older.py;h=900abd9a502cc0b3defb78ab01986b84c77a7580;hb=b75ccc003c7f2b04b8f7e435ae64f7854d79527f;hp=e0f8545f5eaad8e4b9b0a30e0d3169637fde09d5;hpb=54b0467e48d27925ca8368d1f03c6254412b2786;p=bup.git diff --git a/lib/bup/cmd/prune_older.py b/lib/bup/cmd/prune_older.py index e0f8545..900abd9 100755 --- a/lib/bup/cmd/prune_older.py +++ b/lib/bup/cmd/prune_older.py @@ -7,7 +7,7 @@ from time import localtime, strftime, time import sys from bup import git, options -from bup.compat import argv_bytes, int_types +from bup.compat import argv_bytes from bup.gc import bup_gc from bup.helpers import die_if_errors, log, partition, period_as_secs from bup.io import byte_stream @@ -85,7 +85,7 @@ def main(argv): o.fatal('refusing to run dangerous, experimental command without --unsafe') now = int(time()) if opt.wrt is None else opt.wrt - if not isinstance(now, int_types): + if not isinstance(now, int): o.fatal('--wrt value ' + str(now) + ' is not an integer') period_start = {} @@ -153,8 +153,9 @@ def main(argv): if not opt.pretend: die_if_errors() - repo = LocalRepo() - bup_rm(repo, removals, compression=opt.compress, verbosity=opt.verbose) + with LocalRepo() as repo: + bup_rm(repo, removals, compression=opt.compress, + verbosity=opt.verbose) if opt.gc: die_if_errors() bup_gc(threshold=opt.gc_threshold,