File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -92,16 +92,6 @@ internal static IntPtr ToPython(Object value, Type type) {
9292 return result ;
9393 }
9494
95- if ( value is IEnumerable )
96- {
97- var resultlist = new PyList ( ) ;
98- foreach ( object o in ( IEnumerable ) value )
99- {
100- resultlist . Append ( new PyObject ( ToPython ( o , o . GetType ( ) ) ) ) ;
101- }
102- return resultlist . Handle ;
103- }
104-
10595 // it the type is a python subclass of a managed type then return the
10696 // underying python object rather than construct a new wrapper object.
10797 IPythonDerivedType pyderived = value as IPythonDerivedType ;
@@ -184,19 +174,17 @@ internal static IntPtr ToPython(Object value, Type type) {
184174 return Runtime . PyLong_FromUnsignedLongLong ( ( ulong ) value ) ;
185175
186176 default :
187- if ( value is IEnumerable )
188- {
177+ if ( value is IEnumerable ) {
189178 var resultlist = new PyList ( ) ;
190- foreach ( object o in ( IEnumerable ) value )
191- {
179+ foreach ( object o in ( IEnumerable ) value ) {
192180 resultlist . Append ( new PyObject ( ToPython ( o , o . GetType ( ) ) ) ) ;
193181 }
194182 return resultlist . Handle ;
195183 }
184+
196185 result = CLRObject . GetInstHandle ( value , type ) ;
197186 return result ;
198187 }
199-
200188 }
201189
202190
You can’t perform that action at this time.
0 commit comments