Fix strtobool function (#3025)
* Fix strtobool function for vim plugin * Update CHANGES.md Co-authored-by: Cooper Lees <me@cooperlees.com>
This commit is contained in:
parent
8ed3e3d07e
commit
c6800e0c65
@ -62,6 +62,10 @@
|
|||||||
|
|
||||||
<!-- Changes that improve Black's performance. -->
|
<!-- Changes that improve Black's performance. -->
|
||||||
|
|
||||||
|
### Vim Plugin
|
||||||
|
|
||||||
|
- Fixed strtobool function. It didn't parse true/on/false/off. (#3025)
|
||||||
|
|
||||||
## 22.3.0
|
## 22.3.0
|
||||||
|
|
||||||
### Preview style
|
### Preview style
|
||||||
|
@ -5,9 +5,9 @@ import sys
|
|||||||
import vim
|
import vim
|
||||||
|
|
||||||
def strtobool(text):
|
def strtobool(text):
|
||||||
if text.lower() in ['y', 'yes', 't', 'true' 'on', '1']:
|
if text.lower() in ['y', 'yes', 't', 'true', 'on', '1']:
|
||||||
return True
|
return True
|
||||||
if text.lower() in ['n', 'no', 'f', 'false' 'off', '0']:
|
if text.lower() in ['n', 'no', 'f', 'false', 'off', '0']:
|
||||||
return False
|
return False
|
||||||
raise ValueError(f"{text} is not convertable to boolean")
|
raise ValueError(f"{text} is not convertable to boolean")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user