diff --git a/Python/Product/IronPython/Interpreter/RemoteInterpreter.cs b/Python/Product/IronPython/Interpreter/RemoteInterpreter.cs index 32736df2e5..2ece654e33 100644 --- a/Python/Product/IronPython/Interpreter/RemoteInterpreter.cs +++ b/Python/Product/IronPython/Interpreter/RemoteInterpreter.cs @@ -1055,9 +1055,10 @@ internal ObjectIdentityHandle TypeGroupMakeGenericType(ObjectIdentityHandle type if (genType != null) { Type[] genTypes = new Type[types.Length]; for (int i = 0; i < types.Length; i++) { - genTypes[i] = (Type)Unwrap(types[i]); + var o = Unwrap(types[i]); + genTypes[i] = o as Type ?? (PythonType)o; } - return MakeHandle(genType.Type.MakeGenericType(genTypes)); + return MakeHandle(DynamicHelpers.GetPythonTypeFromType(genType.Type.MakeGenericType(genTypes))); } return new ObjectIdentityHandle(); });