diff options
author | Timothy Edmund Crosley <timothy.crosley@gmail.com> | 2019-03-23 23:37:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-23 23:37:15 -0700 |
commit | 007dabd186d7ce6cdfe7e95642e511312fe53b7d (patch) | |
tree | 79dee80ba13921898d4e618d8c0905bdc2bc375d | |
parent | cd653c3115aa8da993fb4e9f722f2cb9780199c0 (diff) | |
parent | 338766195cad9ebd2b3b2c974f3549da4666e2b9 (diff) | |
download | isort-007dabd186d7ce6cdfe7e95642e511312fe53b7d.tar.gz |
Merge pull request #913 from timothycrosley/feature/fix-issue-902
Feature/fix issue 902
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | isort/settings.py | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f85ff4a1..6a5cba78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog ### 4.3.16 - March 23, 2019 - hot fix release - Fixed issue #909 - skip and skip-glob are not enforced when using settings-path. - Fixed issue #907 - appdirs optional requirement does not correctly specify version +- Fixed issue #902 - Too broad warning about missing toml package - Fixed issue #778 - remove `user` from known standard library as it's no longer in any supported Python version. ### 4.3.15 - March 10, 2019 - hot fix release diff --git a/isort/settings.py b/isort/settings.py index fca84678..bdadc711 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -289,10 +289,10 @@ def _get_config_data(file_path, sections): config_section = config_section.get(key, {}) settings.update(config_section) else: - warnings.warn( - "Found %s but toml package is not installed. To configure " - "isort with %s, install with 'isort[pyproject]'." % (file_path, file_path) - ) + if '[tool.isort]' in config_file.read(): + warnings.warn("Found {} with [tool.isort] section, but toml package is not installed. " + "To configure isort with {}, install with 'isort[pyproject]'.".format(file_path, + file_path)) else: if file_path.endswith('.editorconfig'): line = '\n' |