[IronPython] ScriptScope Oddity

Michael Foord fuzzyman at voidspace.org.uk
Thu Oct 30 17:02:19 CET 2008


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/




More information about the Ironpython-users mailing list