Skip to content

Commit

Permalink
Remove distutils dependency (#315)
Browse files Browse the repository at this point in the history
* Remove distutils dependency

* Fix up exception message to match test expectations
  • Loading branch information
jborean93 authored May 10, 2021
1 parent eba9ce0 commit b935aca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

### Version 0.4.2
- Dropped Python 3.5 from support matrix as it is EOL.
- Remove dependency on `distutils` that is deprecated in Python 3.10.

### Version 0.4.1
- HOT FIX: Fixing an issue with `requests_kerbose` not imported correctly from the changes in `0.4.0`.
- HOT FIX: Fixing an issue with `requests_kerberos` not imported correctly from the changes in `0.4.0`.

### Version 0.4.0
- Ensure `server_cert_validation=ignore` supersedes ca_trust_path/env overrides
Expand Down
13 changes: 12 additions & 1 deletion winrm/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import requests.auth
import warnings

from distutils.util import strtobool
from winrm.exceptions import InvalidCredentialsError, WinRMError, WinRMTransportError
from winrm.encryption import Encryption

Expand Down Expand Up @@ -48,6 +47,18 @@
__all__ = ['Transport']


def strtobool(value):
value = value.lower()
if value in ('true', 't', 'yes', 'y', 'on', '1'):
return True

elif value in ('false', 'f', 'no', 'n', 'off', '0'):
return False

else:
raise ValueError("invalid truth value '%s'" % value)


class UnsupportedAuthArgument(Warning):
pass

Expand Down

0 comments on commit b935aca

Please sign in to comment.