Commit e8e4eeb2 authored by Julien Muchembled's avatar Julien Muchembled

fixup! DeadlockDebugger: don't print "MySQL query: no query" when there is no query

parent 18c96931
...@@ -69,7 +69,7 @@ def dump_threads(): ...@@ -69,7 +69,7 @@ def dump_threads():
while f is not None: while f is not None:
code = f.f_code code = f.f_code
if code is DB._query.func_code: if code is DB._query.func_code:
mysql_info = "MySQL query:\n%s\n" % f.f_locals['query'] mysql_info = "\nMySQL query:\n%s\n" % f.f_locals['query']
break break
f = f.f_back f = f.f_back
except ImportError: except ImportError:
...@@ -77,7 +77,7 @@ def dump_threads(): ...@@ -77,7 +77,7 @@ def dump_threads():
output = StringIO() output = StringIO()
traceback.print_stack(frame, file=output) traceback.print_stack(frame, file=output)
res.append("Thread %s%s:\n%s\n%s" % res.append("Thread %s%s:\n%s%s" %
(thread_id, reqinfo, output.getvalue(), mysql_info)) (thread_id, reqinfo, output.getvalue(), mysql_info))
res.append("End of dump\n") res.append("End of dump\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment