File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -110,16 +110,6 @@ internal static IntPtr ToPython(Object value, Type type) {
110110 return ClassDerivedObject . ToPython ( pyderived ) ;
111111 }
112112
113- if ( value is IEnumerable )
114- {
115- var resultlist = new PyList ( ) ;
116- foreach ( object o in ( IEnumerable ) value )
117- {
118- resultlist . Append ( new PyObject ( ToPython ( o , o . GetType ( ) ) ) ) ;
119- }
120- return resultlist . Handle ;
121- }
122-
123113 // hmm - from Python, we almost never care what the declared
124114 // type is. we'd rather have the object bound to the actual
125115 // implementing class.
@@ -194,6 +184,15 @@ internal static IntPtr ToPython(Object value, Type type) {
194184 return Runtime . PyLong_FromUnsignedLongLong ( ( ulong ) value ) ;
195185
196186 default :
187+ if ( value is IEnumerable )
188+ {
189+ var resultlist = new PyList ( ) ;
190+ foreach ( object o in ( IEnumerable ) value )
191+ {
192+ resultlist . Append ( new PyObject ( ToPython ( o , o . GetType ( ) ) ) ) ;
193+ }
194+ return resultlist . Handle ;
195+ }
197196 result = CLRObject . GetInstHandle ( value , type ) ;
198197 return result ;
199198 }
You can’t perform that action at this time.
0 commit comments