From 0e413053441f466e253d3b716b2309b879b3cae4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 May 2020 16:56:09 +1000 Subject: [PATCH] Cleanup: reference 'bpy.types.bpy_struct' directly Previously there wasn't a way to access this directly from bpy.types. --- doc/python_api/sphinx_doc_gen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 6febbbf2ded..6207ca6753e 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -492,6 +492,11 @@ if _BPY_PROP_COLLECTION_FAKE: else: _BPY_PROP_COLLECTION_ID = "collection" +if _BPY_STRUCT_FAKE: + bpy_struct = bpy.types.bpy_struct +else: + bpy_struct = None + def escape_rst(text): """ Escape plain text which may contain characters used by RST. @@ -1443,7 +1448,7 @@ def pyrna2sphinx(basepath): if _BPY_STRUCT_FAKE: descr_items = [ - (key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) + (key, descr) for key, descr in sorted(bpy_struct.__dict__.items()) if not key.startswith("__") ] @@ -1571,7 +1576,7 @@ def pyrna2sphinx(basepath): # write fake classes if _BPY_STRUCT_FAKE: - class_value = bpy.types.Struct.__bases__[0] + class_value = bpy_struct fake_bpy_type( "bpy.types", class_value, _BPY_STRUCT_FAKE, "built-in base class for all classes in bpy.types.", use_subclasses=True,