forked from M-Labs/artiq
1
0
Fork 0

embedding: ignore empty lines, like annotations, before kernel functions.

Fixes #363.
This commit is contained in:
whitequark 2016-04-26 02:25:08 +00:00 committed by Sebastien Bourdeauducq
parent 24e24ddca4
commit 9b04778f66
1 changed files with 3 additions and 3 deletions

View File

@ -611,10 +611,10 @@ class Stitcher:
line = function.__code__.co_firstlineno line = function.__code__.co_firstlineno
name = function.__code__.co_name name = function.__code__.co_name
source_line = linecache.getline(filename, line) source_line = linecache.getline(filename, line).lstrip()
while source_line.lstrip().startswith("@"): while source_line.startswith("@") or source_line == "":
line += 1 line += 1
source_line = linecache.getline(filename, line) source_line = linecache.getline(filename, line).lstrip()
if "<lambda>" in function.__qualname__: if "<lambda>" in function.__qualname__:
column = 0 # can't get column of lambda column = 0 # can't get column of lambda