Skip to content

Commit

Permalink
Fix #1499: detect start of tripple quote comments
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Sep 26, 2020
1 parent 0f8eff1 commit d9379fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions isort/parse.py
Expand Up @@ -200,12 +200,16 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
if skipping_line:
out_lines.append(line)
continue
elif (

lstripped_line = line.lstrip()
if (
config.float_to_top
and import_index == -1
and line
and not in_quote
and not line.strip().startswith("#")
and not lstripped_line.startswith("#")
and not lstripped_line.startswith("'''")
and not lstripped_line.startswith('"""')
):
import_index = index - 1
while import_index and not in_lines[import_index - 1]:
Expand Down

0 comments on commit d9379fb

Please sign in to comment.