@@ -662,7 +662,7 @@ def formatException(self, ei):
662662 # See issues #9427, #1553375. Commented out for now.
663663 #if getattr(self, 'fullstack', False):
664664 # traceback.print_stack(tb.tb_frame.f_back, file=sio)
665- traceback .print_exception (ei [0 ], ei [1 ], tb , None , sio )
665+ traceback .print_exception (ei [0 ], ei [1 ], tb , limit = None , file = sio )
666666 s = sio .getvalue ()
667667 sio .close ()
668668 if s [- 1 :] == "\n " :
@@ -1080,14 +1080,14 @@ def handleError(self, record):
10801080 The record which was being processed is passed in to this method.
10811081 """
10821082 if raiseExceptions and sys .stderr : # see issue 13807
1083- t , v , tb = sys .exc_info ()
1083+ exc = sys .exception ()
10841084 try :
10851085 sys .stderr .write ('--- Logging error ---\n ' )
1086- traceback .print_exception (t , v , tb , None , sys .stderr )
1086+ traceback .print_exception (exc , limit = None , file = sys .stderr )
10871087 sys .stderr .write ('Call stack:\n ' )
10881088 # Walk the stack frame up until we're out of logging,
10891089 # so as to print the calling context.
1090- frame = tb .tb_frame
1090+ frame = exc . __traceback__ .tb_frame
10911091 while (frame and os .path .dirname (frame .f_code .co_filename ) ==
10921092 __path__ [0 ]):
10931093 frame = frame .f_back
@@ -1112,7 +1112,7 @@ def handleError(self, record):
11121112 except OSError : #pragma: no cover
11131113 pass # see issue 5971
11141114 finally :
1115- del t , v , tb
1115+ del exc
11161116
11171117 def __repr__ (self ):
11181118 level = getLevelName (self .level )
0 commit comments