From 962dcc78d0ac092ad34222a72dfed91f6b90e6fe Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 11:55:51 -0800 Subject: [PATCH] parsedb: more verbose on duplicate bits Signed-off-by: John McMaster --- utils/parsedb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/parsedb.py b/utils/parsedb.py index 5d6af833..888c0cb0 100755 --- a/utils/parsedb.py +++ b/utils/parsedb.py @@ -7,7 +7,7 @@ from prjxray import util def run(fnin, fnout=None, strict=False, verbose=False): lines = open(fnin, 'r').read().split('\n') tags = dict() - bitss = set() + bitss = dict() for line in lines: line = line.strip() if line == '': @@ -23,11 +23,11 @@ def run(fnin, fnout=None, strict=False, verbose=False): print("Original line: %s" % tags[tag]) print("New line: %s" % line) assert 0, "strict: got duplicate tag %s" % (tag, ) - assert bits not in bitss, "strict: got duplicate bits %s (ex: %s)" % ( - bits, line) + assert bits not in bitss, "strict: got duplicate bits %s: %s %s" % ( + bits, tag, bitss[bits]) tags[tag] = line if bits != None: - bitss.add(bits) + bitss[bits] = tag if fnout: with open(fnout, "w") as fout: