Skip to content

Commit 908316f

Browse files
committed
ImportHook: drop dead code around clr_prefix
1 parent fefa322 commit 908316f

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
@@ -259,7 +259,6 @@ public static IntPtr __import__(IntPtr self, IntPtr argsRaw, IntPtr kw)
259259
}
260260

261261
string realname = mod_name;
262-
string clr_prefix = null;
263262

264263
// 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)
360356

361357
// 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
}
370360

371361
{

0 commit comments

Comments
 (0)