mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
true line number is good
This commit is contained in:
parent
e51dfb192f
commit
ba57d8f755
@ -715,18 +715,20 @@ def describeException(backTrace = 4):
|
|||||||
|
|
||||||
stack = []
|
stack = []
|
||||||
while trace.tb_next:
|
while trace.tb_next:
|
||||||
|
# We need to call byteOffsetToLineno to determine the true
|
||||||
|
# line number at which the exception occurred, even though we
|
||||||
|
# have both trace.tb_lineno and frame.f_lineno, which return
|
||||||
|
# the correct line number only in non-optimized mode.
|
||||||
frame = trace.tb_frame
|
frame = trace.tb_frame
|
||||||
module = frame.f_globals.get('__name__', None)
|
module = frame.f_globals.get('__name__', None)
|
||||||
lineno = frame.f_lineno
|
lineno = byteOffsetToLineno(frame.f_code, frame.f_lasti)
|
||||||
truelineno = byteOffsetToLineno(frame.f_code, frame.f_lasti)
|
stack.append("%s:%s, " % (module, lineno))
|
||||||
stack.append("%s:%s(%s), " % (module, lineno, truelineno))
|
|
||||||
trace = trace.tb_next
|
trace = trace.tb_next
|
||||||
|
|
||||||
frame = trace.tb_frame
|
frame = trace.tb_frame
|
||||||
module = frame.f_globals.get('__name__', None)
|
module = frame.f_globals.get('__name__', None)
|
||||||
lineno = frame.f_lineno
|
lineno = byteOffsetToLineno(frame.f_code, frame.f_lasti)
|
||||||
truelineno = byteOffsetToLineno(frame.f_code, frame.f_lasti)
|
stack.append("%s:%s, " % (module, lineno))
|
||||||
stack.append("%s:%s(%s), " % (module, lineno, truelineno))
|
|
||||||
|
|
||||||
description = ""
|
description = ""
|
||||||
for i in range(len(stack) - 1, max(len(stack) - backTrace, 0) - 1, -1):
|
for i in range(len(stack) - 1, max(len(stack) - backTrace, 0) - 1, -1):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user