Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

srswinde
Copy link

@srswinde srswinde commented Jun 1, 2024

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.

elif s.lower() in ['no', 'false', 'f', 'n', '0']:
return False
else:
raise ValueError("Cannot convert {} to a bool".format(s))

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']:

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']:

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

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 '# '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants