Skip to content

Commit 9358531

Browse files
committed
ImportHook: drop dead code around clr_prefix
1 parent 0faebb2 commit 9358531

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/runtime/importhook.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
258258
}
259259

260260
string realname = mod_name;
261-
string clr_prefix = null;
262261

263262
// 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
}
317316
return new NewReference(module).DangerousMoveToPointer();
318317
}
319-
if (clr_prefix != null)
320-
{
321-
return GetCLRModule(fromList).DangerousMoveToPointerOrNull();
322-
}
318+
323319
module = Runtime.PyDict_GetItemString(modules, names[0]);
324320
return new NewReference(module, canBeNull: true).DangerousMoveToPointer();
325321
}
@@ -359,12 +355,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
359355

360356
// Add the module to sys.modules
361357
Runtime.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
}
369359

370360
{

0 commit comments

Comments
 (0)