diff --git a/isort/core.py b/isort/core.py index d587f3d01..93102e856 100644 --- a/isort/core.py +++ b/isort/core.py @@ -357,7 +357,8 @@ def write(self, *a, **kw): all_imports.extend( li for li in parsed_content.in_lines - if li and li not in lines_without_imports_set + if li + and li not in lines_without_imports_set and not li.lstrip().startswith("#") )