diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-21 17:22:46 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:16 -0300 |
commit | ee15e0606a2abccb7374e82fd7cd8c70e128a1df (patch) | |
tree | 98624db93876ac4c7e8bf248f3df249fbc1eb7d1 /generator | |
parent | 5d6f2193395afab85e444b61761484197d45a93c (diff) |
Fix getattro function on Python3.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index bdcf9f70e..dfacb4cf2 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -3719,9 +3719,8 @@ void CppGenerator::writeGetattroFunction(QTextStream& s, const AbstractMetaClass } s << INDENT << '}' << endl; - s << INDENT << "const char* cname = PyBytes_AS_STRING(name);" << endl; foreach (const AbstractMetaFunction* func, getMethodsWithBothStaticAndNonStaticMethods(metaClass)) { - s << INDENT << "if (strcmp(cname, \"" << func->name() << "\") == 0)" << endl; + s << INDENT << "if (SBK_PyString_CompareWithASCIIString(name, \"" << func->name() << "\") == 0)" << endl; Indentation indent(INDENT); s << INDENT << "return PyCFunction_NewEx(&" << cpythonMethodDefinitionName(func) << ", " PYTHON_SELF_VAR ", 0);" << endl; } |