Skip to content

Commit 1ebe485

Browse files
committed
Fix weird namespace vs module types of IronPython CLR references
1 parent 4f654b4 commit 1ebe485

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ghpythonremote/monkey.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ def get_id_pack(obj):
3333
):
3434
# netrefs are handled first since __class__ is a descriptor
3535
return obj.____id_pack__
36-
elif inspect.ismodule(obj) or getattr(obj, "__name__", None) == "module":
36+
# str(obj).split(':')[0] == "Microsoft.Scripting.Actions.NamespaceTracker" should also work
37+
elif (
38+
inspect.ismodule(obj)
39+
or getattr(obj, "__name__", None) == "module"
40+
or str(type(obj)) == "<type 'namespace#'>"
41+
):
3742
# TODO: not sure about this, need to enumerate cases in units
3843
if isinstance(obj, type): # module
3944
obj_cls = type(obj)

0 commit comments

Comments
 (0)