From: Piotr Wawrzyniak Date: Thu, 17 Mar 2022 12:26:22 +0100 Subject: has_key was removed from dict methods. Use in operator instead --- bkchem/interactors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bkchem/interactors.py b/bkchem/interactors.py index b5510ed..5f9ced2 100644 --- a/bkchem/interactors.py +++ b/bkchem/interactors.py @@ -217,7 +217,7 @@ def save_as_template( paper): if not mol.name: missing[ 'name'] = missing.get( 'name', 0) + 1 - errors = missing.has_key( 'atom') or missing.has_key('name') + errors = 'atom' in missing or 'name' in missing if missing: dialog = Pmw.TextDialog( paper, title=_("Template summary")) @@ -226,19 +226,19 @@ def save_as_template( paper): if errors: dialog.insert( 'end', _("Errors"), 'headline') dialog.insert( 'end', "\n") - if missing.has_key( 'atom'): + if 'atom' in missing: dialog.insert('end', ngettext( "%d molecule have no template atom specified", "%d molecules have no template atom specified", int(missing['atom'])) % missing['atom']) dialog.insert( 'end', "\n") - if missing.has_key('name'): + if 'name' in missing: dialog.insert('end', ngettext( "%d molecule have no name specified", "%d molecules have no name specified", int(missing['name'])) % missing['name']) dialog.insert( 'end', "\n") - if missing.has_key( 'bond'): + if 'bond' in missing: dialog.insert( 'end', "\n") dialog.insert( 'end', _("Warnings"), 'headline') dialog.insert( 'end', "\n")