Commit a070e712 authored by Simon Feltman's avatar Simon Feltman

docs: Ignore meta-class bases in dynamic docstring generation

Skip attempts at generating a doc string for GObject meta-class bases
since they do not contain an __info__ attribute.
This circumvents errors with documentation generators (Sphinx).
parent ec44dea6
......@@ -197,7 +197,7 @@ _gobject._install_metaclass(_GObjectMetaBase)
class GObjectMeta(_GObjectMetaBase, MetaClassHelper):
"""Meta class used for GI GObject based types."""
def __init__(cls, name, bases, dict_):
super(GObjectMeta, cls).__init__(name, bases, dict_)
is_gi_defined = False
......@@ -225,6 +225,8 @@ class GObjectMeta(_GObjectMetaBase, MetaClassHelper):
@property
def __doc__(cls):
if cls == GObjectMeta:
return ''
return generate_doc_string(cls.__info__)
......@@ -289,6 +291,7 @@ def mro(C):
class StructMeta(type, MetaClassHelper):
"""Meta class used for GI Struct based types."""
def __init__(cls, name, bases, dict_):
super(StructMeta, cls).__init__(name, bases, dict_)
......@@ -310,4 +313,6 @@ class StructMeta(type, MetaClassHelper):
@property
def __doc__(cls):
if cls == StructMeta:
return ''
return generate_doc_string(cls.__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