From 9df34694f85776553a1153dcb71097d287a99290 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 25 Jul 2016 19:05:26 +0300 Subject: [PATCH] Fix dict keys for Py3 compatibility --- m_lib/flad/flad.py | 2 +- m_lib/flad/fladm.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m_lib/flad/flad.py b/m_lib/flad/flad.py index 232852f..da430dd 100644 --- a/m_lib/flad/flad.py +++ b/m_lib/flad/flad.py @@ -224,7 +224,7 @@ class Flad(list): flush_record = 1 # Set flag for all but 1st record if copy_rec: - for key in copy_rec.keys(): + for key in list(copy_rec.keys()): outfile.write(key + self.key_sep + copy_rec[key] + '\n') del copy_rec[key] diff --git a/m_lib/flad/fladm.py b/m_lib/flad/fladm.py index 28b3d8d..6143122 100644 --- a/m_lib/flad/fladm.py +++ b/m_lib/flad/fladm.py @@ -42,12 +42,12 @@ class Flad_WithMustKeys(Flad): if self.other_keys: for key in self.other_keys: - if copy_rec.has_key(key): + if key in copy_rec: outfile.write(key + def_keysep + copy_rec[key] + '\n') del copy_rec[key] if copy_rec: - for key in copy_rec.keys(): + for key in list(copy_rec.keys()): outfile.write(key + def_keysep + copy_rec[key] + '\n') del copy_rec[key] -- 2.39.5