Commit 17af8d69 authored by Stefan Behnel's avatar Stefan Behnel

Allow '# cython: …' module level directives in Cython utility code.

parent ab9086bf
......@@ -280,7 +280,7 @@ class UtilityCodeBase(object):
_, ext = os.path.splitext(path)
if ext in ('.pyx', '.py', '.pxd', '.pxi'):
comment = '#'
strip_comments = partial(re.compile(r'^\s*#.*').sub, '')
strip_comments = partial(re.compile(r'^\s*#(?!\s*cython\s*:).*').sub, '')
rstrip = StringEncoding._unicode.rstrip
else:
comment = '/'
......
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