diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba4a2d..b94f268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.0.1] - 2024-08-12 + +BUG: fix a crash in inifix-format on single-core machines + ## [5.0.0] - 2024-08-09 ### API changes diff --git a/src/inifix/__init__.py b/src/inifix/__init__.py index 3ed5f0d..dee75f4 100644 --- a/src/inifix/__init__.py +++ b/src/inifix/__init__.py @@ -5,4 +5,4 @@ from .validation import validate_inifile_schema from .format import format_string -__version__ = "5.0.0" +__version__ = "5.0.1" diff --git a/src/inifix/format.py b/src/inifix/format.py index 1223d41..423fc28 100644 --- a/src/inifix/format.py +++ b/src/inifix/format.py @@ -168,7 +168,8 @@ def main(argv: list[str] | None = None) -> int: args_report_noop=args.report_noop, args_diff=args.diff, ) - with ThreadPoolExecutor(max_workers=int((os.cpu_count() or 2) / 2)) as executor: + cpu_count = os.cpu_count() or 1 + with ThreadPoolExecutor(max_workers=max(1, int(cpu_count / 2))) as executor: futures = [executor.submit(closure, file) for file in args.files] results = [f.result() for f in futures]