summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2017-05-30 21:49:54 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2017-05-30 21:49:54 -0700
commit6157dbf8a75c009f0fc54ca1907536bf21f4f8cb (patch)
tree0fd656ad1828c262ceeea8810b9e26cae4c4d4e7
parent75b9f40868bbc8b4929532d7f7d9927406893556 (diff)
downloadisort-6157dbf8a75c009f0fc54ca1907536bf21f4f8cb.tar.gz
Implement fix for comment issue with force sort within sections
-rw-r--r--isort/isort.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/isort/isort.py b/isort/isort.py
index 33af9dec..7f8cc97d 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -536,6 +536,9 @@ class SortImports(object):
if self.config['force_sort_within_sections']:
def by_module(line):
+ if line.startswith('#'):
+ return '#'
+
line = re.sub('^from ', '', line)
line = re.sub('^import ', '', line)
if not self.config['order_by_type']: