[IronPython] ScriptScope Oddity

Dino Viehland dinov at microsoft.com
Thu Oct 30 17:06:43 CET 2008


We're picking the ObjectHandle overload for some reason.  You can use .Overloads to select the correct overload.  I'm actually surprised you don't get a different type error saying the call is ambiguous so I'll have to take a deeper look to understand that.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
Sent: Thursday, October 30, 2008 9:02 AM
To: Discussion of IronPython
Subject: [IronPython] ScriptScope Oddity

Why does setting '__file__' to None on a ScriptScope through
'SetVariable' fail, whilst setting it directly as an attribute (from
inside IronPython) succeeds? Is this intentional?

 >>> scope
<Microsoft.Scripting.Hosting.ScriptScope object at 0x0000000000000034
[Microsoft
.Scripting.Hosting.ScriptScope]>
 >>> scope.SetVariable('__file__', None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Value cannot be null.
Parameter name: handle
 >>> scope.__file__ = None
 >>>

Michael


--
http://www.ironpythoninaction.com/

_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list