summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 23:43:47 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 23:43:47 -0500
commitb1ccf0be9ec508319ca2d7f09293c2d52f4d9ddb (patch)
tree7cf54d68e0604ea682088a4256b2a6c0383c85ad
parentf482da3752f520f74da6b9de098f1735b3b540cf (diff)
downloadisort-b1ccf0be9ec508319ca2d7f09293c2d52f4d9ddb.tar.gz
Fix how isort handles custom placement, in order to ensure it can be ran on itself
-rw-r--r--isort/isort.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/isort/isort.py b/isort/isort.py
index 34ae27d0..8ec00dd8 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -641,7 +641,7 @@ class SortImports(object):
self.import_index = self.index - 1
continue
- if "isort:" + "imports-" in line:
+ if "isort:" + "imports-" in line and line.startswith("#"):
section = line.split("isort:" + "imports-")[-1].split()[0]
self.place_imports[section.upper()] = []
self.import_placements[line] = section.upper()