Merge pull request #221 from MightyCreak/fix-python312

fix: fix compatibility with Python 3.12
This commit is contained in:
Creak 2024-01-06 19:40:21 -05:00 committed by GitHub
commit a64ae4f3f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove support for the SVK CVS (@MightyCreak) - Remove support for the SVK CVS (@MightyCreak)
### Fixed
- Fix compatibility with Python 3.12: remove use of `distutils` (@MightyCreak)
## 0.8.2 - 2023-04-16 ## 0.8.2 - 2023-04-16
### Added ### Added

View File

@ -30,7 +30,6 @@ import platform
import re import re
import shlex import shlex
from distutils import util
from gettext import gettext as _ from gettext import gettext as _
from typing import Dict, Final, List, Optional, Pattern, Set, Tuple from typing import Dict, Final, List, Optional, Pattern, Set, Tuple
@ -322,7 +321,7 @@ class Resources:
def getOptionAsBool(self, option: str) -> bool: def getOptionAsBool(self, option: str) -> bool:
'''Get the option value, casted as a boolean.''' '''Get the option value, casted as a boolean.'''
return bool(util.strtobool(self.getOption(option))) return bool(self.getOption(option).lower() in ['true', '1'])
# string resources # string resources
def getString(self, symbol: str) -> str: def getString(self, symbol: str) -> str: