summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2019-12-07 23:28:12 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-12-07 23:28:12 -0800
commit40e861d43bd57ca4562491ebd7d62f5a25b2b13e (patch)
tree38ef4c53d19265b74c50611ccfa4cba371917284
parent896d6ce0ca81f49fee5816e1af55dcde3e51c075 (diff)
downloadisort-40e861d43bd57ca4562491ebd7d62f5a25b2b13e.tar.gz
Ignore comments when determining end of imports
-rw-r--r--isort/parse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/isort/parse.py b/isort/parse.py
index b5b285ae..e5999822 100644
--- a/isort/parse.py
+++ b/isort/parse.py
@@ -512,7 +512,7 @@ def identify_contiguous_imports(
import_section += line
if "(" in stripped_line and not ")" in stripped_line:
nested_line = line
- nested_stripped_line = nested_line.strip()
+ nested_stripped_line = nested_line.strip().split("#")[0]
while not ")" in nested_stripped_line:
nested_line = input_stream.readline()
nested_stripped_line = nested_line.strip()