Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 464ce08

Browse files
committed
Support clr.GetClrType() - as in IronPython
Implements #432
1 parent 4df6105 commit 464ce08

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/runtime/moduleobject.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,18 @@ public static Assembly AddReference(string name)
403403
return assembly;
404404
}
405405

406+
[ModuleFunction]
407+
[ForbidPythonThreads]
408+
public static Type GetClrType(object type)
409+
{
410+
var converted = type as Type;
411+
if (converted == null)
412+
{
413+
throw new ArgumentException("Cannot convert object to Type");
414+
}
415+
return converted;
416+
}
417+
406418
[ModuleFunction]
407419
[ForbidPythonThreads]
408420
public static string FindAssembly(string name)

0 commit comments

Comments
 (0)