ImportHook: drop dead code around clr_prefix · pythonnet/pythonnet@9358531
@@ -258,7 +258,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
258258}
259259260260string realname = mod_name;
261-string clr_prefix = null;
262261263262// 2010-08-15: Always seemed smart to let python try first...
264263// This shaves off a few tenths of a second on test_module.py
@@ -316,10 +315,7 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
316315}
317316return new NewReference(module).DangerousMoveToPointer();
318317}
319-if (clr_prefix != null)
320-{
321-return GetCLRModule(fromList).DangerousMoveToPointerOrNull();
322-}
318+323319module = Runtime.PyDict_GetItemString(modules, names[0]);
324320return new NewReference(module, canBeNull: true).DangerousMoveToPointer();
325321}
@@ -359,12 +355,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
359355360356// Add the module to sys.modules
361357Runtime.PyDict_SetItemString(modules, tail.moduleName, tail.ObjectReference);
362-363-// If imported from CLR add clr.<modulename> to sys.modules as well
364-if (clr_prefix != null)
365-{
366-Runtime.PyDict_SetItemString(modules, clr_prefix + tail.moduleName, tail.ObjectReference);
367-}
368358}
369359370360{