[IronPython] Microsoft.Scripting.Shell no more?

haniti grk haniti.grk at gmail.com
Thu Apr 14 02:34:25 CEST 2011


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110413/73af28a6/attachment.html>


More information about the Ironpython-users mailing list