diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-03-08 00:30:01 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-03-08 00:55:59 -0800 |
commit | e1f83dd486b0a5e28fcb51f1bd2b8c42fd6b692c (patch) | |
tree | 92ef7e829195a1acd7b0dd8fb85f2f752caa5dfd /isort | |
parent | 08a0265a2258a2b8d7e3b9f959629d7d92134f5f (diff) | |
download | isort-e1f83dd486b0a5e28fcb51f1bd2b8c42fd6b692c.tar.gz |
Fix issue #889: Isort should not add blank lines to beginning of file
Diffstat (limited to 'isort')
-rw-r--r-- | isort/isort.py | 2 |
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 = "" |