diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-07 23:28:12 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-07 23:28:12 -0800 |
commit | 40e861d43bd57ca4562491ebd7d62f5a25b2b13e (patch) | |
tree | 38ef4c53d19265b74c50611ccfa4cba371917284 | |
parent | 896d6ce0ca81f49fee5816e1af55dcde3e51c075 (diff) | |
download | isort-40e861d43bd57ca4562491ebd7d62f5a25b2b13e.tar.gz |
Ignore comments when determining end of imports
-rw-r--r-- | isort/parse.py | 2 |
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() |