Commit bda58ec3 authored by John (J5) Palmieri's avatar John (J5) Palmieri Committed by Tomeu Vizoso
Browse files

fix exceptions so they work in python 3.x

https://bugzilla.gnome.org/show_bug.cgi?id=615872
parent 427a3c80
...@@ -141,7 +141,7 @@ class IntrospectionModule(object): ...@@ -141,7 +141,7 @@ class IntrospectionModule(object):
elif g_type.is_a(gobject.TYPE_POINTER) or g_type == gobject.TYPE_NONE: elif g_type.is_a(gobject.TYPE_POINTER) or g_type == gobject.TYPE_NONE:
bases = (Struct,) bases = (Struct,)
else: else:
raise TypeError, "unable to create a wrapper for %s.%s" % (info.get_namespace(), info.get_name()) raise TypeError("unable to create a wrapper for %s.%s" % (info.get_namespace(), info.get_name()))
metaclass = StructMeta metaclass = StructMeta
else: else:
raise NotImplementedError(info) raise NotImplementedError(info)
......
...@@ -50,7 +50,7 @@ def Constructor(info): ...@@ -50,7 +50,7 @@ def Constructor(info):
def constructor(cls, *args): def constructor(cls, *args):
cls_name = info.get_container().get_name() cls_name = info.get_container().get_name()
if cls.__name__ != cls_name: if cls.__name__ != cls_name:
raise TypeError, '%s constructor cannot be used to create instances of a subclass' % cls_name raise TypeError('%s constructor cannot be used to create instances of a subclass' % cls_name)
return info.invoke(cls, *args) return info.invoke(cls, *args)
constructor.__info__ = info constructor.__info__ = info
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment