From 5916c10b241d9362f459edfae47c49460e848676 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 28 Aug 2015 04:55:46 -0500 Subject: [PATCH] ARTIQException: replace ARTIQ library path with in tracebacks. --- artiq/language/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/language/core.py b/artiq/language/core.py index c87cc8e0f..d69cd8a81 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -2,7 +2,7 @@ Core ARTIQ extensions to the Python language. """ -import linecache, re +import os, linecache, re from collections import namedtuple from functools import wraps @@ -394,6 +394,8 @@ class ARTIQException(Exception): else: formatted_address = " (RA=0x{:x})".format(address) + filename = filename.replace(os.path.normpath(os.path.join(os.path.dirname(__file__), + "..")), "") if column == -1: lines.append(" File \"{file}\", line {line}, in {function}{address}". format(file=filename, line=line, function=function,