Anton Shestakov <av6@dwimlabs.net>, Sun, 07 Aug 2016 13:03:34 +0800
bench: unlock at (any kind of) exit
Helps with running bench.py via a wrapper shell script, for example.
--- a/bench.py Sun Aug 07 12:59:40 2016 +0800
+++ b/bench.py Sun Aug 07 13:03:34 2016 +0800
names = args.marks.split(',')
marks = OrderedDict((k, v) for k, v in MARKS.items() if k in names)
- args.revsets = guessspikes(args.auto, marks)
- args.revsets = guessnew(args.auto, marks)
- dbupdate(args.revsets, marks, args.mintime, args.mintries, args.retry)
- unlock(lockfd, LOCKFILE)
+ atexit.register(unlock, lockfd, LOCKFILE)
+ args.revsets = guessspikes(args.auto, marks)
+ args.revsets = guessnew(args.auto, marks)
+ dbupdate(args.revsets, marks, args.mintime, args.mintries, args.retry)
if __name__ == '__main__':