diff options
author | Jeppe Fihl-Pearson <jeppe@tenzer.dk> | 2019-03-04 12:58:50 +0000 |
---|---|---|
committer | Jeppe Fihl-Pearson <jeppe@tenzer.dk> | 2019-03-04 12:58:50 +0000 |
commit | 02195f0e7a56eea7f95d4f171aae165e8ef9c8b4 (patch) | |
tree | 017457540482d92ff7413deea12e314bb2ce64bc | |
parent | 638746f219dbf9f12fdeb783f062c8d8d09c4152 (diff) | |
download | isort-02195f0e7a56eea7f95d4f171aae165e8ef9c8b4.tar.gz |
Support integer values for `multi_line_output` from TOML files
TOML is a typed file format so if you had `multi_line_output = 3` specified in
your `pyproject.toml` file you would get an error like this after the changes
in https://github.com/timothycrosley/isort/pull/860 were merged in:
> TypeError: getattr(): attribute name must be string
This change makes sure the attribute name is a string when passed to `getattr()`
to avoid errors like this going forward.
-rw-r--r-- | isort/settings.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/isort/settings.py b/isort/settings.py index 165e500a..68e35a24 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -67,7 +67,7 @@ class WrapModes(enum.Enum): @staticmethod def from_string(value: str) -> 'WrapModes': - return getattr(WrapModes, value, None) or WrapModes(int(value)) + return getattr(WrapModes, str(value), None) or WrapModes(int(value)) # Note that none of these lists must be complete as they are simply fallbacks for when included auto-detection fails. |