Skip to content

Commit

Permalink
Issue PyCQA#1276: Stop parsing when meeting triple quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonjames committed Jul 8, 2020
1 parent 4c72396 commit 82b6abe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions isort/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def sorted_imports(
and tail[index + 1].strip()
):
continue
next_construct = line
next_construct += line
break
elif not in_quote:
parts = line.split()
Expand All @@ -202,8 +202,11 @@ def sorted_imports(
and "'" not in parts[0]
and '"' not in parts[0]
):
next_construct = line
next_construct += line
break

if in_quote or _in_quote:
next_construct += line + '\n'

if config.lines_after_imports != -1:
formatted_output[imports_tail:0] = ["" for line in range(config.lines_after_imports)]
Expand Down

0 comments on commit 82b6abe

Please sign in to comment.