diff options
| author | ymdatta <ymdatta@protonmail.com> | 2018-10-28 17:21:39 +0530 |
|---|---|---|
| committer | ymdatta <ymdatta@protonmail.com> | 2018-10-28 17:21:39 +0530 |
| commit | 6341d1382e0ab14043396e8a9fbb18c27a3e236c (patch) | |
| tree | b843a90b093791228985ec145750292fa85e76d1 /src/flake8 | |
| parent | 4773995430e56f5669861438cc3ce2845953ad51 (diff) | |
| download | flake8-6341d1382e0ab14043396e8a9fbb18c27a3e236c.tar.gz | |
Add support for optparse's 'float' and 'complex' types.
This helps normalize_from_setuptools, to handle all
optparse's standard-option-types.
Fixes #452
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/options/manager.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/flake8/options/manager.py b/src/flake8/options/manager.py index 3f4e883..0ded13a 100644 --- a/src/flake8/options/manager.py +++ b/src/flake8/options/manager.py @@ -156,6 +156,10 @@ class Option(object): value = self.normalize(value) if self.type == "int" or self.action == "count": return int(value) + elif self.type == "float": + return float(value) + elif self.type == "complex": + return complex(value) if self.action in ("store_true", "store_false"): value = str(value).upper() if value in ("1", "T", "TRUE", "ON"): |
