Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Write qualname
  • Loading branch information
filmor committed Apr 14, 2020
commit 912ef3bff023af5ae0a5f9bf05a5a1e2753663e4
4 changes: 3 additions & 1 deletion Python.Runtime/typemanager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ internal static IntPtr CreateType(Type impl)
internal static IntPtr CreateType(ManagedType impl, Type clrType)
{
// Cleanup the type name to get rid of funny nested type names.
string name = "CLR." + clrType.FullName;
string name = "clr.types." + clrType.FullName;
int i = name.LastIndexOf('+');
if (i > -1)
{
Expand Down Expand Up @@ -434,6 +434,8 @@ internal static IntPtr AllocateTypeObject(string name)
#endif
Marshal.WriteIntPtr(type, TypeOffset.tp_name, raw);
Marshal.WriteIntPtr(type, TypeOffset.name, temp);
Runtime.Py_IncRef(temp);
Marshal.WriteIntPtr(type, TypeOffset.qualname, temp);

long ptr = type.ToInt64(); // 64-bit safe

Expand Down