diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py index b5b1f3c11..f2cd8a716 100644 --- a/gramps/gui/utils.py +++ b/gramps/gui/utils.py @@ -644,7 +644,7 @@ def model_to_text(model, cols=None, treeiter=None, indent="", text = "" if treeiter is None: treeiter = model.get_iter_first() - while treeiter != None: + while treeiter is not None: if cols is None: items = sep.join([str(item) for item in model[treeiter][:]]) else: diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py index d18bcf31a..e080c30d8 100644 --- a/gramps/gui/views/treemodels/flatbasemodel.py +++ b/gramps/gui/views/treemodels/flatbasemodel.py @@ -854,7 +854,7 @@ class FlatBaseModel(GObject.GObject, Gtk.TreeModel, BaseModel): See Gtk.TreeModel """ #print 'do_iter_nth_child', iter, nth - if iter == None: + if iter is None: return True, self.node_map.get_iter(nth) return False, None diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py index 802857e2b..ea95fd9b7 100644 --- a/gramps/gui/views/treemodels/treebasemodel.py +++ b/gramps/gui/views/treemodels/treebasemodel.py @@ -104,7 +104,7 @@ class Node(object): """ Assign the handle of a Gramps object to this node. """ - if not self.handle or handle == None: + if not self.handle or handle is None: self.handle = handle self.secondary = secondary else: diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index c6ca1a0ec..62cd5fe35 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -162,7 +162,7 @@ def make_requested_gramplet(gui_class, pane, opts, dbstate, uistate): """ Make a GUI gramplet given its name. """ - if opts == None: + if opts is None: return None if "name" in opts: diff --git a/gramps/plugins/database/bsddb_support/write.py b/gramps/plugins/database/bsddb_support/write.py index 8a4ff0fb7..690f991b0 100644 --- a/gramps/plugins/database/bsddb_support/write.py +++ b/gramps/plugins/database/bsddb_support/write.py @@ -1819,7 +1819,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): txn.delete(sname) if group is not None: txn.put(sname, group) - if group == None: + if group is None: grouppar = '' else: grouppar = group @@ -2649,7 +2649,7 @@ def write_lock_file(name): if win(): user = get_env_var('USERNAME') host = get_env_var('USERDOMAIN') - if host == None: + if host is None: host = "" else: host = os.uname()[1] diff --git a/gramps/plugins/lib/libsubstkeyword.py b/gramps/plugins/lib/libsubstkeyword.py index 5892a9f5a..8c4407681 100644 --- a/gramps/plugins/lib/libsubstkeyword.py +++ b/gramps/plugins/lib/libsubstkeyword.py @@ -1395,7 +1395,7 @@ if __name__ == '__main__': print("#None are known") tmp = main_level_test(consume_str, NameFormat, name_to_test) print(tmp) - print("Good" if tmp == None else "!! bad !!") + print("Good" if tmp is None else "!! bad !!") print() diff --git a/gramps/plugins/webreport/webcal.py b/gramps/plugins/webreport/webcal.py index d5a040b03..732d4670b 100644 --- a/gramps/plugins/webreport/webcal.py +++ b/gramps/plugins/webreport/webcal.py @@ -963,9 +963,9 @@ class WebCalReport(Report): continue for day in vals: event_date = "%04d%02d%02d" % (year, month, day) - if evdte == None: + if evdte is None: evdte = event_date - elif nxt == None: + elif nxt is None: nxt = event_date self.event_list.append((evdte, prv, nxt)) else: @@ -1254,7 +1254,7 @@ class WebCalReport(Report): prefix = self.narweb_prefix))) else: text = short_name - if age_at_death == None: + if age_at_death is None: self.add_day_item(text, year, month, day, 'Birthday', age_at_death, birth_date) else: self.add_day_item(text, year, month, day, 'Birthday', age_at_death, person_death)