ImportHook: drop dead code around clr_prefix · pythonnet/pythonnet@908316f

@@ -259,7 +259,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)

259259

}

260260261261

string realname = mod_name;

262-

string clr_prefix = null;

263262264263

// 2010-08-15: Always seemed smart to let python try first...

265264

// This shaves off a few tenths of a second on test_module.py

@@ -317,10 +316,7 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)

317316

}

318317

return new NewReference(module).DangerousMoveToPointer();

319318

}

320-

if (clr_prefix != null)

321-

{

322-

return GetCLRModule(fromList).DangerousMoveToPointerOrNull();

323-

}

319+324320

module = Runtime.PyDict_GetItemString(modules, names[0]);

325321

return new NewReference(module, canBeNull: true).DangerousMoveToPointer();

326322

}

@@ -360,12 +356,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)

360356361357

// Add the module to sys.modules

362358

Runtime.PyDict_SetItemString(modules, tail.moduleName, tail.ObjectReference);

363-364-

// If imported from CLR add clr.<modulename> to sys.modules as well

365-

if (clr_prefix != null)

366-

{

367-

Runtime.PyDict_SetItemString(modules, clr_prefix + tail.moduleName, tail.ObjectReference);

368-

}

369359

}

370360371361

{