Skip to content

Commit b3dd45f

Browse files
committed
Fix lint and flake8 issues with the logging code
1 parent 3c618fb commit b3dd45f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

st2common/st2common/log.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from __future__ import absolute_import
1717

18+
import io
1819
import os
1920
import sys
2021
import logging
@@ -89,13 +90,14 @@ def find_caller(stack_info=False, stacklevel=1):
8990
"""
9091
if six.PY2:
9192
rv = '(unknown file)', 0, '(unknown function)'
92-
else: # python 3, has extra tuple element at the end for stack information
93+
else:
94+
# python 3, has extra tuple element at the end for stack information
9395
rv = '(unknown file)', 0, '(unknown function)', None
9496

9597
try:
9698
f = logging.currentframe()
97-
#On some versions of IronPython, currentframe() returns None if
98-
#IronPython isn't run with -X:Frames.
99+
# On some versions of IronPython, currentframe() returns None if
100+
# IronPython isn't run with -X:Frames.
99101
if f is not None:
100102
f = f.f_back
101103
orig_f = f
@@ -114,7 +116,8 @@ def find_caller(stack_info=False, stacklevel=1):
114116

115117
if six.PY2:
116118
rv = (filename, f.f_lineno, co.co_name)
117-
else: # python 3, new stack_info processing and extra tuple return value
119+
else:
120+
# python 3, new stack_info processing and extra tuple return value
118121
sinfo = None
119122
if stack_info:
120123
sio = io.StringIO()

0 commit comments

Comments
 (0)