mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Add support for optparse's 'float' and 'complex' types.
This helps normalize_from_setuptools, to handle all optparse's standard-option-types. Fixes #452
This commit is contained in:
parent
4773995430
commit
6341d1382e
1 changed files with 4 additions and 0 deletions
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue