Add column marker to ARTIQ exception traceback.

This commit is contained in:
whitequark 2015-08-08 16:09:47 +03:00
parent 27d2390fed
commit 96c770190c

View File

@ -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 @@ class ARTIQException(Exception):
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)