diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py index 307018571..e74131cdb 100644 --- a/gio/gdbus-2.0/codegen/codegen.py +++ b/gio/gdbus-2.0/codegen/codegen.py @@ -1068,7 +1068,7 @@ class CodeGenerator: '\n') def generate_annotations(self, prefix, annotations): - if annotations == None: + if annotations is None: return n = 0 diff --git a/gio/gdbus-2.0/codegen/codegen_main.py b/gio/gdbus-2.0/codegen/codegen_main.py index 10ecf7785..03de1d107 100755 --- a/gio/gdbus-2.0/codegen/codegen_main.py +++ b/gio/gdbus-2.0/codegen/codegen_main.py @@ -63,38 +63,38 @@ def apply_annotation(iface_list, iface, method, signal, prop, arg, key, value): iface_obj = i break - if iface_obj == None: + if iface_obj is None: print_error('No interface "{}"'.format(iface)) target_obj = None if method: method_obj = find_method(iface_obj, method) - if method_obj == None: + if method_obj is None: print_error('No method "{}" on interface "{}"'.format(method, iface)) if arg: arg_obj = find_arg(method_obj.in_args, arg) - if (arg_obj == None): + if (arg_obj is None): arg_obj = find_arg(method_obj.out_args, arg) - if (arg_obj == None): + if (arg_obj is None): print_error('No arg "{}" on method "{}" on interface "{}"'.format(arg, method, iface)) target_obj = arg_obj else: target_obj = method_obj elif signal: signal_obj = find_signal(iface_obj, signal) - if signal_obj == None: + if signal_obj is None: print_error('No signal "{}" on interface "{}"'.format(signal, iface)) if arg: arg_obj = find_arg(signal_obj.args, arg) - if (arg_obj == None): + if (arg_obj is None): print_error('No arg "{}" on signal "{}" on interface "{}"'.format(arg, signal, iface)) target_obj = arg_obj else: target_obj = signal_obj elif prop: prop_obj = find_prop(iface_obj, prop) - if prop_obj == None: + if prop_obj is None: print_error('No property "{}" on interface "{}"'.format(prop, iface)) target_obj = prop_obj else: diff --git a/gio/gdbus-2.0/codegen/dbustypes.py b/gio/gdbus-2.0/codegen/dbustypes.py index 2b721bfbf..2ff736a5e 100644 --- a/gio/gdbus-2.0/codegen/dbustypes.py +++ b/gio/gdbus-2.0/codegen/dbustypes.py @@ -61,7 +61,7 @@ class Arg: if len(self.since) == 0: self.since = utils.lookup_since(self.annotations) - if self.name == None: + if self.name is None: self.name = 'unnamed_arg%d'%arg_number # default to GVariant self.ctype_in_g = 'GVariant *' diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py index bdfa703ac..95ba107d3 100644 --- a/gio/gdbus-2.0/codegen/utils.py +++ b/gio/gdbus-2.0/codegen/utils.py @@ -116,21 +116,21 @@ def lookup_annotation(annotations, key): def lookup_docs(annotations): s = lookup_annotation(annotations, 'org.gtk.GDBus.DocString') - if s == None: + if s is None: return '' else: return s def lookup_since(annotations): s = lookup_annotation(annotations, 'org.gtk.GDBus.Since') - if s == None: + if s is None: return '' else: return s def lookup_brief_docs(annotations): s = lookup_annotation(annotations, 'org.gtk.GDBus.DocString.Short') - if s == None: + if s is None: return '' else: return s diff --git a/glib/glib_gdb.py b/glib/glib_gdb.py index 38f101ad5..1cf2ed936 100644 --- a/glib/glib_gdb.py +++ b/glib/glib_gdb.py @@ -9,7 +9,7 @@ def read_global_var (symname): return gdb.selected_frame().read_var(symname) def g_quark_to_string (quark): - if quark == None: + if quark is None: return None quark = long(quark) if quark == 0: @@ -171,7 +171,7 @@ def pretty_printer_lookup (val): return None def register (obj): - if obj == None: + if obj is None: obj = gdb obj.pretty_printers.append(pretty_printer_lookup) diff --git a/glib/update-gtranslit.py b/glib/update-gtranslit.py index 01f7c7f84..159876b6c 100755 --- a/glib/update-gtranslit.py +++ b/glib/update-gtranslit.py @@ -104,7 +104,7 @@ class Mapping: return [self] def serialise(self, serialiser): - if self.serialised == None: + if self.serialised is None: self.serialised = serialiser.add_mapping(self.mapping) return self.serialised @@ -193,7 +193,7 @@ class Chain: return [self] def serialise(self, serialiser): - if self.serialised == None: + if self.serialised is None: # Before we serialise, see if we can optimise a bit self.chain = sum((item.get_flattened() for item in self.chain), []) diff --git a/gobject/gobject_gdb.py b/gobject/gobject_gdb.py index 1746576fd..263ac78b6 100644 --- a/gobject/gobject_gdb.py +++ b/gobject/gobject_gdb.py @@ -26,7 +26,7 @@ def g_type_to_typenode (gtype): if typenode == 0: return None val = read_global_var ("static_fundamental_type_nodes") - if val == None: + if val is None: return None return val[typenode >> 2].address @@ -132,7 +132,7 @@ def pretty_printer_lookup (val): return None def get_signal_name (id): - if id == None: + if id is None: return None id = long(id) if id == 0: @@ -163,7 +163,7 @@ class SignalFrame(FrameDecorator): def read_var (self, frame, name, array = None): try: v = frame_var (frame, name) - if v == None or v.is_optimized_out: + if v is None or v.is_optimized_out: return None if array != None: array.append (v) @@ -174,7 +174,7 @@ class SignalFrame(FrameDecorator): def read_object (self, frame, name, array = None): try: v = frame_var (frame, name) - if v == None or v.is_optimized_out: + if v is None or v.is_optimized_out: return None v = v.cast (gdb.lookup_type("GObject").pointer()) # Ensure this is a somewhat correct object pointer @@ -323,7 +323,7 @@ class GFrameFilter(object): return GFrameDecorator(iterator) def register (obj): - if obj == None: + if obj is None: obj = gdb if HAVE_GDB_FRAMEDECORATOR: