pylint renamed variables

This patch renames some variables to avoid pylint warning about

Variable name "f" doesn't conform to snake_case naming style (invalid-name)

f is now file
th is now the_en
n is now count
This commit is contained in:
Rodolfo García Peñas (kix) 2020-11-01 08:21:24 +01:00
parent cbfcd38bca
commit 3be65bf5dd

View File

@ -12,14 +12,15 @@ import traceback
def dump(out): def dump(out):
""" Dumps current stack trace into I/O object 'out' """ """ Dumps current stack trace into I/O object 'out' """
id2name = {} id2name = {}
for th in threading.enumerate(): for th_en in threading.enumerate():
id2name[th.ident] = th.name id2name[th_en.ident] = th_en.name
n = 0
count = 0
for i, stack in list(sys._current_frames().items()): for i, stack in list(sys._current_frames().items()):
out.write("\n# Thread #%d (id=%d), %s\n" % (n, i, id2name[i])) out.write("\n# Thread #%d (id=%d), %s\n" % (count, i, id2name[i]))
n = n + 1 count = count + 1
for f, lno, name, line in traceback.extract_stack(stack): for file, lno, name, line in traceback.extract_stack(stack):
out.write('File: "%s", line %d, in %s' % (f, lno, name)) out.write('File: "%s", line %d, in %s' % (file, lno, name))
if line: if line:
out.write(" %s" % (line.strip())) out.write(" %s" % (line.strip()))
out.write("\n") out.write("\n")