[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

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