#5287: Add exception handling around findCaller() call to help out IronPython.

This commit is contained in:
Vinay Sajip 2009-02-19 12:36:11 +00:00
parent 2d0c2568d5
commit b672b6dea6
2 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved.
# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@ -1127,7 +1127,12 @@ class Logger(Filterer):
all the handlers of this logger to handle the record.
"""
if _srcfile:
#IronPython doesn't track Python frames, so findCaller throws an
#exception. We trap it here so that IronPython can use logging.
try:
fn, lno, func = self.findCaller()
except ValueError:
fn, lno, func = "(unknown file)", 0, "(unknown function)"
else:
fn, lno, func = "(unknown file)", 0, "(unknown function)"
if exc_info:

View File

@ -169,6 +169,9 @@ Core and Builtins
Library
-------
- Issue #5287: Add exception handling around findCaller() call to help out
IronPython.
- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
The file was resized to wrong size.