it looks like it moved to just Microsoft.Scripting namespace and is now in the 
Microsoft.Dynamic assembly instead of Microsoft.Scripting.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of haniti grk
Sent: Wednesday, April 13, 2011 5:34 PM
To: Discussion of IronPython
Subject: [IronPython] Microsoft.Scripting.Shell no more?

This was from 
http://www.ironpython.info/index.php/Simulating_thread.interrupt_main

The code below is supposed to simulate thread.interrupt, but it seems like 
Microsoft.Scripting.Shell is not there any more...
import clr
clr.AddReference('Microsoft.Scripting')
from Microsoft.Scripting.Shell import KeyboardInterruptException
from System import Threading

main = Thread.CurrentThread

main.Abort(KeyboardInterruptException(""))

Here is a dump from ipy console:
 >>> clr.AddReference('Microsoft.Scripting')
>>> import Microsoft.Scripting
>>> dir(Microsoft.Scripting)
['ArgumentTypeException', 'AssemblyLoadedEventArgs', 'CompilerOptions', 'ErrorCo
unter', 'ErrorSink', 'Generation', 'Hosting', 'IScopeVariable', 'IndexSpan', 'In
validImplementationException', 'LanguageOptions', 'ParamDictionaryAttribute', 'P
latformAdaptationLayer', 'Runtime', 'ScopeStorage', 'ScopeVariable', 'ScopeVaria
bleIgnoreCase', 'ScriptCode', 'ScriptCodeParseResult', 'Severity', 'SourceCodeKi
nd', 'SourceCodePropertiesUtils', 'SourceCodeReader', 'SourceLocation', 'SourceS
pan', 'SourceUnit', 'StreamContentProvider', 'SyntaxErrorException', 'TextConten
tProvider', 'TokenCategory', 'TokenInfo', 'TokenKind', 'TokenTriggers', 'Utils']

Can someone verify that this is the case?

Or is there a way to raise an exception to the main thread using threading 
module?
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to