[IronPython] Microsoft.Scripting.Shell no more?

Dino Viehland dinov at microsoft.com
Thu Apr 14 02:42:17 CEST 2011


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

From: users-bounces at lists.ironpython.com [mailto:users-bounces at 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110414/69c987fe/attachment.html>


More information about the Ironpython-users mailing list