[IronPython] ScriptScope Oddity

Michael Foord fuzzyman at voidspace.org.uk
Thu Oct 30 19:38:45 CET 2008


Dino Viehland wrote:
> 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.
>   

Actually, this rings a bell. I think I might have asked this question 
before and received the same answer...

Thanks for the quick reply!

Michael
> -----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
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


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




More information about the Ironpython-users mailing list