diff --git a/Pythonnet.Runtime/genericutil.cs b/Pythonnet.Runtime/genericutil.cs index c3de0aa56..92751add7 100644 --- a/Pythonnet.Runtime/genericutil.cs +++ b/Pythonnet.Runtime/genericutil.cs @@ -38,6 +38,9 @@ namespace Python.Runtime { internal static void Register(Type t) { Dictionary> nsmap = null; + //for Anonymous type, there is no namespace + if (t.Namespace == null) return; + mapping.TryGetValue(t.Namespace, out nsmap); if (nsmap == null) { nsmap = new Dictionary>();