Skip to content

Support clr.GetClrType() - as in IronPython #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support clr.GetClrType() - as in IronPython
Implements #432
  • Loading branch information
vivainio committed Mar 22, 2017
commit 464ce0844d59cc249341948eaf1476b4734c97e7
12 changes: 12 additions & 0 deletions src/runtime/moduleobject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,18 @@ public static Assembly AddReference(string name)
return assembly;
}

[ModuleFunction]
[ForbidPythonThreads]
public static Type GetClrType(object type)
{
var converted = type as Type;
if (converted == null)
{
throw new ArgumentException("Cannot convert object to Type");
}
return converted;
}

[ModuleFunction]
[ForbidPythonThreads]
public static string FindAssembly(string name)
Expand Down