From 9b04778f6697fe9d29750c948352aea32be875a0 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 26 Apr 2016 02:25:08 +0000 Subject: [PATCH] embedding: ignore empty lines, like annotations, before kernel functions. Fixes #363. --- artiq/compiler/embedding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/compiler/embedding.py b/artiq/compiler/embedding.py index 3147467e6..641ef1c45 100644 --- a/artiq/compiler/embedding.py +++ b/artiq/compiler/embedding.py @@ -611,10 +611,10 @@ class Stitcher: line = function.__code__.co_firstlineno name = function.__code__.co_name - source_line = linecache.getline(filename, line) - while source_line.lstrip().startswith("@"): + source_line = linecache.getline(filename, line).lstrip() + while source_line.startswith("@") or source_line == "": line += 1 - source_line = linecache.getline(filename, line) + source_line = linecache.getline(filename, line).lstrip() if "" in function.__qualname__: column = 0 # can't get column of lambda