[IronPython] Logging module

Dan Eloff dan.eloff at gmail.com
Tue Feb 17 05:44:33 CET 2009


On Mon, Feb 16, 2009 at 6:01 PM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
>
> Fair enough then. I'm just putting together a patch and will ask the guys on
> Python-Dev if we can get it into Python 2.6. You'll have to help me remember
> to pull it out once we have frames again!
>

I'd suggest that we don't pull it out. It'd make it an easier decision
for the python-devs for one, I can't imagine they'd be enthusiastic to
accept a temporary patch. But the main thing being that frame support
will likely cause serious performance depredation, which means it's
likely to be an optional feature, hence we'd need that check anyway.
And then there's always Jython, which, as far as I know, would need
the same check.

So what kind of condition could we use that works with Jython and
IronPython currently, that won't break when IronPython does introduce
frames support (regardless of whether or not it has been enabled?)

Maybe just wrap it in a try/except?:

try:
    foo = sys._getframe(1)
except (ValueError, AttributeError): # for IronPython, Jython
    foo = None

Assuming Jython raises an AttributeError, which I do not know to be the case.

-Dan



More information about the Ironpython-users mailing list