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:
Vadim Nikolaev 2022-04-28 20:17:23 +05:00 committed by GitHub
parent 8ed3e3d07e
commit c6800e0c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -62,6 +62,10 @@
<!-- Changes that improve Black's performance. -->
### Vim Plugin
- Fixed strtobool function. It didn't parse true/on/false/off. (#3025)
## 22.3.0
### Preview style

View File

@ -5,9 +5,9 @@ import sys
import vim
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
if text.lower() in ['n', 'no', 'f', 'false' 'off', '0']:
if text.lower() in ['n', 'no', 'f', 'false', 'off', '0']:
return False
raise ValueError(f"{text} is not convertable to boolean")