From bf85437a4bc4d4021bac11a7ff12cba89729d38f Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sun, 12 Jan 2014 22:29:02 +0100 Subject: [PATCH] Skip missing tuples --- bin/ptr-import.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/ptr-import.py b/bin/ptr-import.py index 21884be..2062f01 100644 --- a/bin/ptr-import.py +++ b/bin/ptr-import.py @@ -28,10 +28,15 @@ if args.r: for x in args.r: with open(x, encoding='UTF-8', errors='ignore') as f: for l in f: - (ip, ptr) = l.rstrip().split(',')[:2] - if args.v: - print (terms(ptr)) - r.set(ip,ptr) + try: + (ip, ptr) = l.rstrip().split(',')[:2] + if args.v: + print(terms(ptr)) + r.set(ip,ptr) + except ValueError: + if args.v: + print("PTR tuple missing") + pass else: argParser.print_help() exit(1)