From 8fd1d24e4d6915129491783bbe1ef12014b70990 Mon Sep 17 00:00:00 2001 From: psycodad Date: Sat, 23 Mar 2024 11:40:14 +0100 Subject: [PATCH] fixed has_key to in --- kraken-report.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kraken-report.py b/kraken-report.py index 9695d0a..5ae7f61 100755 --- a/kraken-report.py +++ b/kraken-report.py @@ -149,7 +149,9 @@ if __name__ == '__main__': fh = open(filename, 'r') csv_data = csv.DictReader(fh) for line in csv_data: - if not data.has_key(line['pair']): + if not 'pair' in data: + # ^py3 way of doing things, py2: + #if not data.has_key(line['pair']): data[line['pair']] = [] data[line['pair']].append(line)