[IronPython] CodeContext

Dino Viehland dinov at microsoft.com
Tue Sep 9 06:05:46 CEST 2008


I don't know if I missed a conclusion to this but there is a general way to get a CodeContext.  A CodeContext is just a Scope and a LanguageContext.  You can new up an empty scope and you can get a LanguageContext from HostingHelpers.GetLanguageContext.  But all of this breaks the remoting story.  If that's an issue for you there's always HostingHelpers.CallEngine which will give you the LanguageContext and run your code in the ScriptRuntime's app domain.

But more on point you could also look at RuntimeHelpers.GetDynamicStackFrames which might give you the information you want w/ an easier to use interface from C#.

If there's an interesting exception related goal in here we could look at adding it to the ExceptionOperations class.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa
Sent: Saturday, August 23, 2008 8:31 PM
To: users at lists.ironpython.com
Subject: Re: [IronPython] CodeContext

I am try to get traceback object , for that i am trying different things
Tomas Matousek wrote:
The class might be actually be called ExceptionService in your bits. It was renamed recently. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tomas Matousek Sent: Saturday, August 23, 2008 7:53 PM To: Discussion of IronPython Subject: Re: [IronPython] CodeContext Does ExceptionOeprations class provide you the information you need or is something missing? You can get an instance via engine.GetService(). Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Saturday, August 23, 2008 4:56 PM To: users at lists.ironpython.com Subject: [IronPython] CodeContext how to get CodeContext from ScriptRuntime ,ScriptScope or ScriptEngine . basically i am try use this function: public static PythonTuple/*!*/ GetExceptionInfoLocal(CodeContext/*!*/ context, Exception ex) -- View this message in context: http://www.nabble.com/CodeContext-tp19126500p19126500.html Sent from the IronPython mailing list archive at Nabble.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 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

________________________________
View this message in context: Re: CodeContext<http://www.nabble.com/CodeContext-tp19126500p19127475.html>
Sent from the IronPython mailing list archive<http://www.nabble.com/IronPython-f14449.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080908/06c3ebfb/attachment.html>


More information about the Ironpython-users mailing list