mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
Merge pull request #90 from yan12125/fix-for-python38
Fix running on Python 3.8
This commit is contained in:
commit
22c7b5db20
2 changed files with 8 additions and 2 deletions
|
@ -13,7 +13,7 @@ import logging
|
|||
|
||||
class TornadoLogFormatter(logging.Formatter):
|
||||
def __init__(self, color, *args, **kwargs):
|
||||
super().__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._color = color
|
||||
if color:
|
||||
import curses
|
||||
|
|
|
@ -64,7 +64,7 @@ class _Logger(logging.Logger):
|
|||
|
||||
_structlog_dir = os.path.dirname(structlog.__file__)
|
||||
|
||||
def findCaller(self, stack_info=False):
|
||||
def findCaller(self, stack_info=False, stacklevel=1):
|
||||
"""
|
||||
Find the stack frame of the caller so that we can note the source
|
||||
file name, line number and function name.
|
||||
|
@ -74,6 +74,12 @@ class _Logger(logging.Logger):
|
|||
#IronPython isn't run with -X:Frames.
|
||||
if f is not None:
|
||||
f = f.f_back
|
||||
orig_f = f
|
||||
while f and stacklevel > 1:
|
||||
f = f.f_back
|
||||
stacklevel -= 1
|
||||
if not f:
|
||||
f = orig_f
|
||||
rv = "(unknown file)", 0, "(unknown function)", None
|
||||
while hasattr(f, "f_code"):
|
||||
co = f.f_code
|
||||
|
|
Loading…
Add table
Reference in a new issue