From 0bcb4ae30c2c649594d9a0e3777042a3e1da974d Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 6 Mar 2017 13:51:08 +0000 Subject: [PATCH] Fixed a problem with assertion() and unreachable(), which could break if certain names (like 'args') were set in the calling frame. - Legacy-Id: 12975 --- ietf/utils/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ietf/utils/log.py b/ietf/utils/log.py index 272225429..c2ebc8808 100644 --- a/ietf/utils/log.py +++ b/ietf/utils/log.py @@ -73,7 +73,7 @@ def assertion(statement): tb.tb_lasti = None tb.tb_lineno = frame.f_lineno tb.tb_next = None - logger.error("Assertion '%s' failed.", statement, exc_info=(AssertionError, statement, tb), extra=frame.f_locals) + logger.error("Assertion '%s' failed.", statement, exc_info=(AssertionError, statement, tb)) def unreachable(): "Raises an assertion or sends traceback to admins if executed." @@ -89,5 +89,5 @@ def unreachable(): tb.tb_lasti = None tb.tb_lineno = frame.f_lineno tb.tb_next = None - logger.error("Arrived at code in %s() which was marked unreachable.", frame.f_code.co_name, exc_info=(AssertionError, frame.f_code.co_name, tb), extra=frame.f_locals) + logger.error("Arrived at code in %s() which was marked unreachable.", frame.f_code.co_name, exc_info=(AssertionError, frame.f_code.co_name, tb))