[Ironpython-users] IronPython, Daily Digest 5/7/2013

CodePlex no_reply at codeplex.com
Wed May 8 09:17:41 CEST 2013

Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] f_locals in sys.exc_info()



1. [New issue] f_locals in sys.exc_info()
User ericreynolds has proposed the issue:

"The following code gives different results in Python compared with IronPython because sys.exc_info().tb_frame.f_locals seems to be the locals dictionary of the current frame rather than the frame where the exception was thrown.
import sys

def f():
    a = 1
    b = 2

    exc_type, exc_value, tb = sys.exc_info()
    if tb is not None:
        prev = tb
        curr = tb.tb_next
        while curr is not None:
            prev = curr
            curr = curr.tb_next
        print prev.tb_frame.f_locals

In Python:
{'a': 1, 'b': 2}

In IronPython 2.7.3 ( on .NET 4.0.30319.296 (32-bit):
{'__name__': '__main__', '__file__': 'ExcTest.py', '__doc__': None, '__builtins__': <module '__builtin__' (built-in)>, 'sys': <module 'sys'
(built-in)>, 'f': <function f at 0x000000000000002B>, 'exc_type': <type 'exceptions.ZeroDivisionError'>, 'exc_value': ZeroDivisionError('Att
empted to divide by zero.',), 'tb': <traceback object at 0x000000000000002C>, 'prev': <traceback object at 0x000000000000002D>, 'curr': None

You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130508/188bc0f7/attachment.html>

More information about the Ironpython-users mailing list