Skip to content

Commit fa66bfe

Browse files
committed
fix: fix compatibility with Python 3.12
Remove use of `distutils` which has been removed from Python 3.12 (see: https://docs.python.org/3/whatsnew/3.12.html#summary-release-highlights) Fixes #215
1 parent 95f23de commit fa66bfe

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Remove support for the SVK CVS (@MightyCreak)
1313

14+
### Fixed
15+
16+
- Fix compatibility with Python 3.12: remove use of `distutils` (@MightyCreak)
17+
1418
## 0.8.2 - 2023-04-16
1519

1620
### Added

src/diffuse/resources.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import re
3131
import shlex
3232

33-
from distutils import util
3433
from gettext import gettext as _
3534
from typing import Dict, Final, List, Optional, Pattern, Set, Tuple
3635

@@ -322,7 +321,7 @@ def getOption(self, option: str) -> str:
322321

323322
def getOptionAsBool(self, option: str) -> bool:
324323
'''Get the option value, casted as a boolean.'''
325-
return bool(util.strtobool(self.getOption(option)))
324+
return bool(self.getOption(option).lower() in ['true', '1'])
326325

327326
# string resources
328327
def getString(self, symbol: str) -> str:

0 commit comments

Comments
 (0)