summaryrefslogtreecommitdiff
path: root/isort/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'isort/api.py')
-rw-r--r--isort/api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/isort/api.py b/isort/api.py
index 8d435b21..0aae7711 100644
--- a/isort/api.py
+++ b/isort/api.py
@@ -184,7 +184,7 @@ def sort_imports(
in_top_comment = False
first_comment_index_end = index - 1
- if not stripped_line.startswith("#") and '"' in line or "'" in line:
+ if (not stripped_line.startswith("#") or in_quote) and '"' in line or "'" in line:
char_index = 0
if first_comment_index_start == -1 and (
line.startswith('"') or line.startswith("'")