|
@@ -159,16 +159,17 @@ def parse_py(codelet): |
|
|
|
|
|
|
|
|
def strip_encoding(lines): |
|
|
def strip_encoding(lines): |
|
|
"""Strips the encoding line from a file, which breaks the parser.""" |
|
|
"""Strips the encoding line from a file, which breaks the parser.""" |
|
|
|
|
|
it = iter(lines) |
|
|
try: |
|
|
try: |
|
|
first = next(lines) |
|
|
|
|
|
|
|
|
first = next(it) |
|
|
if not encoding_re.match(first): |
|
|
if not encoding_re.match(first): |
|
|
yield first |
|
|
yield first |
|
|
second = next(lines) |
|
|
|
|
|
|
|
|
second = next(it) |
|
|
if not encoding_re.match(second): |
|
|
if not encoding_re.match(second): |
|
|
yield second |
|
|
yield second |
|
|
except StopIteration: |
|
|
except StopIteration: |
|
|
return |
|
|
return |
|
|
for line in lines: |
|
|
|
|
|
|
|
|
for line in it: |
|
|
yield line |
|
|
yield line |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|