From 3af3a6db8d8c53d7475e42a2d360ef4517bec69e Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Fri, 19 May 2017 23:57:43 -0700 Subject: Fix bug --- isort/isort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isort/isort.py b/isort/isort.py index c5290d58..a1f466c2 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -538,7 +538,7 @@ class SortImports(object): section_title = self.config.get('import_heading_' + str(section_name).lower(), '') if section_title: section_comment = "# {0}".format(section_title) - if not section_comment in self.out_lines[0:1]: + if not section_comment in self.out_lines[0:1] and not section_comment in self.in_lines[0:1]: section_output.insert(0, section_comment) output += section_output + ([''] * self.config['lines_between_sections']) -- cgit v1.2.1