workaround in PyCXX classes due to removed support of old-style classes

This commit is contained in:
wmayer
2019-06-25 18:15:10 +02:00
parent 9336302858
commit 2830652a39
2 changed files with 22 additions and 1 deletions

View File

@@ -157,6 +157,18 @@ namespace Py
EXPLICIT_TYPENAME method_map_t::const_iterator i = mm.find( name );
if( i == mm.end() )
{
if( name == "__dict__" ) // __methods__ is not supported in Py3 any more, use __dict__ instead
{
Dict methods;
i = mm.begin();
EXPLICIT_TYPENAME method_map_t::const_iterator i_end = mm.end();
for( ; i != i_end; ++i )
methods.setItem( String( (*i).first ), String( "" ) );
return methods;
}
if( name == "__methods__" )
{
List methods;