Skip to content

Commit 0bcb4ae

Browse files
committed
Fixed a problem with assertion() and unreachable(), which could break if certain names (like 'args') were set in the calling frame.
- Legacy-Id: 12975
1 parent 05d57f6 commit 0bcb4ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/utils/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Traceback():
7373
tb.tb_lasti = None
7474
tb.tb_lineno = frame.f_lineno
7575
tb.tb_next = None
76-
logger.error("Assertion '%s' failed.", statement, exc_info=(AssertionError, statement, tb), extra=frame.f_locals)
76+
logger.error("Assertion '%s' failed.", statement, exc_info=(AssertionError, statement, tb))
7777

7878
def unreachable():
7979
"Raises an assertion or sends traceback to admins if executed."
@@ -89,5 +89,5 @@ class Traceback():
8989
tb.tb_lasti = None
9090
tb.tb_lineno = frame.f_lineno
9191
tb.tb_next = None
92-
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)
92+
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))
9393

0 commit comments

Comments
 (0)