-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove distutils dependency #236
base: master
Are you sure you want to change the base?
Conversation
elif s.lower() in ['no', 'false', 'f', 'n', '0']: | ||
return False | ||
else: | ||
raise ValueError("Cannot convert {} to a bool".format(s)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 's'
"""Convert string to boolean.""" | ||
if s.lower() in ['yes', 'true', 't', 'y', '1']: | ||
return True | ||
elif s.lower() in ['no', 'false', 'f', 'n', '0']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 's'
from typing import List, Tuple, Union | ||
|
||
DATEFMT = "%Y-%m-%d %H:%M:%S" | ||
PRECISION = 2 | ||
|
||
|
||
def strtobool(value: str) -> bool: | ||
"""Convert string to boolean.""" | ||
if s.lower() in ['yes', 'true', 't', 'y', '1']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 's'
@@ -14,13 +14,22 @@ | |||
from typing import List | |||
|
|||
# pylint: disable=no-name-in-module | |||
from distutils import util | |||
#from distutils import util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
block comment should start with '# '
The distutils module was deprecated in python 3.10 and is removed from 3.12. This pull request implements
strtobool
as a function following the description here.