File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -242,11 +242,12 @@ public static IntPtr tp_str(IntPtr ob)
242
242
243
243
//First check which type in the object hierarchy provides ToString()
244
244
//ToString has two "official" overloads so loop over GetMethods to get the one without parameters
245
- var method = type . GetMethod ( "ToString" , new Type [ ] { } ) ;
246
- if ( method . DeclaringTyppe != typeof ( object ) )
245
+ var instType = co . inst . GetType ( ) ;
246
+ var method = instType . GetMethod ( "ToString" , new Type [ ] { } ) ;
247
+ if ( method . DeclaringType != typeof ( object ) )
247
248
{
248
249
//match! something other than object provides a parameter-less overload of ToString
249
- return Runtime . Pystring_FromString ( co . inst . ToString ( ) ) ;
250
+ return Runtime . PyString_FromString ( co . inst . ToString ( ) ) ;
250
251
}
251
252
252
253
//If the object defines __repr__, call it.
You can’t perform that action at this time.
0 commit comments