Skip to content

Commit d9bc6b2

Browse files
committed
Use casefold instead of lower
1 parent 1c37752 commit d9bc6b2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

auto_file_sorter/configs_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def load_json_file_into_configs(json_file: Path, configs: dict[str, str]) -> int
215215
repr(json_file),
216216
)
217217

218-
if json_file.suffix.lower() != ".json":
218+
if json_file.suffix.casefold() != ".json":
219219
configs_handling_logger.critical(
220220
"Configs can only be read from json files",
221221
)

auto_file_sorter/event_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def on_modified(
9898
def _move_file(self, file_path: Path) -> None:
9999
"""Move the file to its destination path."""
100100
destination_path: Path | None = self.extension_paths.get(
101-
file_path.suffix.lower(),
101+
file_path.suffix.casefold(),
102102
self.path_for_undefined_extensions,
103103
)
104104

auto_file_sorter/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _setup_logging(args: argparse.Namespace) -> None:
238238

239239
def _check_specified_locations(args: argparse.Namespace) -> None:
240240
"""Check the log and configs locations are their respective files types."""
241-
if args.log_location.suffix.lower() != ".log":
241+
if args.log_location.suffix.casefold() != ".log":
242242
main_logger.warning(
243243
"Given logging location '%s' is not a '.log' file. "
244244
"Using default location: '%s'",
@@ -247,7 +247,7 @@ def _check_specified_locations(args: argparse.Namespace) -> None:
247247
)
248248
args.log_location = DEFAULT_LOG_LOCATION
249249

250-
if args.configs_location.suffix.lower() != ".json":
250+
if args.configs_location.suffix.casefold() != ".json":
251251
main_logger.warning(
252252
"Given configs location '%s' is not a '.json' file. "
253253
"Using default location: '%s'",

0 commit comments

Comments
 (0)