parent
e4044030b3
commit
0a9399329f
|
@ -34,10 +34,13 @@ class Outcome(object):
|
||||||
relline = lineno - tb_entry.frame.code.firstlineno
|
relline = lineno - tb_entry.frame.code.firstlineno
|
||||||
path = str(tb_entry.path)
|
path = str(tb_entry.path)
|
||||||
#try:
|
#try:
|
||||||
|
try:
|
||||||
if tb_style == 'long':
|
if tb_style == 'long':
|
||||||
source = str(tb_entry.getsource())
|
source = str(tb_entry.getsource())
|
||||||
else:
|
else:
|
||||||
source = str(tb_entry.getsource()).split("\n")[relline]
|
source = str(tb_entry.getsource()).split("\n")[relline]
|
||||||
|
except py.error.ENOENT:
|
||||||
|
source = "[cannot get source]"
|
||||||
name = tb_entry.frame.code.raw.co_name
|
name = tb_entry.frame.code.raw.co_name
|
||||||
# XXX: Bare except. What can getsource() raise anyway?
|
# XXX: Bare except. What can getsource() raise anyway?
|
||||||
# SyntaxError, AttributeError, IndentationError for sure, check it
|
# SyntaxError, AttributeError, IndentationError for sure, check it
|
||||||
|
|
Loading…
Reference in New Issue