diff options
author | Timothy Crosley <tcrosley@domaintools.com> | 2018-02-02 08:31:16 -0800 |
---|---|---|
committer | Timothy Crosley <tcrosley@domaintools.com> | 2018-02-02 08:31:16 -0800 |
commit | b85facec32c87f0e64a3ba7c68ce6a76be4854a7 (patch) | |
tree | 7a2cfc9f1cd71d22282cdec7656bf6ac608a424f | |
parent | 1db36205f016ae4b72bb713aedf7f96b1be43723 (diff) | |
download | isort-b85facec32c87f0e64a3ba7c68ce6a76be4854a7.tar.gz |
Finish fixing issue #654feature/fix-issue-654
-rw-r--r-- | isort/isort.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/isort/isort.py b/isort/isort.py index 0a672db3..beab947f 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -622,12 +622,18 @@ class SortImports(object): next_construct = "" self._in_quote = False tail = self.out_lines[imports_tail:] + for index, line in enumerate(tail): + in_quote = self._in_quote if not self._skip_line(line) and line.strip(): if line.strip().startswith("#") and len(tail) > (index + 1) and tail[index + 1].strip(): continue next_construct = line break + elif not in_quote: + parts = line.split() + if len(parts) >= 3 and parts[1] == '=' and "'" not in parts[0] and '"' not in parts[0]: + next_construct = line if self.config['lines_after_imports'] != -1: self.out_lines[imports_tail:0] = ["" for line in range(self.config['lines_after_imports'])] |