Skip to content

Commit

Permalink
Add column marker to ARTIQ exception traceback.
Browse files Browse the repository at this point in the history
whitequark committed Aug 8, 2015
1 parent 27d2390 commit 96c7701
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion artiq/language/core.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
Core ARTIQ extensions to the Python language.
"""

import linecache
import linecache, re
from collections import namedtuple
from functools import wraps

@@ -320,5 +320,6 @@ def __str__(self):
function=self.function))
line = linecache.getline(self.filename, self.line)
lines.append(" {}".format(line.strip() if line else "<unknown>"))
lines.append(" {}^".format(" " * (self.column - re.search(r"^\s+", line).end())))

return "\n".join(lines)

0 comments on commit 96c7701

Please sign in to comment.