summaryrefslogtreecommitdiff
path: root/isort/isort.py
diff options
context:
space:
mode:
Diffstat (limited to 'isort/isort.py')
-rw-r--r--isort/isort.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/isort/isort.py b/isort/isort.py
index 8024e347..8968d5df 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -1072,7 +1072,7 @@ class SortImports(object):
'isort:imports-' not in last):
self.comments['above']['straight'].setdefault(module, []).insert(0,
self.out_lines.pop(-1))
- if len(self.out_lines) > 0:
+ if len(self.out_lines) > 0 and len(self.out_lines) != self._first_comment_index_end:
last = self.out_lines[-1].rstrip()
else:
last = ""