From f597a74e3b3eb3042c7d85dc2df813852e0c3db5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Dec 2019 10:26:10 +0100 Subject: shiboken: Add explanatory comment to getattro function Make it clear how the dispatch works. Task-number: PYSIDE-454 Change-Id: Idd98eee5a7f7d45891c8a7dd0170f9188f136296 Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 0ffb486e27996bbd81cde5f3d73b2d8346386ffb) --- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 575e1364c..0c5da737c 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -5345,6 +5345,8 @@ void CppGenerator::writeGetattroFunction(QTextStream &s, GeneratorContext &conte } s << INDENT << "PyErr_Clear();\n"; + // This generates the code which dispatches access to member functions + // and fields from the smart pointer to its pointee. s << INDENT << "// Try to find the 'name' attribute, by retrieving the PyObject for " "the corresponding C++ object held by the smart pointer.\n"; s << INDENT << "if (auto rawObj = PyObject_CallMethod(self, " -- cgit v1.2.3