[svn r51292] Just another except, in order to represent source when it's not there.

--HG--
branch : trunk
This commit is contained in:
fijal 2008-02-05 15:35:49 +01:00
parent ba91810a17
commit 37d357ff4c
1 changed files with 5 additions and 2 deletions

View File

@ -71,8 +71,11 @@ class Presenter(object):
s = str(source.getstatement(len(source)-1))
except KeyboardInterrupt:
raise
except:
s = str(source[-1])
except:
try:
s = str(source[-1])
except IndexError:
s = "<Cannot get source>"
indent = " " * (4 + (len(s) - len(s.lstrip())))
# get the real exception information out
lines = excinfo.exconly(tryshort=True).split('\n')