From 0a9399329f7fa78b28e4c6333dc7740280f454e3 Mon Sep 17 00:00:00 2001 From: fijal Date: Thu, 25 Jan 2007 18:13:24 +0100 Subject: [PATCH] [svn r37348] Fallback --HG-- branch : trunk --- py/test/rsession/outcome.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/py/test/rsession/outcome.py b/py/test/rsession/outcome.py index 35e4b1d5d..741be2b4e 100644 --- a/py/test/rsession/outcome.py +++ b/py/test/rsession/outcome.py @@ -34,10 +34,13 @@ class Outcome(object): relline = lineno - tb_entry.frame.code.firstlineno path = str(tb_entry.path) #try: - if tb_style == 'long': - source = str(tb_entry.getsource()) - else: - source = str(tb_entry.getsource()).split("\n")[relline] + try: + if tb_style == 'long': + source = str(tb_entry.getsource()) + else: + source = str(tb_entry.getsource()).split("\n")[relline] + except py.error.ENOENT: + source = "[cannot get source]" name = tb_entry.frame.code.raw.co_name # XXX: Bare except. What can getsource() raise anyway? # SyntaxError, AttributeError, IndentationError for sure, check it