fix some standalone-script running issues:

* standalone can run standalone tests
* exception handling is more careful with assuming valid filenames
* bits here and there

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-12-30 18:11:00 +01:00
parent 6495007aba
commit a42d9eb9f6
5 changed files with 22 additions and 16 deletions

View File

@@ -537,8 +537,9 @@ class FormattedExcinfo(object):
else:
if self.style == "short":
line = source[line_index].lstrip()
trybasename = getattr(entry.path, 'basename', entry.path)
lines.append(' File "%s", line %d, in %s' % (
entry.path.basename, entry.lineno+1, entry.name))
trybasename, entry.lineno+1, entry.name))
lines.append(" " + line)
if excinfo:
lines.extend(self.get_exconly(excinfo, indent=4))