diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2017-05-30 21:49:54 -0700 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2017-05-30 21:49:54 -0700 |
commit | 6157dbf8a75c009f0fc54ca1907536bf21f4f8cb (patch) | |
tree | 0fd656ad1828c262ceeea8810b9e26cae4c4d4e7 | |
parent | 75b9f40868bbc8b4929532d7f7d9927406893556 (diff) | |
download | isort-6157dbf8a75c009f0fc54ca1907536bf21f4f8cb.tar.gz |
Implement fix for comment issue with force sort within sections
-rw-r--r-- | isort/isort.py | 3 |
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']: |