Debian Codegraph @

debian/patches/0002-has_key-was-removed-from-dict-methods.-Use-in-operat.patch

raw symbols SCIP
1 From: Piotr Wawrzyniak <[email protected]>
2 Date: Thu, 17 Mar 2022 12:26:22 +0100
3 Subject: has_key was removed from dict methods. Use in operator instead
4
5 ---
6 bkchem/interactors.py | 8 ++++----
7 1 file changed, 4 insertions(+), 4 deletions(-)
8
9 diff --git a/bkchem/interactors.py b/bkchem/interactors.py
10 index b5510ed..5f9ced2 100644
11 --- a/bkchem/interactors.py
12 +++ b/bkchem/interactors.py
13 @@ -217,7 +217,7 @@ def save_as_template( paper):
14 if not mol.name:
15 missing[ 'name'] = missing.get( 'name', 0) + 1
16
17 - errors = missing.has_key( 'atom') or missing.has_key('name')
18 + errors = 'atom' in missing or 'name' in missing
19
20 if missing:
21 dialog = Pmw.TextDialog( paper, title=_("Template summary"))
22 @@ -226,19 +226,19 @@ def save_as_template( paper):
23 if errors:
24 dialog.insert( 'end', _("Errors"), 'headline')
25 dialog.insert( 'end', "\n")
26 - if missing.has_key( 'atom'):
27 + if 'atom' in missing:
28 dialog.insert('end', ngettext(
29 "%d molecule have no template atom specified",
30 "%d molecules have no template atom specified",
31 int(missing['atom'])) % missing['atom'])
32 dialog.insert( 'end', "\n")
33 - if missing.has_key('name'):
34 + if 'name' in missing:
35 dialog.insert('end', ngettext(
36 "%d molecule have no name specified",
37 "%d molecules have no name specified",
38 int(missing['name'])) % missing['name'])
39 dialog.insert( 'end', "\n")
40 - if missing.has_key( 'bond'):
41 + if 'bond' in missing:
42 dialog.insert( 'end', "\n")
43 dialog.insert( 'end', _("Warnings"), 'headline')
44 dialog.insert( 'end', "\n")