Commit 5796b9b0 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix automatic annotation determination.

A header was added to the html file, now check the first 100 chars.
parent 6297cd87
...@@ -481,8 +481,7 @@ def run_pipeline(source, options, full_module_name=None, context=None): ...@@ -481,8 +481,7 @@ def run_pipeline(source, options, full_module_name=None, context=None):
html_filename = os.path.splitext(result.c_file)[0] + ".html" html_filename = os.path.splitext(result.c_file)[0] + ".html"
if os.path.exists(html_filename): if os.path.exists(html_filename):
with io.open(html_filename, "r", encoding="UTF-8") as html_file: with io.open(html_filename, "r", encoding="UTF-8") as html_file:
line = html_file.readline() if u'<!-- Generated by Cython' in html_file.read(100):
if line.startswith(u'<!-- Generated by Cython'):
options.annotate = True options.annotate = True
# Get pipeline # Get pipeline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment