diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2021-03-20 00:06:38 -0700 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2021-03-20 00:06:38 -0700 |
commit | 404d809a692d68db0f36016b91171befec48be81 (patch) | |
tree | 38a63bb27738c065bc621fcbe538b91e87d50402 | |
parent | 0ee873365c722d5eea95e0e838b771f4b06a61e1 (diff) | |
download | isort-issue/1566.tar.gz |
Fix issue #1566: Fixed single location parsed line separator isn't usedissue/1566
-rw-r--r-- | isort/output.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/isort/output.py b/isort/output.py index 13f72a3d..61c2e30e 100644 --- a/isort/output.py +++ b/isort/output.py @@ -504,7 +504,13 @@ def _with_from_imports( config=config, multi_line_output=wrap.Modes.VERTICAL_GRID, # type: ignore ) - if max(len(x) for x in import_statement.split("\n")) > config.line_length: + if ( + max( + len(import_line) + for import_line in import_statement.split(parsed.line_separator) + ) + > config.line_length + ): import_statement = other_import_statement if not do_multiline_reformat and len(import_statement) > config.line_length: import_statement = wrap.line(import_statement, parsed.line_separator, config) |